@activade/open-workflows 1.0.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.
@@ -0,0 +1,651 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ var So=Object.create;var{getPrototypeOf:Eo,defineProperty:Te,getOwnPropertyNames:Oo}=Object;var Io=Object.prototype.hasOwnProperty;var P=(o,s,t)=>{t=o!=null?So(Eo(o)):{};let i=s||!o||!o.__esModule?Te(t,"default",{value:o,enumerable:!0}):t;for(let n of Oo(o))if(!Io.call(i,n))Te(i,n,{get:()=>o[n],enumerable:!0});return i};var J=(o,s)=>()=>(s||o((s={exports:{}}).exports,s),s.exports);var X=J((Os,Le)=>{var Q={to(o,s){if(!s)return`\x1B[${o+1}G`;return`\x1B[${s+1};${o+1}H`},move(o,s){let t="";if(o<0)t+=`\x1B[${-o}D`;else if(o>0)t+=`\x1B[${o}C`;if(s<0)t+=`\x1B[${-s}A`;else if(s>0)t+=`\x1B[${s}B`;return t},up:(o=1)=>`\x1B[${o}A`,down:(o=1)=>`\x1B[${o}B`,forward:(o=1)=>`\x1B[${o}C`,backward:(o=1)=>`\x1B[${o}D`,nextLine:(o=1)=>"\x1B[E".repeat(o),prevLine:(o=1)=>"\x1B[F".repeat(o),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Co={up:(o=1)=>"\x1B[S".repeat(o),down:(o=1)=>"\x1B[T".repeat(o)},Ro={screen:"\x1B[2J",up:(o=1)=>"\x1B[1J".repeat(o),down:(o=1)=>"\x1B[J".repeat(o),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(o){let s="";for(let t=0;t<o;t++)s+=this.line+(t<o-1?Q.up():"");if(o)s+=Q.left;return s}};Le.exports={cursor:Q,scroll:Co,erase:Ro,beep:"\x07"}});var F=J((Is,Z)=>{var j=process||{},$e=j.argv||[],H=j.env||{},Ao=!(!!H.NO_COLOR||$e.includes("--no-color"))&&(!!H.FORCE_COLOR||$e.includes("--color")||j.platform==="win32"||(j.stdout||{}).isTTY&&H.TERM!=="dumb"||!!H.CI),_o=(o,s,t=o)=>(i)=>{let n=""+i,r=n.indexOf(s,o.length);return~r?o+No(n,s,t,r)+s:o+n+s},No=(o,s,t,i)=>{let n="",r=0;do n+=o.substring(r,i)+t,r=i+s.length,i=o.indexOf(s,r);while(~i);return n+o.substring(r)},Pe=(o=Ao)=>{let s=o?_o:()=>String;return{isColorSupported:o,reset:s("\x1B[0m","\x1B[0m"),bold:s("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:s("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:s("\x1B[3m","\x1B[23m"),underline:s("\x1B[4m","\x1B[24m"),inverse:s("\x1B[7m","\x1B[27m"),hidden:s("\x1B[8m","\x1B[28m"),strikethrough:s("\x1B[9m","\x1B[29m"),black:s("\x1B[30m","\x1B[39m"),red:s("\x1B[31m","\x1B[39m"),green:s("\x1B[32m","\x1B[39m"),yellow:s("\x1B[33m","\x1B[39m"),blue:s("\x1B[34m","\x1B[39m"),magenta:s("\x1B[35m","\x1B[39m"),cyan:s("\x1B[36m","\x1B[39m"),white:s("\x1B[37m","\x1B[39m"),gray:s("\x1B[90m","\x1B[39m"),bgBlack:s("\x1B[40m","\x1B[49m"),bgRed:s("\x1B[41m","\x1B[49m"),bgGreen:s("\x1B[42m","\x1B[49m"),bgYellow:s("\x1B[43m","\x1B[49m"),bgBlue:s("\x1B[44m","\x1B[49m"),bgMagenta:s("\x1B[45m","\x1B[49m"),bgCyan:s("\x1B[46m","\x1B[49m"),bgWhite:s("\x1B[47m","\x1B[49m"),blackBright:s("\x1B[90m","\x1B[39m"),redBright:s("\x1B[91m","\x1B[39m"),greenBright:s("\x1B[92m","\x1B[39m"),yellowBright:s("\x1B[93m","\x1B[39m"),blueBright:s("\x1B[94m","\x1B[39m"),magentaBright:s("\x1B[95m","\x1B[39m"),cyanBright:s("\x1B[96m","\x1B[39m"),whiteBright:s("\x1B[97m","\x1B[39m"),bgBlackBright:s("\x1B[100m","\x1B[49m"),bgRedBright:s("\x1B[101m","\x1B[49m"),bgGreenBright:s("\x1B[102m","\x1B[49m"),bgYellowBright:s("\x1B[103m","\x1B[49m"),bgBlueBright:s("\x1B[104m","\x1B[49m"),bgMagentaBright:s("\x1B[105m","\x1B[49m"),bgCyanBright:s("\x1B[106m","\x1B[49m"),bgWhiteBright:s("\x1B[107m","\x1B[49m")}};Z.exports=Pe();Z.exports.createColors=Pe});var yo=J((vt,bs)=>{bs.exports={name:"@activade/open-workflows",version:"0.0.1",description:"OpenCode plugin with skills for AI-powered GitHub workflows: PR reviews, issue labeling, doc sync, and releases",keywords:["opencode","opencode-plugin","opencode-skills","github","ai","code-review","automation","pr-review","issue-labeling"],author:"activadee",license:"MIT",repository:{type:"git",url:"git+https://github.com/activadee/open-workflows.git"},type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{"open-workflows":"./dist/cli/index.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"}},files:["dist","README.md","LICENSE"],scripts:{clean:"rm -rf dist",build:"bun run clean && bun build src/index.ts --outdir dist --target bun --format esm -e @opencode-ai/plugin -e @opencode-ai/plugin/tool --minify && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --minify && bun x tsc --declaration --emitDeclarationOnly --outDir dist",dev:"bun run build --watch",typecheck:"tsc --noEmit",test:"bun run build && bun test",prepublishOnly:"bun run clean && bun run build && bun run typecheck"},dependencies:{"@clack/prompts":"^0.10.0","@opencode-ai/plugin":"^1.0.204",picocolors:"^1.1.1",zod:"~4.1.8"},devDependencies:{"@types/node":"^22.0.0","bun-types":"latest",typescript:"^5.6.0"},engines:{node:">=18.0.0"}}});import{stripVTControlCharacters as le}from"util";var u=P(X(),1);import{stdin as qe,stdout as Ve}from"process";import*as R from"readline";import We from"readline";import{Writable as To}from"stream";function Lo({onlyFirst:o=!1}={}){let s=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(s,o?void 0:"g")}var $o=Lo();function ze(o){if(typeof o!="string")throw TypeError(`Expected a \`string\`, got \`${typeof o}\``);return o.replace($o,"")}function Ye(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Je={exports:{}};(function(o){var s={};o.exports=s,s.eastAsianWidth=function(i){var n=i.charCodeAt(0),r=i.length==2?i.charCodeAt(1):0,e=n;return 55296<=n&&n<=56319&&56320<=r&&r<=57343&&(n&=1023,r&=1023,e=n<<10|r,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},s.characterLength=function(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function t(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}s.length=function(i){for(var n=t(i),r=0,e=0;e<n.length;e++)r=r+this.characterLength(n[e]);return r},s.slice=function(i,n,r){textLen=s.length(i),n=n||0,r=r||1,n<0&&(n=textLen+n),r<0&&(r=textLen+r);for(var e="",l=0,m=t(i),c=0;c<m.length;c++){var h=m[c],p=s.length(h);if(l>=n-(p==2?1:0))if(l+p<=r)e+=h;else break;l+=p}return e}})(Je);var Po=Je.exports,Wo=Ye(Po),Uo=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Ho=Ye(Uo);function W(o,s={}){if(typeof o!="string"||o.length===0||(s={ambiguousIsNarrow:!0,...s},o=ze(o),o.length===0))return 0;o=o.replace(Ho()," ");let t=s.ambiguousIsNarrow?1:2,i=0;for(let n of o){let r=n.codePointAt(0);if(r<=31||r>=127&&r<=159||r>=768&&r<=879)continue;switch(Wo.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=t;break;default:i+=1}}return i}var D=10,Ue=(o=0)=>(s)=>`\x1B[${s+o}m`,He=(o=0)=>(s)=>`\x1B[${38+o};5;${s}m`,je=(o=0)=>(s,t,i)=>`\x1B[${38+o};2;${s};${t};${i}m`,d={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(d.modifier);var jo=Object.keys(d.color),Go=Object.keys(d.bgColor);[...jo,...Go];function Bo(){let o=new Map;for(let[s,t]of Object.entries(d)){for(let[i,n]of Object.entries(t))d[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[i]=d[i],o.set(n[0],n[1]);Object.defineProperty(d,s,{value:t,enumerable:!1})}return Object.defineProperty(d,"codes",{value:o,enumerable:!1}),d.color.close="\x1B[39m",d.bgColor.close="\x1B[49m",d.color.ansi=Ue(),d.color.ansi256=He(),d.color.ansi16m=je(),d.bgColor.ansi=Ue(D),d.bgColor.ansi256=He(D),d.bgColor.ansi16m=je(D),Object.defineProperties(d,{rgbToAnsi256:{value:(s,t,i)=>s===t&&t===i?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:(s)=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(s.toString(16));if(!t)return[0,0,0];let[i]=t;i.length===3&&(i=[...i].map((r)=>r+r).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:(s)=>d.rgbToAnsi256(...d.hexToRgb(s)),enumerable:!1},ansi256ToAnsi:{value:(s)=>{if(s<8)return 30+s;if(s<16)return 90+(s-8);let t,i,n;if(s>=232)t=((s-232)*10+8)/255,i=t,n=t;else{s-=16;let l=s%36;t=Math.floor(s/36)/5,i=Math.floor(l/6)/5,n=l%6/5}let r=Math.max(t,i,n)*2;if(r===0)return 30;let e=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(t));return r===2&&(e+=60),e},enumerable:!1},rgbToAnsi:{value:(s,t,i)=>d.ansi256ToAnsi(d.rgbToAnsi256(s,t,i)),enumerable:!1},hexToAnsi:{value:(s)=>d.ansi256ToAnsi(d.hexToAnsi256(s)),enumerable:!1}}),d}var Ko=Bo(),K=new Set(["\x1B","\x9B"]),Mo=39,se="\x07",Qe="[",qo="]",Xe="m",te=`${qo}8;;`,Ge=(o)=>`${K.values().next().value}${Qe}${o}${Xe}`,Be=(o)=>`${K.values().next().value}${te}${o}${se}`,Vo=(o)=>o.split(" ").map((s)=>W(s)),ee=(o,s,t)=>{let i=[...s],n=!1,r=!1,e=W(ze(o[o.length-1]));for(let[l,m]of i.entries()){let c=W(m);if(e+c<=t?o[o.length-1]+=m:(o.push(m),e=0),K.has(m)&&(n=!0,r=i.slice(l+1).join("").startsWith(te)),n){r?m===se&&(n=!1,r=!1):m===Xe&&(n=!1);continue}e+=c,e===t&&l<i.length-1&&(o.push(""),e=0)}!e&&o[o.length-1].length>0&&o.length>1&&(o[o.length-2]+=o.pop())},zo=(o)=>{let s=o.split(" "),t=s.length;for(;t>0&&!(W(s[t-1])>0);)t--;return t===s.length?o:s.slice(0,t).join(" ")+s.slice(t).join("")},Yo=(o,s,t={})=>{if(t.trim!==!1&&o.trim()==="")return"";let i="",n,r,e=Vo(o),l=[""];for(let[c,h]of o.split(" ").entries()){t.trim!==!1&&(l[l.length-1]=l[l.length-1].trimStart());let p=W(l[l.length-1]);if(c!==0&&(p>=s&&(t.wordWrap===!1||t.trim===!1)&&(l.push(""),p=0),(p>0||t.trim===!1)&&(l[l.length-1]+=" ",p++)),t.hard&&e[c]>s){let k=s-p,C=1+Math.floor((e[c]-k-1)/s);Math.floor((e[c]-1)/s)<C&&l.push(""),ee(l,h,s);continue}if(p+e[c]>s&&p>0&&e[c]>0){if(t.wordWrap===!1&&p<s){ee(l,h,s);continue}l.push("")}if(p+e[c]>s&&t.wordWrap===!1){ee(l,h,s);continue}l[l.length-1]+=h}t.trim!==!1&&(l=l.map((c)=>zo(c)));let m=[...l.join(`
4
+ `)];for(let[c,h]of m.entries()){if(i+=h,K.has(h)){let{groups:k}=new RegExp(`(?:\\${Qe}(?<code>\\d+)m|\\${te}(?<uri>.*)${se})`).exec(m.slice(c).join(""))||{groups:{}};if(k.code!==void 0){let C=Number.parseFloat(k.code);n=C===Mo?void 0:C}else k.uri!==void 0&&(r=k.uri.length===0?void 0:k.uri)}let p=Ko.codes.get(Number(n));m[c+1]===`
5
+ `?(r&&(i+=Be("")),n&&p&&(i+=Ge(p))):h===`
6
+ `&&(n&&p&&(i+=Ge(n)),r&&(i+=Be(r)))}return i};function Ke(o,s,t){return String(o).normalize().replace(/\r\n/g,`
7
+ `).split(`
8
+ `).map((i)=>Yo(i,s,t)).join(`
9
+ `)}var Jo=["up","down","left","right","space","enter","cancel"],B={actions:new Set(Jo),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function ne(o,s){if(typeof o=="string")return B.aliases.get(o)===s;for(let t of o)if(t!==void 0&&ne(t,s))return!0;return!1}function Qo(o,s){if(o===s)return;let t=o.split(`
10
+ `),i=s.split(`
11
+ `),n=[];for(let r=0;r<Math.max(t.length,i.length);r++)t[r]!==i[r]&&n.push(r);return n}var Xo=globalThis.process.platform.startsWith("win"),oe=Symbol("clack:cancel");function ie(o){return o===oe}function G(o,s){let t=o;t.isTTY&&t.setRawMode(s)}function Ze({input:o=qe,output:s=Ve,overwrite:t=!0,hideCursor:i=!0}={}){let n=R.createInterface({input:o,output:s,prompt:"",tabSize:1});R.emitKeypressEvents(o,n),o.isTTY&&o.setRawMode(!0);let r=(e,{name:l,sequence:m})=>{let c=String(e);if(ne([c,l,m],"cancel")){i&&s.write(u.cursor.show),process.exit(0);return}if(!t)return;R.moveCursor(s,l==="return"?0:-1,l==="return"?-1:0,()=>{R.clearLine(s,1,()=>{o.once("keypress",r)})})};return i&&s.write(u.cursor.hide),o.once("keypress",r),()=>{o.off("keypress",r),i&&s.write(u.cursor.show),o.isTTY&&!Xo&&o.setRawMode(!1),n.terminal=!1,n.close()}}var Zo=Object.defineProperty,Fo=(o,s,t)=>(s in o)?Zo(o,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[s]=t,v=(o,s,t)=>(Fo(o,typeof s!="symbol"?s+"":s,t),t);class re{constructor(o,s=!0){v(this,"input"),v(this,"output"),v(this,"_abortSignal"),v(this,"rl"),v(this,"opts"),v(this,"_render"),v(this,"_track",!1),v(this,"_prevFrame",""),v(this,"_subscribers",new Map),v(this,"_cursor",0),v(this,"state","initial"),v(this,"error",""),v(this,"value");let{input:t=qe,output:i=Ve,render:n,signal:r,...e}=o;this.opts=e,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=s,this._abortSignal=r,this.input=t,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(o,s){let t=this._subscribers.get(o)??[];t.push(s),this._subscribers.set(o,t)}on(o,s){this.setSubscriber(o,{cb:s})}once(o,s){this.setSubscriber(o,{cb:s,once:!0})}emit(o,...s){let t=this._subscribers.get(o)??[],i=[];for(let n of t)n.cb(...s),n.once&&i.push(()=>t.splice(t.indexOf(n),1));for(let n of i)n()}prompt(){return new Promise((o,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),o(oe);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let t=new To;t._write=(i,n,r)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),r()},this.input.pipe(t),this.rl=We.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),We.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),G(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(u.cursor.show),this.output.off("resize",this.render),G(this.input,!1),o(this.value)}),this.once("cancel",()=>{this.output.write(u.cursor.show),this.output.off("resize",this.render),G(this.input,!1),o(oe)})})}onKeypress(o,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&B.aliases.has(s.name)&&this.emit("cursor",B.aliases.get(s.name)),B.actions.has(s.name)&&this.emit("cursor",s.name)),o&&(o.toLowerCase()==="y"||o.toLowerCase()==="n")&&this.emit("confirm",o.toLowerCase()==="y"),o==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),o&&this.emit("key",o.toLowerCase()),s?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),this.opts.validate){let t=this.opts.validate(this.value);t&&(this.error=t instanceof Error?t.message:t,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}ne([o,s?.name,s?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
12
+ `),G(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let o=Ke(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
13
+ `).length-1;this.output.write(u.cursor.move(-999,o*-1))}render(){let o=Ke(this._render(this)??"",process.stdout.columns,{hard:!0});if(o!==this._prevFrame){if(this.state==="initial")this.output.write(u.cursor.hide);else{let s=Qo(this._prevFrame,o);if(this.restoreCursor(),s&&s?.length===1){let t=s[0];this.output.write(u.cursor.move(0,t)),this.output.write(u.erase.lines(1));let i=o.split(`
14
+ `);this.output.write(i[t]),this._prevFrame=o,this.output.write(u.cursor.move(0,i.length-t-1));return}if(s&&s?.length>1){let t=s[0];this.output.write(u.cursor.move(0,t)),this.output.write(u.erase.down());let i=o.split(`
15
+ `).slice(t);this.output.write(i.join(`
16
+ `)),this._prevFrame=o;return}this.output.write(u.erase.down())}this.output.write(o),this.state==="initial"&&(this.state="active"),this._prevFrame=o}}}class ae extends re{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(o){super(o,!1),this.value=!!o.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(s)=>{this.output.write(u.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Do;Do=new WeakMap;var es=Object.defineProperty,os=(o,s,t)=>(s in o)?es(o,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[s]=t,Me=(o,s,t)=>(os(o,typeof s!="symbol"?s+"":s,t),t),Fe=class extends re{constructor(o){super(o,!1),Me(this,"options"),Me(this,"cursor",0),this.options=o.options,this.value=[...o.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:s})=>s===o.cursorAt),0),this.on("key",(s)=>{s==="a"&&this.toggleAll()}),this.on("cursor",(s)=>{switch(s){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let o=this.value.length===this.options.length;this.value=o?[]:this.options.map((s)=>s.value)}toggleValue(){let o=this.value.includes(this._value);this.value=o?this.value.filter((s)=>s!==this._value):[...this.value,this._value]}};var a=P(F(),1),M=P(X(),1);import E from"process";function ss(){return E.platform!=="win32"?E.env.TERM!=="linux":!!E.env.CI||!!E.env.WT_SESSION||!!E.env.TERMINUS_SUBLIME||E.env.ConEmuTask==="{cmd::Cmder}"||E.env.TERM_PROGRAM==="Terminus-Sublime"||E.env.TERM_PROGRAM==="vscode"||E.env.TERM==="xterm-256color"||E.env.TERM==="alacritty"||E.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ce=ss(),g=(o,s)=>ce?o:s,ts=g("\u25C6","*"),no=g("\u25A0","x"),io=g("\u25B2","x"),q=g("\u25C7","o"),ns=g("\u250C","T"),f=g("\u2502","|"),U=g("\u2514","\u2014"),De=g("\u25CF",">"),eo=g("\u25CB"," "),is=g("\u25FB","[\u2022]"),oo=g("\u25FC","[+]"),rs=g("\u25FB","[ ]"),Bs=g("\u25AA","\u2022"),so=g("\u2500","-"),as=g("\u256E","+"),ls=g("\u251C","+"),cs=g("\u256F","+"),ps=g("\u25CF","\u2022"),ms=g("\u25C6","*"),ds=g("\u25B2","!"),hs=g("\u25A0","x"),ro=(o)=>{switch(o){case"initial":case"active":return a.default.cyan(ts);case"cancel":return a.default.red(no);case"error":return a.default.yellow(io);case"submit":return a.default.green(q)}},to=(o)=>{let{cursor:s,options:t,style:i}=o,n=o.maxItems??Number.POSITIVE_INFINITY,r=Math.max(process.stdout.rows-4,0),e=Math.min(r,Math.max(n,5)),l=0;s>=l+e-3?l=Math.max(Math.min(s-e+3,t.length-e),0):s<l+2&&(l=Math.max(s-2,0));let m=e<t.length&&l>0,c=e<t.length&&l+e<t.length;return t.slice(l,l+e).map((h,p,k)=>{let C=p===0&&m,z=p===k.length-1&&c;return C||z?a.default.dim("..."):i(h,p+l===s)})};var pe=(o)=>{let s=o.active??"Yes",t=o.inactive??"No";return new ae({active:s,inactive:t,initialValue:o.initialValue??!0,render(){let i=`${a.default.gray(f)}
17
+ ${ro(this.state)} ${o.message}
18
+ `,n=this.value?s:t;switch(this.state){case"submit":return`${i}${a.default.gray(f)} ${a.default.dim(n)}`;case"cancel":return`${i}${a.default.gray(f)} ${a.default.strikethrough(a.default.dim(n))}
19
+ ${a.default.gray(f)}`;default:return`${i}${a.default.cyan(f)} ${this.value?`${a.default.green(De)} ${s}`:`${a.default.dim(eo)} ${a.default.dim(s)}`} ${a.default.dim("/")} ${this.value?`${a.default.dim(eo)} ${a.default.dim(t)}`:`${a.default.green(De)} ${t}`}
20
+ ${a.default.cyan(U)}
21
+ `}}}).prompt()};var ao=(o)=>{let s=(t,i)=>{let n=t.label??String(t.value);return i==="active"?`${a.default.cyan(is)} ${n} ${t.hint?a.default.dim(`(${t.hint})`):""}`:i==="selected"?`${a.default.green(oo)} ${a.default.dim(n)} ${t.hint?a.default.dim(`(${t.hint})`):""}`:i==="cancelled"?`${a.default.strikethrough(a.default.dim(n))}`:i==="active-selected"?`${a.default.green(oo)} ${n} ${t.hint?a.default.dim(`(${t.hint})`):""}`:i==="submitted"?`${a.default.dim(n)}`:`${a.default.dim(rs)} ${a.default.dim(n)}`};return new Fe({options:o.options,initialValues:o.initialValues,required:o.required??!0,cursorAt:o.cursorAt,validate(t){if(this.required&&t.length===0)return`Please select at least one option.
22
+ ${a.default.reset(a.default.dim(`Press ${a.default.gray(a.default.bgWhite(a.default.inverse(" space ")))} to select, ${a.default.gray(a.default.bgWhite(a.default.inverse(" enter ")))} to submit`))}`},render(){let t=`${a.default.gray(f)}
23
+ ${ro(this.state)} ${o.message}
24
+ `,i=(n,r)=>{let e=this.value.includes(n.value);return r&&e?s(n,"active-selected"):e?s(n,"selected"):s(n,r?"active":"inactive")};switch(this.state){case"submit":return`${t}${a.default.gray(f)} ${this.options.filter(({value:n})=>this.value.includes(n)).map((n)=>s(n,"submitted")).join(a.default.dim(", "))||a.default.dim("none")}`;case"cancel":{let n=this.options.filter(({value:r})=>this.value.includes(r)).map((r)=>s(r,"cancelled")).join(a.default.dim(", "));return`${t}${a.default.gray(f)} ${n.trim()?`${n}
25
+ ${a.default.gray(f)}`:""}`}case"error":{let n=this.error.split(`
26
+ `).map((r,e)=>e===0?`${a.default.yellow(U)} ${a.default.yellow(r)}`:` ${r}`).join(`
27
+ `);return`${t+a.default.yellow(f)} ${to({options:this.options,cursor:this.cursor,maxItems:o.maxItems,style:i}).join(`
28
+ ${a.default.yellow(f)} `)}
29
+ ${n}
30
+ `}default:return`${t}${a.default.cyan(f)} ${to({options:this.options,cursor:this.cursor,maxItems:o.maxItems,style:i}).join(`
31
+ ${a.default.cyan(f)} `)}
32
+ ${a.default.cyan(U)}
33
+ `}}}).prompt()};var me=(o="",s="")=>{let t=`
34
+ ${o}
35
+ `.split(`
36
+ `),i=le(s).length,n=Math.max(t.reduce((e,l)=>{let m=le(l);return m.length>e?m.length:e},0),i)+2,r=t.map((e)=>`${a.default.gray(f)} ${a.default.dim(e)}${" ".repeat(n-le(e).length)}${a.default.gray(f)}`).join(`
37
+ `);process.stdout.write(`${a.default.gray(f)}
38
+ ${a.default.green(q)} ${a.default.reset(s)} ${a.default.gray(so.repeat(Math.max(n-i-1,1))+as)}
39
+ ${r}
40
+ ${a.default.gray(ls+so.repeat(n+2)+cs)}
41
+ `)},de=(o="")=>{process.stdout.write(`${a.default.gray(U)} ${a.default.red(o)}
42
+
43
+ `)},lo=(o="")=>{process.stdout.write(`${a.default.gray(ns)} ${o}
44
+ `)},co=(o="")=>{process.stdout.write(`${a.default.gray(f)}
45
+ ${a.default.gray(U)} ${o}
46
+
47
+ `)},y={message:(o="",{symbol:s=a.default.gray(f)}={})=>{let t=[`${a.default.gray(f)}`];if(o){let[i,...n]=o.split(`
48
+ `);t.push(`${s} ${i}`,...n.map((r)=>`${a.default.gray(f)} ${r}`))}process.stdout.write(`${t.join(`
49
+ `)}
50
+ `)},info:(o)=>{y.message(o,{symbol:a.default.blue(ps)})},success:(o)=>{y.message(o,{symbol:a.default.green(ms)})},step:(o)=>{y.message(o,{symbol:a.default.green(q)})},warn:(o)=>{y.message(o,{symbol:a.default.yellow(ds)})},warning:(o)=>{y.warn(o)},error:(o)=>{y.message(o,{symbol:a.default.red(hs)})}},Ks=`${a.default.gray(f)} `;var po=({indicator:o="dots"}={})=>{let s=ce?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=ce?80:120,i=process.env.CI==="true",n,r,e=!1,l="",m,c=performance.now(),h=(w)=>{let S=w>1?"Something went wrong":"Canceled";e&&Ne(S,w)},p=()=>h(2),k=()=>h(1),C=()=>{process.on("uncaughtExceptionMonitor",p),process.on("unhandledRejection",p),process.on("SIGINT",k),process.on("SIGTERM",k),process.on("exit",h)},z=()=>{process.removeListener("uncaughtExceptionMonitor",p),process.removeListener("unhandledRejection",p),process.removeListener("SIGINT",k),process.removeListener("SIGTERM",k),process.removeListener("exit",h)},Ae=()=>{if(m===void 0)return;i&&process.stdout.write(`
51
+ `);let w=m.split(`
52
+ `);process.stdout.write(M.cursor.move(-999,w.length-1)),process.stdout.write(M.erase.down(w.length))},Y=(w)=>w.replace(/\.+$/,""),_e=(w)=>{let S=(performance.now()-w)/1000,I=Math.floor(S/60),L=Math.floor(S%60);return I>0?`[${I}m ${L}s]`:`[${L}s]`},ko=(w="")=>{e=!0,n=Ze(),l=Y(w),c=performance.now(),process.stdout.write(`${a.default.gray(f)}
53
+ `);let S=0,I=0;C(),r=setInterval(()=>{if(i&&l===m)return;Ae(),m=l;let L=a.default.magenta(s[S]);if(i)process.stdout.write(`${L} ${l}...`);else if(o==="timer")process.stdout.write(`${L} ${l} ${_e(c)}`);else{let vo=".".repeat(Math.floor(I)).slice(0,3);process.stdout.write(`${L} ${l}${vo}`)}S=S+1<s.length?S+1:0,I=I<s.length?I+0.125:0},t)},Ne=(w="",S=0)=>{e=!1,clearInterval(r),Ae();let I=S===0?a.default.green(q):S===1?a.default.red(no):a.default.red(io);l=Y(w??l),o==="timer"?process.stdout.write(`${I} ${l} ${_e(c)}
54
+ `):process.stdout.write(`${I} ${l}
55
+ `),z(),n()};return{start:ko,stop:Ne,message:(w="")=>{l=Y(w??l)}}},mo=async(o,s)=>{let t={},i=Object.keys(o);for(let n of i){let r=o[n],e=await r({results:t})?.catch((l)=>{throw l});if(typeof s?.onCancel=="function"&&ie(e)){t[n]="canceled",s.onCancel({results:t});continue}t[n]=e}return t};var x=P(F(),1);import*as b from"fs";import*as O from"path";var he=`name: OpenCode Auth Refresh
56
+
57
+ on:
58
+ schedule:
59
+ - cron: '0 3 * * *'
60
+ workflow_dispatch:
61
+
62
+ jobs:
63
+ refresh:
64
+ runs-on: ubuntu-latest
65
+ steps:
66
+ - id: cache
67
+ uses: actions/cache@v4
68
+ with:
69
+ path: ~/.local/share/opencode/auth.json
70
+ key: opencode-auth
71
+
72
+ - if: steps.cache.outputs.cache-hit != 'true'
73
+ name: Restore auth from secret
74
+ run: |
75
+ mkdir -p ~/.local/share/opencode
76
+ echo '\${{ secrets.OPENCODE_AUTH }}' > ~/.local/share/opencode/auth.json
77
+
78
+ - name: Install OpenCode
79
+ run: curl -fsSL https://opencode.ai/install | bash
80
+
81
+ - name: Refresh OAuth token
82
+ run: opencode models
83
+ `;var A=`
84
+ - name: Restore OpenCode auth
85
+ uses: actions/cache/restore@v4
86
+ with:
87
+ path: ~/.local/share/opencode/auth.json
88
+ key: opencode-auth
89
+ `,_="\n GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}",N="\n GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}";var fe=(o)=>`name: PR Review
90
+
91
+ on:
92
+ pull_request:
93
+ types: [opened, synchronize, reopened]
94
+
95
+ jobs:
96
+ review:
97
+ runs-on: ubuntu-latest
98
+ permissions:
99
+ contents: read
100
+ pull-requests: write
101
+ steps:
102
+ - uses: actions/checkout@v4
103
+ ${o?A:""}
104
+ - name: Setup Bun
105
+ uses: oven-sh/setup-bun@v2
106
+
107
+ - name: Review PR
108
+ run: bunx opencode-ai run --model anthropic/claude-sonnet-4-5 "Load the pr-review skill and review PR \${{ github.event.pull_request.number }}"
109
+ env:${o?N:_}
110
+ `;var ge=(o)=>`name: Issue Label
111
+
112
+ on:
113
+ issues:
114
+ types: [opened, edited]
115
+
116
+ jobs:
117
+ label:
118
+ runs-on: ubuntu-latest
119
+ permissions:
120
+ issues: write
121
+ steps:
122
+ - uses: actions/checkout@v4
123
+ ${o?A:""}
124
+ - name: Setup Bun
125
+ uses: oven-sh/setup-bun@v2
126
+
127
+ - name: Label Issue
128
+ run: bunx opencode-ai run --model anthropic/claude-haiku-4-5 "Load the issue-label skill and label issue \${{ github.event.issue.number }}"
129
+ env:${o?N:_}
130
+ `;var be=(o)=>`name: Doc Sync
131
+
132
+ on:
133
+ pull_request:
134
+ types: [opened, synchronize]
135
+
136
+ jobs:
137
+ sync:
138
+ runs-on: ubuntu-latest
139
+ permissions:
140
+ contents: write
141
+ steps:
142
+ - uses: actions/checkout@v4
143
+ with:
144
+ ref: \${{ github.head_ref }}
145
+ ${o?A:""}
146
+ - name: Configure Git
147
+ run: |
148
+ git config user.name "github-actions[bot]"
149
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
150
+
151
+ - name: Setup Bun
152
+ uses: oven-sh/setup-bun@v2
153
+
154
+ - name: Sync Documentation
155
+ run: bunx opencode-ai run --model anthropic/claude-haiku-4-5 "Load the doc-sync skill and sync documentation for PR \${{ github.event.pull_request.number }}"
156
+ env:${o?N:_}
157
+ `;var ue=(o)=>`name: Release
158
+
159
+ on:
160
+ workflow_dispatch:
161
+
162
+ jobs:
163
+ release:
164
+ runs-on: ubuntu-latest
165
+ permissions:
166
+ contents: write
167
+ id-token: write
168
+ steps:
169
+ - uses: actions/checkout@v4
170
+ with:
171
+ fetch-depth: 0
172
+ ${o?A:""}
173
+ - name: Configure Git
174
+ run: |
175
+ git config user.name "github-actions[bot]"
176
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
177
+
178
+ - name: Setup Bun
179
+ uses: oven-sh/setup-bun@v2
180
+
181
+ - name: Create Release
182
+ run: bunx opencode-ai run --model anthropic/claude-haiku-4-5 "Load the release-notes skill and create a new release"
183
+ env:${o?N:_}
184
+ `;var ho={review:"pr-review",label:"issue-label","doc-sync":"doc-sync",release:"release"};var we=`---
185
+ name: pr-review
186
+ description: AI-powered pull request code review focusing on correctness, security, stability, and maintainability. Posts structured findings via submit_review tool.
187
+ license: MIT
188
+ metadata:
189
+ trigger: pull_request
190
+ tools: submit_review
191
+ ---
192
+
193
+ ## What I Do
194
+
195
+ Review pull request changes systematically and post findings as a sticky PR comment using the \`submit_review\` tool.
196
+
197
+ ## Workflow
198
+
199
+ 1. **Gather context**: Use GitHub CLI to get PR metadata
200
+ \`\`\`bash
201
+ gh pr view <number> --json files,title,body,headRefOid
202
+ \`\`\`
203
+
204
+ 2. **Create todo list**: One item per changed file using \`todowrite\`
205
+
206
+ 3. **Analyze each file**:
207
+ - Mark todo as \`in_progress\`
208
+ - Read the file diff and surrounding context
209
+ - Note issues (correctness, security, stability, maintainability)
210
+ - Mark todo as \`completed\`
211
+
212
+ 4. **Synthesize review**: After ALL files are analyzed, determine verdict and summary
213
+
214
+ 5. **Submit**: Call \`submit_review\` exactly once with all findings
215
+
216
+ ## Review Priorities
217
+
218
+ Focus on these areas in order of importance:
219
+
220
+ 1. **Correctness** - Logic errors, broken control flow, off-by-one errors, incorrect conditions
221
+ 2. **Security** - Injection vulnerabilities, auth issues, secrets in code, unsafe deserialization
222
+ 3. **Stability** - Error handling, race conditions, resource leaks, null/undefined cases
223
+ 4. **Maintainability** - Clarity, naming, violations of local conventions
224
+
225
+ Only flag style issues when they hide bugs or cause real confusion.
226
+
227
+ ## Using submit_review
228
+
229
+ Call exactly once with these arguments:
230
+
231
+ | Argument | Type | Description |
232
+ |----------|------|-------------|
233
+ | \`repository\` | string | owner/repo format (from git remote) |
234
+ | \`pullNumber\` | number | PR number from task message |
235
+ | \`commitSha\` | string | headRefOid from PR metadata |
236
+ | \`summary\` | string | 1-3 sentence overall assessment |
237
+ | \`verdict\` | string | \`approve\` or \`request_changes\` |
238
+ | \`issues\` | array | List of findings |
239
+
240
+ Each issue in the array needs:
241
+
242
+ | Field | Type | Description |
243
+ |-------|------|-------------|
244
+ | \`file\` | string | File path from the diff |
245
+ | \`line\` | number | Line number on the NEW (right) side |
246
+ | \`severity\` | string | \`critical\`, \`high\`, \`medium\`, or \`low\` |
247
+ | \`title\` | string | Short description (~80 chars) |
248
+ | \`explanation\` | string | Why this matters, what's wrong |
249
+ | \`suggestion\` | string? | Optional: replacement code only, no prose |
250
+
251
+ ## Verdict Rules
252
+
253
+ - Use \`request_changes\` if there are ANY medium, high, or critical issues
254
+ - Use \`approve\` if there are only low-severity issues or no issues at all
255
+ - The verdict must be consistent with the worst severity in the issues array
256
+
257
+ ## Common Mistakes to Avoid
258
+
259
+ - Do NOT call \`submit_review\` more than once
260
+ - Do NOT use line numbers from the left (old) side of the diff
261
+ - Do NOT skip the per-file todo workflow
262
+ - Do NOT guess repository, PR number, or commit SHA - derive from git/gh commands
263
+ - Do NOT include JSON fragments in summary or explanation fields
264
+ - Do NOT put prose like "change to:" in the suggestion field
265
+
266
+ ## Example Issue
267
+
268
+ \`\`\`json
269
+ {
270
+ "file": "src/auth/login.ts",
271
+ "line": 42,
272
+ "severity": "high",
273
+ "title": "SQL injection vulnerability in user lookup",
274
+ "explanation": "User input is concatenated directly into the SQL query without sanitization. An attacker could inject malicious SQL to bypass authentication or extract data.",
275
+ "suggestion": "const user = await db.query('SELECT * FROM users WHERE email = $1', [email])"
276
+ }
277
+ \`\`\`
278
+ `;var ye=`---
279
+ name: issue-label
280
+ description: Automatically apply appropriate labels to GitHub issues based on content analysis. Uses existing labels when possible, creates new ones sparingly.
281
+ license: MIT
282
+ metadata:
283
+ trigger: issues
284
+ tools: apply_labels
285
+ ---
286
+
287
+ ## What I Do
288
+
289
+ Analyze GitHub issue content and apply up to 3 appropriate labels to help maintainers triage and search issues effectively.
290
+
291
+ ## Workflow
292
+
293
+ 1. **Fetch issue details**: Get title, body, and existing labels
294
+ \`\`\`bash
295
+ gh issue view <number> --json title,body,labels
296
+ \`\`\`
297
+
298
+ 2. **Fetch repository labels**: List available labels
299
+ \`\`\`bash
300
+ gh label list --json name,description,color
301
+ \`\`\`
302
+
303
+ 3. **Analyze the issue**:
304
+ - Determine the main type: bug, feature, documentation, question, etc.
305
+ - Look for hints about complexity (good-first-issue candidate?)
306
+ - Match to existing labels
307
+
308
+ 4. **Select labels**: Choose up to 3 existing labels that best describe the issue
309
+
310
+ 5. **Create new labels**: Only if no existing labels fit (rare)
311
+
312
+ 6. **Apply**: Call \`apply_labels\` exactly once
313
+
314
+ ## Labeling Guidelines
315
+
316
+ ### Use Existing Labels
317
+ Prefer existing labels over creating new ones. Check the repository's label taxonomy first.
318
+
319
+ ### Common Categories
320
+ - \`bug\` - Something isn't working
321
+ - \`feature\` or \`feature-request\` - New functionality
322
+ - \`enhancement\` - Improvement to existing feature
323
+ - \`documentation\` - Docs need updates
324
+ - \`question\` - Needs clarification
325
+ - \`good-first-issue\` - Good for newcomers
326
+
327
+ ### Label Naming Conventions (for new labels)
328
+ - Lowercase letters only
329
+ - Words separated by hyphens
330
+ - 1-3 words, under 30 characters
331
+ - Example: \`needs-reproduction\`, \`breaking-change\`
332
+
333
+ ## Using apply_labels
334
+
335
+ Call exactly once with these arguments:
336
+
337
+ | Argument | Type | Description |
338
+ |----------|------|-------------|
339
+ | \`repository\` | string | owner/repo format |
340
+ | \`issueNumber\` | number | Issue number from task message |
341
+ | \`labels\` | string[] | Array of existing label names (max 3) |
342
+ | \`newLabels\` | array? | Optional: new labels to create first |
343
+ | \`explanation\` | string | Brief reason for label choices |
344
+
345
+ ### New Label Format
346
+
347
+ If creating new labels (use sparingly):
348
+
349
+ \`\`\`json
350
+ {
351
+ "name": "needs-reproduction",
352
+ "color": "d93f0b",
353
+ "description": "Issue needs steps to reproduce"
354
+ }
355
+ \`\`\`
356
+
357
+ Color is a hex string WITHOUT the leading \`#\`.
358
+
359
+ ## Decision Process
360
+
361
+ 1. **Read the issue carefully** - title and full body
362
+ 2. **Identify the primary type** - bug? feature? question?
363
+ 3. **Check for secondary aspects** - affects docs? good for beginners?
364
+ 4. **Match to existing labels** - prefer exact matches
365
+ 5. **If no match exists** - consider if a new label is truly needed
366
+ 6. **Write explanation** - brief justification for choices
367
+
368
+ ## Common Mistakes to Avoid
369
+
370
+ - Do NOT apply more than 3 labels total
371
+ - Do NOT create many highly specific labels unlikely to be reused
372
+ - Do NOT apply labels that contradict the issue content
373
+ - Do NOT overuse broad labels like \`question\` when specific ones exist
374
+ - Do NOT create duplicate labels with slight name variations
375
+ - Do NOT omit the explanation field
376
+
377
+ ## Example Explanation
378
+
379
+ Good: "Labeled as \`bug\` and \`documentation\` based on steps to reproduce and mention of incorrect docs"
380
+
381
+ Bad: "Applied some labels"
382
+ `;var xe=`---
383
+ name: doc-sync
384
+ description: Keep documentation in sync with code changes. Analyzes PR diffs and updates relevant docs using native write and bash tools.
385
+ license: MIT
386
+ metadata:
387
+ trigger: pull_request
388
+ tools: write, bash, read, glob
389
+ ---
390
+
391
+ ## What I Do
392
+
393
+ Analyze pull request changes and update documentation to reflect code changes. Uses native OpenCode tools (\`write\`, \`bash\`) instead of custom commit tools.
394
+
395
+ ## Workflow
396
+
397
+ 1. **Gather PR context**:
398
+ \`\`\`bash
399
+ gh pr view <number> --json files,title,body,headRefOid
400
+ \`\`\`
401
+
402
+ 2. **Create todo list**: One item per changed file using \`todowrite\`
403
+
404
+ 3. **Analyze each file**:
405
+ - Mark todo as \`in_progress\`
406
+ - Identify user-visible changes (APIs, config, behavior)
407
+ - Note which documentation might need updates
408
+ - Mark todo as \`completed\`
409
+
410
+ 4. **After ALL files analyzed**:
411
+ - Identify affected documentation files
412
+ - Read current content of each doc file
413
+ - Plan minimal, precise updates
414
+
415
+ 5. **Update documentation**: Use \`write\` tool for each file needing changes
416
+
417
+ 6. **Commit and push**: Use \`bash\` tool for git operations
418
+
419
+ ## Documentation Scope
420
+
421
+ Check these locations first:
422
+ - \`README.md\` at repository root
423
+ - Files under \`docs/\` directory
424
+ - API documentation if present
425
+ - Configuration examples
426
+ - Other markdown files at root
427
+
428
+ ## What to Update
429
+
430
+ | Code Change | Documentation Update |
431
+ |-------------|---------------------|
432
+ | New feature | Add documentation |
433
+ | Changed behavior | Update existing docs |
434
+ | Removed feature | Remove or mark deprecated |
435
+ | New config option | Document option and defaults |
436
+ | Changed API | Update examples and usage |
437
+
438
+ ## Committing Changes
439
+
440
+ After updating documentation files with \`write\`, commit using \`bash\`:
441
+
442
+ \`\`\`bash
443
+ git add README.md docs/
444
+ git commit -m "[skip ci] docs: <description of changes>"
445
+ git push
446
+ \`\`\`
447
+
448
+ **Important**: The \`[skip ci]\` prefix prevents infinite workflow loops.
449
+
450
+ ## Style Guidelines
451
+
452
+ - Keep documentation concise and accurate
453
+ - Match existing tone and formatting
454
+ - Prefer targeted edits over large rewrites
455
+ - Ensure code examples are syntactically correct
456
+ - Don't invent features not present in the code
457
+
458
+ ## No Changes Needed
459
+
460
+ If the existing documentation is already accurate:
461
+ - Do NOT create an empty commit
462
+ - Do NOT call any git commands
463
+ - Simply report that no documentation updates were required
464
+ - Explain briefly why the docs are already correct
465
+
466
+ ## Common Mistakes to Avoid
467
+
468
+ - Do NOT update docs unrelated to the PR
469
+ - Do NOT start editing before completing all file analyses
470
+ - Do NOT generate marketing-style or overly verbose content
471
+ - Do NOT change code examples unless the underlying code changed
472
+ - Do NOT duplicate information across multiple files
473
+ - Do NOT commit with an empty file list
474
+
475
+ ## Example Workflow
476
+
477
+ 1. PR changes \`src/config/options.ts\` to add new \`timeout\` option
478
+ 2. Analyze: user-visible config change
479
+ 3. Check \`README.md\` and \`docs/configuration.md\`
480
+ 4. Update \`docs/configuration.md\` with new option description
481
+ 5. Commit: \`[skip ci] docs: add timeout configuration option\`
482
+ `;var ke=`---
483
+ name: release-notes
484
+ description: Analyze commits since last release, determine semantic version bump, publish to npm, and create GitHub release with notes.
485
+ license: MIT
486
+ metadata:
487
+ trigger: workflow_dispatch
488
+ tools: bun_release, github_release
489
+ ---
490
+
491
+ ## What I Do
492
+
493
+ Automate the release process: analyze commits, determine version, publish to npm, and create a GitHub release with generated notes.
494
+
495
+ ## Workflow
496
+
497
+ Use \`todowrite\` to create and track these steps:
498
+
499
+ 1. **Get current version** from \`package.json\`
500
+ 2. **Find previous release tag** using git
501
+ 3. **List commits since last tag**
502
+ 4. **Fetch merged pull requests** in that range
503
+ 5. **Determine version bump type** (major/minor/patch)
504
+ 6. **Generate release notes**
505
+ 7. **Call \`bun_release\`** to publish to npm
506
+ 8. **Call \`github_release\`** to create GitHub release
507
+
508
+ ## Gathering Context
509
+
510
+ \`\`\`bash
511
+ # Get current version
512
+ cat package.json | jq -r '.version'
513
+
514
+ # Find previous tag
515
+ git describe --tags --abbrev=0
516
+
517
+ # List commits since tag
518
+ git log <prev-tag>..HEAD --oneline
519
+
520
+ # Get merged PRs
521
+ gh pr list --state merged --base main --json number,title,author
522
+ \`\`\`
523
+
524
+ ## Version Determination
525
+
526
+ Use semantic versioning based on commit analysis:
527
+
528
+ ### MAJOR bump (x.0.0)
529
+ - Commits containing "BREAKING CHANGE" in body
530
+ - Commits starting with \`feat!:\` or \`fix!:\` (with \`!\`)
531
+ - API removals or incompatible interface changes
532
+
533
+ ### MINOR bump (x.y.0)
534
+ - Commits starting with \`feat:\` or \`feat(\`
535
+ - New functionality that doesn't break existing behavior
536
+
537
+ ### PATCH bump (x.y.z)
538
+ - Commits starting with \`fix:\`, \`perf:\`, \`refactor:\`, \`docs:\`, \`chore:\`
539
+ - Any other commits not matching above patterns
540
+
541
+ ### Rules
542
+ - If ANY commit requires MAJOR \u2192 bump major, reset minor and patch to 0
543
+ - Else if ANY commit requires MINOR \u2192 bump minor, reset patch to 0
544
+ - Else \u2192 bump patch only
545
+
546
+ ## Release Notes Format
547
+
548
+ Include only user-facing changes. Each note should follow:
549
+
550
+ \`\`\`
551
+ <description> [#<issue>] [#<pr>] @<author>
552
+ \`\`\`
553
+
554
+ **Include:**
555
+ - New features
556
+ - Bug fixes
557
+ - Performance improvements
558
+ - Important config/doc updates
559
+
560
+ **Exclude:**
561
+ - Pure dependency bumps
562
+ - Version bump commits
563
+ - Formatting-only changes
564
+ - Reverts that undo previous changes
565
+ - Merge commits
566
+
567
+ ### Example Notes
568
+ - Add retry logic to GitHub API calls #42 @alice
569
+ - Fix label creation for special characters #38 @bob
570
+ - Improve error messages for auth failures @carol
571
+
572
+ ## Using bun_release (Call FIRST)
573
+
574
+ Publishes to npm. Call before \`github_release\`.
575
+
576
+ | Argument | Type | Description |
577
+ |----------|------|-------------|
578
+ | \`version\` | string | New version (e.g., "1.2.3" or "v1.2.3") |
579
+
580
+ What it does:
581
+ 1. Runs \`bun pm version\` to update package.json
582
+ 2. Pushes commit and tag to remote
583
+ 3. Runs \`bun publish --access public\`
584
+
585
+ ## Using github_release (Call SECOND)
586
+
587
+ Creates GitHub release. Call only after \`bun_release\` succeeds.
588
+
589
+ | Argument | Type | Description |
590
+ |----------|------|-------------|
591
+ | \`repository\` | string | owner/repo format |
592
+ | \`tag\` | string | Version with "v" prefix (e.g., "v1.2.3") |
593
+ | \`notes\` | string[] | Array of release notes (without "- " prefix) |
594
+ | \`title\` | string? | Optional: release title (defaults to tag) |
595
+ | \`prerelease\` | boolean? | Set true for -alpha, -beta, -rc versions |
596
+ | \`draft\` | boolean? | Set true to create as draft |
597
+
598
+ ## Special Cases
599
+
600
+ ### No Commits Since Last Tag
601
+ - Report to user that no release is needed
602
+ - Do NOT call either tool
603
+
604
+ ### No Previous Tag (First Release)
605
+ - Analyze all commits in repository
606
+ - Use version from package.json or default to 0.1.0
607
+
608
+ ### bun_release Fails
609
+ - Do NOT call github_release
610
+ - Report the error to user
611
+ - The publish must succeed before creating GitHub release
612
+
613
+ ## Common Mistakes to Avoid
614
+
615
+ - Do NOT call \`github_release\` before \`bun_release\` succeeds
616
+ - Do NOT guess repository name - derive from git/gh commands
617
+ - Do NOT forget the "v" prefix on the tag for \`github_release\`
618
+ - Do NOT include version bump commits in release notes
619
+ - Do NOT include merge commits in release notes
620
+ - Do NOT forget author handles (@username) in release notes
621
+ - Do NOT skip the todo list workflow
622
+ - Do NOT create a release when there are no new commits
623
+ `;var ve={"pr-review":{name:"pr-review",content:we},"issue-label":{name:"issue-label",content:ye},"doc-sync":{name:"doc-sync",content:xe},"release-notes":{name:"release-notes",content:ke}},fo=Object.keys(ve);var gs={"pr-review":fe,"issue-label":ge,"doc-sync":be,release:ue};function go(o){let{workflows:s,cwd:t=process.cwd(),useOAuth:i=!1}=o,n=[],r=O.join(t,".github","workflows");if(!b.existsSync(r))b.mkdirSync(r,{recursive:!0});for(let e of s){let l=ho[e],m=gs[l],c=O.join(r,`${l}.yml`);if(!m){n.push({type:"workflow",name:e,status:"error",path:c,message:`Unknown workflow: ${e}`});continue}let h=m(i);if(!h){n.push({type:"workflow",name:e,status:"error",path:c,message:`Unknown workflow: ${e}`});continue}if(b.existsSync(c)){n.push({type:"workflow",name:e,status:"skipped",path:`.github/workflows/${l}.yml`,message:"Skipped: already exists"});continue}try{b.writeFileSync(c,h,"utf-8"),n.push({type:"workflow",name:e,status:"created",path:`.github/workflows/${l}.yml`,message:"Created successfully"})}catch(p){n.push({type:"workflow",name:e,status:"error",path:c,message:`Failed to write file: ${p instanceof Error?p.message:"Unknown error"}`})}}return n}function bo(o){let{cwd:s=process.cwd()}=o,t=O.join(s,".github","workflows"),i=O.join(t,"opencode-auth.yml");if(!b.existsSync(t))b.mkdirSync(t,{recursive:!0});if(b.existsSync(i))return{type:"auth",name:"opencode-auth",status:"skipped",path:".github/workflows/opencode-auth.yml",message:"Skipped: already exists"};try{return b.writeFileSync(i,he,"utf-8"),{type:"auth",name:"opencode-auth",status:"created",path:".github/workflows/opencode-auth.yml",message:"Created successfully"}}catch(n){return{type:"auth",name:"opencode-auth",status:"error",path:i,message:`Failed to write file: ${n instanceof Error?n.message:"Unknown error"}`}}}function uo(o){let{cwd:s=process.cwd()}=o,t=[],i=O.join(s,".opencode","skill");for(let n of fo){let r=ve[n],e=O.join(i,n,"SKILL.md");if(b.existsSync(e)){t.push({type:"skill",name:n,status:"skipped",path:`.opencode/skill/${n}/SKILL.md`,message:"Skipped: already exists"});continue}try{b.mkdirSync(O.dirname(e),{recursive:!0}),b.writeFileSync(e,r.content,"utf-8"),t.push({type:"skill",name:n,status:"created",path:`.opencode/skill/${n}/SKILL.md`,message:"Created successfully"})}catch(l){t.push({type:"skill",name:n,status:"error",path:e,message:`Failed to write: ${l instanceof Error?l.message:"Unknown error"}`})}}return t}function wo(o=process.cwd()){let s=O.join(o,".opencode"),t=O.join(s,"opencode.json"),i="@activade/open-workflows",n={$schema:"https://opencode.ai/config.json",model:"anthropic/claude-sonnet-4-5",small_model:"anthropic/claude-haiku-4-5",plugin:["@activade/open-workflows"],permission:{skill:{"pr-review":"allow","issue-label":"allow","doc-sync":"allow","release-notes":"allow"}}};if(b.existsSync(t))try{let r=JSON.parse(b.readFileSync(t,"utf-8"));if(typeof r==="object"&&r!==null){if(!Array.isArray(r.plugin))r.plugin=[];if(!r.plugin.includes("@activade/open-workflows"))r.plugin.push("@activade/open-workflows");if(!r.model)r.model=n.model;if(!r.small_model)r.small_model=n.small_model;if(!r.permission?.skill)r.permission={...r.permission,skill:n.permission.skill};return b.writeFileSync(t,JSON.stringify(r,null,2),"utf-8"),{created:!1,path:".opencode/opencode.json"}}}catch{}if(!b.existsSync(s))b.mkdirSync(s,{recursive:!0});return b.writeFileSync(t,JSON.stringify(n,null,2),"utf-8"),{created:!0,path:".opencode/opencode.json"}}var us=await Promise.resolve().then(() => P(yo(),1)).catch(()=>({version:"unknown"})),Ce=us.version,$=process.argv.slice(2),ws=$.includes("--help")||$.includes("-h"),ys=$.includes("--version")||$.includes("-v"),xs=$.includes("--skills"),ks=$.includes("--workflows");if(ys)console.log(`@activade/open-workflows v${Ce}`),process.exit(0);if(ws)console.log(`@activade/open-workflows v${Ce}
624
+
625
+ AI-powered GitHub automation workflows as an OpenCode plugin.
626
+
627
+ USAGE
628
+ $ open-workflows [OPTIONS]
629
+
630
+ OPTIONS
631
+ --skills Install skills only (no workflows)
632
+ --workflows Install workflows only (no skills)
633
+ --version, -v Display version
634
+ --help, -h Display this help
635
+
636
+ WHAT GETS INSTALLED
637
+ Skills: .opencode/skill/{pr-review,issue-label,doc-sync,release-notes}/SKILL.md
638
+ Workflows: .github/workflows/{pr-review,issue-label,doc-sync,release}.yml
639
+ Config: .opencode/opencode.json
640
+
641
+ For more information: https://github.com/activadee/open-workflows
642
+ `),process.exit(0);lo(x.default.bgCyan(x.default.black(` @activade/open-workflows v${Ce} `)));var xo=await mo({workflows:()=>ao({message:"Select workflows to install:",options:[{value:"review",label:"PR Review",hint:"AI-powered code reviews"},{value:"label",label:"Issue Label",hint:"Auto-label issues"},{value:"doc-sync",label:"Doc Sync",hint:"Keep docs in sync"},{value:"release",label:"Release",hint:"Automated releases with notes"}],required:!0}),hasClaudeMax:()=>pe({message:"Do you have a Claude Max subscription?",initialValue:!1}),useOAuth:({results:o})=>o.hasClaudeMax?pe({message:"Set up OAuth token caching for GitHub Actions?",initialValue:!0}):Promise.resolve(!1)},{onCancel:()=>{de("Installation cancelled."),process.exit(0)}}),Re=po();Re.start("Installing open-workflows...");var T=[],vs=xo.workflows||[],Ie=Boolean(xo.useOAuth);if(!ks){let o=uo({});T.push(...o)}if(!xs){let o=go({workflows:vs,useOAuth:Ie});if(T.push(...o),Ie){let s=bo({});T.push(s)}}var V;try{V=wo()}catch(o){Re.stop("Installation failed."),de(`Failed to create config: ${o instanceof Error?o.message:"Unknown error"}`),process.exit(1)}var Ss=T.some((o)=>o.status==="error");Re.stop(Ss?"Installation completed with errors":"Installation complete!");var Se=T.filter((o)=>o.status==="created"),Ee=T.filter((o)=>o.status==="skipped"),Oe=T.filter((o)=>o.status==="error");if(Se.length>0){y.success(`Created ${Se.length} file(s):`);for(let o of Se)y.message(` ${x.default.green("\u2713")} ${o.path}`)}if(Ee.length>0){y.warn(`Skipped ${Ee.length} file(s) (already exist):`);for(let o of Ee)y.message(` ${x.default.yellow("\u25CB")} ${o.path}`)}if(Oe.length>0){y.error(`Failed ${Oe.length} file(s):`);for(let o of Oe)y.message(` ${x.default.red("\u2717")} ${o.path}: ${o.message}`)}if(V.created)y.success(`Created ${V.path}`);else y.info(`Updated ${V.path}`);if(Ie)me(`${x.default.cyan("1.")} Export your OpenCode auth file as a secret:
643
+ ${x.default.dim("gh secret set OPENCODE_AUTH < ~/.local/share/opencode/auth.json")}
644
+
645
+ ${x.default.cyan("2.")} Commit and push the changes
646
+
647
+ ${x.default.cyan("3.")} Run the auth workflow to initialize the cache:
648
+ ${x.default.dim("gh workflow run opencode-auth.yml")}`,"Next steps (OAuth)");else me(`${x.default.cyan("1.")} Add your Anthropic API key:
649
+ ${x.default.dim("gh secret set ANTHROPIC_API_KEY")}
650
+
651
+ ${x.default.cyan("2.")} Commit and push the changes`,"Next steps");co(x.default.green("\u2713 open-workflows installed successfully!"));