octocode-cli 1.3.0 → 1.3.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.
@@ -5,7 +5,7 @@ import { dirname as __dirname_fn } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __dirname_fn(__filename);
8
- import{a as y,g as sn,k as Qs,l as Zs}from"./chunk-LH4AZJPA.js";import{a as r,b as g,c}from"./chunk-V64AXUWB.js";import{a as Js,b as on,d as nn}from"./chunk-YBBF4DTY.js";var ur=on((sm,Mt)=>{"use strict";var ao=function(){};ao.prototype=Object.create(null);var ro=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,io=/\\([\v\u0020-\u00ff])/gu,ar=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,je={type:"",parameters:new ao};Object.freeze(je.parameters);Object.freeze(je);function lr(e){if(typeof e!="string")throw new TypeError("argument header is required and must be a string");let t=e.indexOf(";"),o=t!==-1?e.slice(0,t).trim():e.trim();if(ar.test(o)===!1)throw new TypeError("invalid media type");let n={type:o.toLowerCase(),parameters:new ao};if(t===-1)return n;let s,i,a;for(ro.lastIndex=t;i=ro.exec(e);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,s=i[1].toLowerCase(),a=i[2],a[0]==='"'&&(a=a.slice(1,a.length-1),io.test(a)&&(a=a.replace(io,"$1"))),n.parameters[s]=a}if(t!==e.length)throw new TypeError("invalid parameter format");return n}function cr(e){if(typeof e!="string")return je;let t=e.indexOf(";"),o=t!==-1?e.slice(0,t).trim():e.trim();if(ar.test(o)===!1)return je;let n={type:o.toLowerCase(),parameters:new ao};if(t===-1)return n;let s,i,a;for(ro.lastIndex=t;i=ro.exec(e);){if(i.index!==t)return je;t+=i[0].length,s=i[1].toLowerCase(),a=i[2],a[0]==='"'&&(a=a.slice(1,a.length-1),io.test(a)&&(a=a.replace(io,"$1"))),n.parameters[s]=a}return t!==e.length?je:n}Mt.exports.default={parse:lr,safeParse:cr};Mt.exports.parse=lr;Mt.exports.safeParse=cr;Mt.exports.defaultContentType=je});var ai=on((ph,ii)=>{"use strict";ii.exports=vu;function ku(e){let t={defaultWidth:0,output:process.stdout,tty:Js("tty")};return e?(Object.keys(t).forEach(function(o){e[o]||(e[o]=t[o])}),e):t}function vu(e){let t=ku(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let o=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(o)&&o!==0)return o}return t.defaultWidth}});var $i=on((xh,Pi)=>{var _u=Js("stream"),Dn=class extends _u{#o=null;constructor(t={}){super(t),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}#t(t,o){return this._dest?this._dest[t]:this._src?this._src[t]:o}#e(t,...o){typeof this._dest?.[t]=="function"&&this._dest[t](...o),typeof this._src?.[t]=="function"&&this._src[t](...o)}get isTTY(){return this.#o!==null?this.#o:this.#t("isTTY",!1)}set isTTY(t){this.#o=t}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(t){this._src=t}pipe(t,o){return this._dest=t,super.pipe(t,o)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.slice(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.slice(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)}end(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")}destroy(...t){return this.#e("destroy",...t)}destroySoon(...t){return this.#e("destroySoon",...t)}close(...t){return this.#e("close",...t)}};Pi.exports=Dn});import Qm from"node:fs";import ef from"node:path";import{spawnSync as Jc}from"node:child_process";import{existsSync as co,readFileSync as Mr,writeFileSync as Ar,unlinkSync as $r,statSync as yc,chmodSync as Cc}from"node:fs";import{createCipheriv as bc,createDecipheriv as kc,randomBytes as Tr}from"node:crypto";import{existsSync as vc,mkdirSync as wc}from"node:fs";import{join as Ee}from"node:path";import po from"node:os";import Sc from"node:path";function ct(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}var Nl="0.0.0-development",Fl=`octokit-endpoint.js/${Nl} ${ct()}`,Bl={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Fl},mediaType:{format:""}};function jl(e){return e?Object.keys(e).reduce((t,o)=>(t[o.toLowerCase()]=e[o],t),{}):{}}function Ul(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Function.prototype.call(o)===Function.prototype.call(e)}function or(e,t){let o=Object.assign({},e);return Object.keys(t).forEach(n=>{Ul(t[n])?n in e?o[n]=or(e[n],t[n]):Object.assign(o,{[n]:t[n]}):Object.assign(o,{[n]:t[n]})}),o}function er(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function an(e,t,o){if(typeof t=="string"){let[s,i]=t.split(" ");o=Object.assign(i?{method:s,url:i}:{url:s},o)}else o=Object.assign({},t);o.headers=jl(o.headers),er(o),er(o.headers);let n=or(e||{},o);return o.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(n.mediaType.previews=e.mediaType.previews.filter(s=>!n.mediaType.previews.includes(s)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(s=>s.replace(/-preview/,""))),n}function Gl(e,t){let o=/\?/.test(e)?"&":"?",n=Object.keys(t);return n.length===0?e:e+o+n.map(s=>s==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${s}=${encodeURIComponent(t[s])}`).join("&")}var Hl=/\{[^{}}]+\}/g;function Vl(e){return e.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function Wl(e){let t=e.match(Hl);return t?t.map(Vl).reduce((o,n)=>o.concat(n),[]):[]}function tr(e,t){let o={__proto__:null};for(let n of Object.keys(e))t.indexOf(n)===-1&&(o[n]=e[n]);return o}function nr(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function dt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function It(e,t,o){return t=e==="+"||e==="#"?nr(t):dt(t),o?dt(o)+"="+t:t}function ut(e){return e!=null}function rn(e){return e===";"||e==="&"||e==="?"}function ql(e,t,o,n){var s=e[o],i=[];if(ut(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||typeof s=="boolean")s=s.toString(),n&&n!=="*"&&(s=s.substring(0,parseInt(n,10))),i.push(It(t,s,rn(t)?o:""));else if(n==="*")Array.isArray(s)?s.filter(ut).forEach(function(a){i.push(It(t,a,rn(t)?o:""))}):Object.keys(s).forEach(function(a){ut(s[a])&&i.push(It(t,s[a],a))});else{let a=[];Array.isArray(s)?s.filter(ut).forEach(function(l){a.push(It(t,l))}):Object.keys(s).forEach(function(l){ut(s[l])&&(a.push(dt(l)),a.push(It(t,s[l].toString())))}),rn(t)?i.push(dt(o)+"="+a.join(",")):a.length!==0&&i.push(a.join(","))}else t===";"?ut(s)&&i.push(dt(o)):s===""&&(t==="&"||t==="?")?i.push(dt(o)+"="):s===""&&i.push("");return i}function Kl(e){return{expand:zl.bind(null,e)}}function zl(e,t){var o=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,s,i){if(s){let l="",u=[];if(o.indexOf(s.charAt(0))!==-1&&(l=s.charAt(0),s=s.substr(1)),s.split(/,/g).forEach(function(p){var d=/([^:\*]*)(?::(\d+)|(\*))?/.exec(p);u.push(ql(t,l,d[1],d[2]||d[3]))}),l&&l!=="+"){var a=",";return l==="?"?a="&":l!=="#"&&(a=l),(u.length!==0?l:"")+u.join(a)}else return u.join(",")}else return nr(i)}),e==="/"?e:e.replace(/\/$/,"")}function sr(e){let t=e.method.toUpperCase(),o=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},e.headers),s,i=tr(e,["method","baseUrl","url","headers","request","mediaType"]),a=Wl(o);o=Kl(o).expand(i),/^http/.test(o)||(o=e.baseUrl+o);let l=Object.keys(e).filter(d=>a.includes(d)).concat("baseUrl"),u=tr(i,l);if(!/application\/octet-stream/i.test(n.accept)&&(e.mediaType.format&&(n.accept=n.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),o.endsWith("/graphql")&&e.mediaType.previews?.length)){let d=n.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];n.accept=d.concat(e.mediaType.previews).map(m=>{let f=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${m}-preview${f}`}).join(",")}return["GET","HEAD"].includes(t)?o=Gl(o,u):"data"in u?s=u.data:Object.keys(u).length&&(s=u),!n["content-type"]&&typeof s<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof s>"u"&&(s=""),Object.assign({method:t,url:o,headers:n},typeof s<"u"?{body:s}:null,e.request?{request:e.request}:null)}function Xl(e,t,o){return sr(an(e,t,o))}function rr(e,t){let o=an(e,t),n=Xl.bind(null,o);return Object.assign(n,{DEFAULTS:o,defaults:rr.bind(null,o),merge:an.bind(null,o),parse:sr})}var ir=rr(null,Bl);var br=nn(ur(),1);var Yl=/^-?\d+$/,gr=/^-?\d+n+$/,ln=JSON.stringify,dr=JSON.parse,Jl=/^-?\d+n$/,Ql=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,Zl=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,mr=(e,t,o)=>"rawJSON"in JSON?ln(e,(a,l)=>typeof l=="bigint"?JSON.rawJSON(l.toString()):typeof t=="function"?t(a,l):(Array.isArray(t)&&t.includes(a),l),o):e?ln(e,(a,l)=>typeof l=="string"&&gr.test(l)||typeof l=="bigint"?l.toString()+"n":typeof t=="function"?t(a,l):(Array.isArray(t)&&t.includes(a),l),o).replace(Ql,"$1$2$3").replace(Zl,"$1$2$3"):ln(e,t,o),lo=new Map,ec=()=>{let e=JSON.parse.toString();if(lo.has(e))return lo.get(e);try{let t=JSON.parse("1",(o,n,s)=>!!s?.source&&s.source==="1");return lo.set(e,t),t}catch{return lo.set(e,!1),!1}},tc=(e,t,o,n)=>typeof t=="string"&&Jl.test(t)?BigInt(t.slice(0,-1)):typeof t=="string"&&gr.test(t)?t.slice(0,-1):typeof n!="function"?t:n(e,t,o),oc=(e,t)=>JSON.parse(e,(o,n,s)=>{let i=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER),a=s&&Yl.test(s.source);return i&&a?BigInt(s.source):typeof t!="function"?n:t(o,n,s)}),fr=Number.MAX_SAFE_INTEGER.toString(),pr=fr.length,nc=/"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g,sc=/^"-?\d+n+"$/,hr=(e,t)=>{if(!e)return dr(e,t);if(ec())return oc(e,t);let o=e.replace(nc,(n,s,i,a)=>{let l=n[0]==='"';if(l&&sc.test(n))return n.substring(0,n.length-1)+'n"';let p=i||a,d=s&&(s.length<pr||s.length===pr&&s<=fr);return l||p||d?n:'"'+n+'n"'});return dr(o,(n,s,i)=>tc(n,s,i,t))};var $e=class extends Error{name;status;request;response;constructor(t,o,n){super(t,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(o),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let s=Object.assign({},n.request);n.request.headers.authorization&&(s.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),s.url=s.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=s}};var rc="10.0.8",ic={headers:{"user-agent":`octokit-request.js/${rc} ${ct()}`}};function ac(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Function.prototype.call(o)===Function.prototype.call(e)}var yr=()=>"";async function Cr(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let o=e.request?.log||console,n=e.request?.parseSuccessResponseBody!==!1,s=ac(e.body)||Array.isArray(e.body)?mr(e.body):e.body,i=Object.fromEntries(Object.entries(e.headers).map(([m,f])=>[m,String(f)])),a;try{a=await t(e.url,{method:e.method,body:s,redirect:e.request?.redirect,headers:i,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(m){let f="Unknown Error";if(m instanceof Error){if(m.name==="AbortError")throw m.status=500,m;f=m.message,m.name==="TypeError"&&"cause"in m&&(m.cause instanceof Error?f=m.cause.message:typeof m.cause=="string"&&(f=m.cause))}let C=new $e(f,500,{request:e});throw C.cause=m,C}let l=a.status,u=a.url,p={};for(let[m,f]of a.headers)p[m]=f;let d={url:u,status:l,headers:p,data:""};if("deprecation"in p){let m=p.link&&p.link.match(/<([^<>]+)>; rel="deprecation"/),f=m&&m.pop();o.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${p.sunset}${f?`. See ${f}`:""}`)}if(l===204||l===205)return d;if(e.method==="HEAD"){if(l<400)return d;throw new $e(a.statusText,l,{response:d,request:e})}if(l===304)throw d.data=await cn(a),new $e("Not modified",l,{response:d,request:e});if(l>=400)throw d.data=await cn(a),new $e(cc(d.data),l,{response:d,request:e});return d.data=n?await cn(a):a.body,d}async function cn(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(yr);let o=(0,br.safeParse)(t);if(lc(o)){let n="";try{return n=await e.text(),hr(n)}catch{return n}}else return o.type.startsWith("text/")||o.parameters.charset?.toLowerCase()==="utf-8"?e.text().catch(yr):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function lc(e){return e.type==="application/json"||e.type==="application/scim+json"}function cc(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if("message"in e){let t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(o=>JSON.stringify(o)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function un(e,t){let o=e.defaults(t);return Object.assign(function(s,i){let a=o.merge(s,i);if(!a.request||!a.request.hook)return Cr(o.parse(a));let l=(u,p)=>Cr(o.parse(o.merge(u,p)));return Object.assign(l,{endpoint:o,defaults:un.bind(null,o)}),a.request.hook(l,a)},{endpoint:o,defaults:un.bind(null,o)})}var J=un(ir,ic);function uc(e){let t=e.endpoint.DEFAULTS;return/^https:\/\/(api\.)?github\.com$/.test(t.baseUrl)?"https://github.com":t.baseUrl.replace("/api/v3","")}async function dn(e,t,o){let n={baseUrl:uc(e),headers:{accept:"application/json"},...o},s=await e(t,n);if("error"in s.data){let i=new $e(`${s.data.error_description} (${s.data.error}, ${s.data.error_uri})`,400,{request:e.endpoint.merge(t,n)});throw i.response=s,i}return s}async function wr(e){let t=e.request||J,o={client_id:e.clientId};return"scopes"in e&&Array.isArray(e.scopes)&&(o.scope=e.scopes.join(" ")),dn(t,"POST /login/device/code",o)}async function pn(e){let t=e.request||J,o=await dn(t,"POST /login/oauth/access_token",{client_id:e.clientId,device_code:e.code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),n={clientType:e.clientType,clientId:e.clientId,token:o.data.access_token,scopes:o.data.scope.split(/\s+/).filter(Boolean)};if("clientSecret"in e&&(n.clientSecret=e.clientSecret),e.clientType==="github-app"){if("refresh_token"in o.data){let s=new Date(o.headers.date).getTime();n.refreshToken=o.data.refresh_token,n.expiresAt=kr(s,o.data.expires_in),n.refreshTokenExpiresAt=kr(s,o.data.refresh_token_expires_in)}delete n.scopes}return{...o,authentication:n}}function kr(e,t){return new Date(e+t*1e3).toISOString()}async function Sr(e){let t=e.request||J,o=await dn(t,"POST /login/oauth/access_token",{client_id:e.clientId,client_secret:e.clientSecret,grant_type:"refresh_token",refresh_token:e.refreshToken}),n=new Date(o.headers.date).getTime(),s={clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,token:o.data.access_token,refreshToken:o.data.refresh_token,expiresAt:vr(n,o.data.expires_in),refreshTokenExpiresAt:vr(n,o.data.refresh_token_expires_in)};return{...o,authentication:s}}function vr(e,t){return new Date(e+t*1e3).toISOString()}async function Pr(e){let t=e.request||J,o=btoa(`${e.clientId}:${e.clientSecret}`);return t("DELETE /applications/{client_id}/token",{headers:{authorization:`basic ${o}`},client_id:e.clientId,access_token:e.token})}import{randomUUID as Am}from"node:crypto";import{existsSync as Om,readFileSync as Lm,writeFileSync as Dm,unlinkSync as Rm,renameSync as _m}from"node:fs";import{existsSync as Gm,readFileSync as Hm}from"node:fs";import{existsSync as Kc,readdirSync as zc,lstatSync as Xc}from"node:fs";import{join as Yc}from"node:path";var dc=null;function pc(e){let t=`[${e.module}]`,o=e.data&&Object.keys(e.data).length>0?` ${JSON.stringify(e.data)}`:"";process.stderr.write(`${t} ${e.level}: ${e.message}${o}
8
+ import{a as y,g as sn,k as Qs,l as Zs}from"./chunk-QCY7Q7YW.js";import{a as r,b as g,c}from"./chunk-V64AXUWB.js";import{a as Js,b as on,d as nn}from"./chunk-YBBF4DTY.js";var ur=on((sm,Mt)=>{"use strict";var ao=function(){};ao.prototype=Object.create(null);var ro=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,io=/\\([\v\u0020-\u00ff])/gu,ar=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,je={type:"",parameters:new ao};Object.freeze(je.parameters);Object.freeze(je);function lr(e){if(typeof e!="string")throw new TypeError("argument header is required and must be a string");let t=e.indexOf(";"),o=t!==-1?e.slice(0,t).trim():e.trim();if(ar.test(o)===!1)throw new TypeError("invalid media type");let n={type:o.toLowerCase(),parameters:new ao};if(t===-1)return n;let s,i,a;for(ro.lastIndex=t;i=ro.exec(e);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,s=i[1].toLowerCase(),a=i[2],a[0]==='"'&&(a=a.slice(1,a.length-1),io.test(a)&&(a=a.replace(io,"$1"))),n.parameters[s]=a}if(t!==e.length)throw new TypeError("invalid parameter format");return n}function cr(e){if(typeof e!="string")return je;let t=e.indexOf(";"),o=t!==-1?e.slice(0,t).trim():e.trim();if(ar.test(o)===!1)return je;let n={type:o.toLowerCase(),parameters:new ao};if(t===-1)return n;let s,i,a;for(ro.lastIndex=t;i=ro.exec(e);){if(i.index!==t)return je;t+=i[0].length,s=i[1].toLowerCase(),a=i[2],a[0]==='"'&&(a=a.slice(1,a.length-1),io.test(a)&&(a=a.replace(io,"$1"))),n.parameters[s]=a}return t!==e.length?je:n}Mt.exports.default={parse:lr,safeParse:cr};Mt.exports.parse=lr;Mt.exports.safeParse=cr;Mt.exports.defaultContentType=je});var ai=on((ph,ii)=>{"use strict";ii.exports=vu;function ku(e){let t={defaultWidth:0,output:process.stdout,tty:Js("tty")};return e?(Object.keys(t).forEach(function(o){e[o]||(e[o]=t[o])}),e):t}function vu(e){let t=ku(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let o=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(o)&&o!==0)return o}return t.defaultWidth}});var $i=on((xh,Pi)=>{var _u=Js("stream"),Dn=class extends _u{#o=null;constructor(t={}){super(t),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}#t(t,o){return this._dest?this._dest[t]:this._src?this._src[t]:o}#e(t,...o){typeof this._dest?.[t]=="function"&&this._dest[t](...o),typeof this._src?.[t]=="function"&&this._src[t](...o)}get isTTY(){return this.#o!==null?this.#o:this.#t("isTTY",!1)}set isTTY(t){this.#o=t}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(t){this._src=t}pipe(t,o){return this._dest=t,super.pipe(t,o)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.slice(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.slice(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)}end(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")}destroy(...t){return this.#e("destroy",...t)}destroySoon(...t){return this.#e("destroySoon",...t)}close(...t){return this.#e("close",...t)}};Pi.exports=Dn});import Qm from"node:fs";import ef from"node:path";import{spawnSync as Jc}from"node:child_process";import{existsSync as co,readFileSync as Mr,writeFileSync as Ar,unlinkSync as $r,statSync as yc,chmodSync as Cc}from"node:fs";import{createCipheriv as bc,createDecipheriv as kc,randomBytes as Tr}from"node:crypto";import{existsSync as vc,mkdirSync as wc}from"node:fs";import{join as Ee}from"node:path";import po from"node:os";import Sc from"node:path";function ct(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}var Nl="0.0.0-development",Fl=`octokit-endpoint.js/${Nl} ${ct()}`,Bl={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Fl},mediaType:{format:""}};function jl(e){return e?Object.keys(e).reduce((t,o)=>(t[o.toLowerCase()]=e[o],t),{}):{}}function Ul(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Function.prototype.call(o)===Function.prototype.call(e)}function or(e,t){let o=Object.assign({},e);return Object.keys(t).forEach(n=>{Ul(t[n])?n in e?o[n]=or(e[n],t[n]):Object.assign(o,{[n]:t[n]}):Object.assign(o,{[n]:t[n]})}),o}function er(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function an(e,t,o){if(typeof t=="string"){let[s,i]=t.split(" ");o=Object.assign(i?{method:s,url:i}:{url:s},o)}else o=Object.assign({},t);o.headers=jl(o.headers),er(o),er(o.headers);let n=or(e||{},o);return o.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(n.mediaType.previews=e.mediaType.previews.filter(s=>!n.mediaType.previews.includes(s)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(s=>s.replace(/-preview/,""))),n}function Gl(e,t){let o=/\?/.test(e)?"&":"?",n=Object.keys(t);return n.length===0?e:e+o+n.map(s=>s==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${s}=${encodeURIComponent(t[s])}`).join("&")}var Hl=/\{[^{}}]+\}/g;function Vl(e){return e.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function Wl(e){let t=e.match(Hl);return t?t.map(Vl).reduce((o,n)=>o.concat(n),[]):[]}function tr(e,t){let o={__proto__:null};for(let n of Object.keys(e))t.indexOf(n)===-1&&(o[n]=e[n]);return o}function nr(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function dt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function It(e,t,o){return t=e==="+"||e==="#"?nr(t):dt(t),o?dt(o)+"="+t:t}function ut(e){return e!=null}function rn(e){return e===";"||e==="&"||e==="?"}function ql(e,t,o,n){var s=e[o],i=[];if(ut(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||typeof s=="boolean")s=s.toString(),n&&n!=="*"&&(s=s.substring(0,parseInt(n,10))),i.push(It(t,s,rn(t)?o:""));else if(n==="*")Array.isArray(s)?s.filter(ut).forEach(function(a){i.push(It(t,a,rn(t)?o:""))}):Object.keys(s).forEach(function(a){ut(s[a])&&i.push(It(t,s[a],a))});else{let a=[];Array.isArray(s)?s.filter(ut).forEach(function(l){a.push(It(t,l))}):Object.keys(s).forEach(function(l){ut(s[l])&&(a.push(dt(l)),a.push(It(t,s[l].toString())))}),rn(t)?i.push(dt(o)+"="+a.join(",")):a.length!==0&&i.push(a.join(","))}else t===";"?ut(s)&&i.push(dt(o)):s===""&&(t==="&"||t==="?")?i.push(dt(o)+"="):s===""&&i.push("");return i}function Kl(e){return{expand:zl.bind(null,e)}}function zl(e,t){var o=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,s,i){if(s){let l="",u=[];if(o.indexOf(s.charAt(0))!==-1&&(l=s.charAt(0),s=s.substr(1)),s.split(/,/g).forEach(function(p){var d=/([^:\*]*)(?::(\d+)|(\*))?/.exec(p);u.push(ql(t,l,d[1],d[2]||d[3]))}),l&&l!=="+"){var a=",";return l==="?"?a="&":l!=="#"&&(a=l),(u.length!==0?l:"")+u.join(a)}else return u.join(",")}else return nr(i)}),e==="/"?e:e.replace(/\/$/,"")}function sr(e){let t=e.method.toUpperCase(),o=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},e.headers),s,i=tr(e,["method","baseUrl","url","headers","request","mediaType"]),a=Wl(o);o=Kl(o).expand(i),/^http/.test(o)||(o=e.baseUrl+o);let l=Object.keys(e).filter(d=>a.includes(d)).concat("baseUrl"),u=tr(i,l);if(!/application\/octet-stream/i.test(n.accept)&&(e.mediaType.format&&(n.accept=n.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),o.endsWith("/graphql")&&e.mediaType.previews?.length)){let d=n.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];n.accept=d.concat(e.mediaType.previews).map(m=>{let f=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${m}-preview${f}`}).join(",")}return["GET","HEAD"].includes(t)?o=Gl(o,u):"data"in u?s=u.data:Object.keys(u).length&&(s=u),!n["content-type"]&&typeof s<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof s>"u"&&(s=""),Object.assign({method:t,url:o,headers:n},typeof s<"u"?{body:s}:null,e.request?{request:e.request}:null)}function Xl(e,t,o){return sr(an(e,t,o))}function rr(e,t){let o=an(e,t),n=Xl.bind(null,o);return Object.assign(n,{DEFAULTS:o,defaults:rr.bind(null,o),merge:an.bind(null,o),parse:sr})}var ir=rr(null,Bl);var br=nn(ur(),1);var Yl=/^-?\d+$/,gr=/^-?\d+n+$/,ln=JSON.stringify,dr=JSON.parse,Jl=/^-?\d+n$/,Ql=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,Zl=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,mr=(e,t,o)=>"rawJSON"in JSON?ln(e,(a,l)=>typeof l=="bigint"?JSON.rawJSON(l.toString()):typeof t=="function"?t(a,l):(Array.isArray(t)&&t.includes(a),l),o):e?ln(e,(a,l)=>typeof l=="string"&&gr.test(l)||typeof l=="bigint"?l.toString()+"n":typeof t=="function"?t(a,l):(Array.isArray(t)&&t.includes(a),l),o).replace(Ql,"$1$2$3").replace(Zl,"$1$2$3"):ln(e,t,o),lo=new Map,ec=()=>{let e=JSON.parse.toString();if(lo.has(e))return lo.get(e);try{let t=JSON.parse("1",(o,n,s)=>!!s?.source&&s.source==="1");return lo.set(e,t),t}catch{return lo.set(e,!1),!1}},tc=(e,t,o,n)=>typeof t=="string"&&Jl.test(t)?BigInt(t.slice(0,-1)):typeof t=="string"&&gr.test(t)?t.slice(0,-1):typeof n!="function"?t:n(e,t,o),oc=(e,t)=>JSON.parse(e,(o,n,s)=>{let i=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER),a=s&&Yl.test(s.source);return i&&a?BigInt(s.source):typeof t!="function"?n:t(o,n,s)}),fr=Number.MAX_SAFE_INTEGER.toString(),pr=fr.length,nc=/"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g,sc=/^"-?\d+n+"$/,hr=(e,t)=>{if(!e)return dr(e,t);if(ec())return oc(e,t);let o=e.replace(nc,(n,s,i,a)=>{let l=n[0]==='"';if(l&&sc.test(n))return n.substring(0,n.length-1)+'n"';let p=i||a,d=s&&(s.length<pr||s.length===pr&&s<=fr);return l||p||d?n:'"'+n+'n"'});return dr(o,(n,s,i)=>tc(n,s,i,t))};var $e=class extends Error{name;status;request;response;constructor(t,o,n){super(t,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(o),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let s=Object.assign({},n.request);n.request.headers.authorization&&(s.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),s.url=s.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=s}};var rc="10.0.8",ic={headers:{"user-agent":`octokit-request.js/${rc} ${ct()}`}};function ac(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Function.prototype.call(o)===Function.prototype.call(e)}var yr=()=>"";async function Cr(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let o=e.request?.log||console,n=e.request?.parseSuccessResponseBody!==!1,s=ac(e.body)||Array.isArray(e.body)?mr(e.body):e.body,i=Object.fromEntries(Object.entries(e.headers).map(([m,f])=>[m,String(f)])),a;try{a=await t(e.url,{method:e.method,body:s,redirect:e.request?.redirect,headers:i,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(m){let f="Unknown Error";if(m instanceof Error){if(m.name==="AbortError")throw m.status=500,m;f=m.message,m.name==="TypeError"&&"cause"in m&&(m.cause instanceof Error?f=m.cause.message:typeof m.cause=="string"&&(f=m.cause))}let C=new $e(f,500,{request:e});throw C.cause=m,C}let l=a.status,u=a.url,p={};for(let[m,f]of a.headers)p[m]=f;let d={url:u,status:l,headers:p,data:""};if("deprecation"in p){let m=p.link&&p.link.match(/<([^<>]+)>; rel="deprecation"/),f=m&&m.pop();o.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${p.sunset}${f?`. See ${f}`:""}`)}if(l===204||l===205)return d;if(e.method==="HEAD"){if(l<400)return d;throw new $e(a.statusText,l,{response:d,request:e})}if(l===304)throw d.data=await cn(a),new $e("Not modified",l,{response:d,request:e});if(l>=400)throw d.data=await cn(a),new $e(cc(d.data),l,{response:d,request:e});return d.data=n?await cn(a):a.body,d}async function cn(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(yr);let o=(0,br.safeParse)(t);if(lc(o)){let n="";try{return n=await e.text(),hr(n)}catch{return n}}else return o.type.startsWith("text/")||o.parameters.charset?.toLowerCase()==="utf-8"?e.text().catch(yr):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function lc(e){return e.type==="application/json"||e.type==="application/scim+json"}function cc(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if("message"in e){let t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(o=>JSON.stringify(o)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function un(e,t){let o=e.defaults(t);return Object.assign(function(s,i){let a=o.merge(s,i);if(!a.request||!a.request.hook)return Cr(o.parse(a));let l=(u,p)=>Cr(o.parse(o.merge(u,p)));return Object.assign(l,{endpoint:o,defaults:un.bind(null,o)}),a.request.hook(l,a)},{endpoint:o,defaults:un.bind(null,o)})}var J=un(ir,ic);function uc(e){let t=e.endpoint.DEFAULTS;return/^https:\/\/(api\.)?github\.com$/.test(t.baseUrl)?"https://github.com":t.baseUrl.replace("/api/v3","")}async function dn(e,t,o){let n={baseUrl:uc(e),headers:{accept:"application/json"},...o},s=await e(t,n);if("error"in s.data){let i=new $e(`${s.data.error_description} (${s.data.error}, ${s.data.error_uri})`,400,{request:e.endpoint.merge(t,n)});throw i.response=s,i}return s}async function wr(e){let t=e.request||J,o={client_id:e.clientId};return"scopes"in e&&Array.isArray(e.scopes)&&(o.scope=e.scopes.join(" ")),dn(t,"POST /login/device/code",o)}async function pn(e){let t=e.request||J,o=await dn(t,"POST /login/oauth/access_token",{client_id:e.clientId,device_code:e.code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),n={clientType:e.clientType,clientId:e.clientId,token:o.data.access_token,scopes:o.data.scope.split(/\s+/).filter(Boolean)};if("clientSecret"in e&&(n.clientSecret=e.clientSecret),e.clientType==="github-app"){if("refresh_token"in o.data){let s=new Date(o.headers.date).getTime();n.refreshToken=o.data.refresh_token,n.expiresAt=kr(s,o.data.expires_in),n.refreshTokenExpiresAt=kr(s,o.data.refresh_token_expires_in)}delete n.scopes}return{...o,authentication:n}}function kr(e,t){return new Date(e+t*1e3).toISOString()}async function Sr(e){let t=e.request||J,o=await dn(t,"POST /login/oauth/access_token",{client_id:e.clientId,client_secret:e.clientSecret,grant_type:"refresh_token",refresh_token:e.refreshToken}),n=new Date(o.headers.date).getTime(),s={clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,token:o.data.access_token,refreshToken:o.data.refresh_token,expiresAt:vr(n,o.data.expires_in),refreshTokenExpiresAt:vr(n,o.data.refresh_token_expires_in)};return{...o,authentication:s}}function vr(e,t){return new Date(e+t*1e3).toISOString()}async function Pr(e){let t=e.request||J,o=btoa(`${e.clientId}:${e.clientSecret}`);return t("DELETE /applications/{client_id}/token",{headers:{authorization:`basic ${o}`},client_id:e.clientId,access_token:e.token})}import{randomUUID as Am}from"node:crypto";import{existsSync as Om,readFileSync as Lm,writeFileSync as Dm,unlinkSync as Rm,renameSync as _m}from"node:fs";import{existsSync as Gm,readFileSync as Hm}from"node:fs";import{existsSync as Kc,readdirSync as zc,lstatSync as Xc}from"node:fs";import{join as Yc}from"node:path";var dc=null;function pc(e){let t=`[${e.module}]`,o=e.data&&Object.keys(e.data).length>0?` ${JSON.stringify(e.data)}`:"";process.stderr.write(`${t} ${e.level}: ${e.message}${o}
9
9
  `)}function uo(e){function t(o,n,s){let i={level:o,module:e,message:n,...s&&{data:s}};(dc??pc)(i)}return{debug:(o,n)=>t("debug",o,n),info:(o,n)=>t("info",o,n),warn:(o,n)=>t("warn",o,n),error:(o,n)=>t("error",o,n)}}function Re(e){return e.toLowerCase().replace(/^https?:\/\//,"").replace(/\/$/,"")}function Ge(e){if(!e.token.expiresAt)return!1;let t=new Date(e.token.expiresAt);if(isNaN(t.getTime()))return!0;let o=new Date;return t.getTime()-o.getTime()<300*1e3}function Er(e){if(!e.token.refreshTokenExpiresAt)return!1;let t=new Date(e.token.refreshTokenExpiresAt);return isNaN(t.getTime())?!0:new Date>=t}var At=new Map,gc=300*1e3;function mc(e){let t=Re(e),o=At.get(t);return!o||Date.now()-o.cachedAt>=gc?!1:o.credentials?!Ge(o.credentials):!0}function Ir(e){e?At.delete(Re(e)):At.clear()}function fc(e){let t=Re(e);if(mc(t))return At.get(t).credentials}function hc(e,t){let o=Re(e);At.set(o,{credentials:t,cachedAt:Date.now()})}var V=po.platform()==="win32",be=po.platform()==="darwin",Pm=po.platform()==="linux",B=po.homedir();function re(){return V?process.env.APPDATA||Sc.join(B,"AppData","Roaming"):B}var Pc=Ee(B,".octocode"),$c=448,xe=process.env.OCTOCODE_HOME||Pc,ne={home:xe,config:Ee(xe,".octocoderc"),credentials:Ee(xe,"credentials.json"),key:Ee(xe,".key"),session:Ee(xe,"session.json"),repos:Ee(xe,"repos"),logs:Ee(xe,"logs"),cliConfig:Ee(xe,"config.json"),lspConfig:Ee(xe,"lsp-servers.json")};function xc(){vc(ne.home)||wc(ne.home,{recursive:!0,mode:$c})}var Ec=y.object({token:y.string(),tokenType:y.literal("oauth"),scopes:y.array(y.string()).optional(),refreshToken:y.string().optional(),expiresAt:y.string().optional(),refreshTokenExpiresAt:y.string().optional()}),Ic=y.object({hostname:y.string(),username:y.string(),token:Ec,gitProtocol:y.enum(["ssh","https"]),createdAt:y.string(),updatedAt:y.string()}),Mc=y.object({version:y.number(),credentials:y.record(y.string(),Ic)}),xr=uo("token-storage");function Ac(e){return e.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}var xm=ne.home,De=ne.credentials,Ue=ne.key,Or="aes-256-gcm",Tc=16;function mn(){xc()}function Lr(){if(mn(),co(Ue))return yc(Ue).mode&511&63&&Cc(Ue,384),Buffer.from(Mr(Ue,"utf8"),"hex");let e=Tr(32);return Ar(Ue,e.toString("hex"),{mode:384}),e}function Oc(e){let t=Lr(),o=Tr(Tc),n=bc(Or,t,o),s=n.update(e,"utf8","hex");s+=n.final("hex");let i=n.getAuthTag();return`${o.toString("hex")}:${i.toString("hex")}:${s}`}function Lc(e){let t=Lr(),[o,n,s]=e.split(":");if(!o||!n||!s)throw new Error("Invalid encrypted data format");let i=Buffer.from(o,"hex"),a=Buffer.from(n,"hex"),l=kc(Or,t,i);l.setAuthTag(a);let u=l.update(s,"hex","utf8");return u+=l.final("utf8"),u}function go(){if(mn(),!co(De))return{version:1,credentials:{}};try{let e=Mr(De,"utf8"),t=Lc(e),o=JSON.parse(t),n=Mc.safeParse(o);return n.success?n.data:(xr.warn("Credentials file has invalid format \u2014 starting fresh",{file:De}),{version:1,credentials:{}})}catch(e){let t=e instanceof Error&&e.message?Ac(e.message):void 0;return xr.warn("Could not read credentials file \u2014 you may need to login again",{file:De,...t&&{reason:t}}),{version:1,credentials:{}}}}function Dr(e){mn();let t=Oc(JSON.stringify(e,null,2));Ar(De,t,{mode:384})}function Dc(){try{co(De)&&$r(De),co(Ue)&&$r(Ue)}catch{}}var Rr="178c6fc778ccc68e1d6a",fn="github.com";function Rc(e){return e.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}function _c(e){return e==="github.com"||e===fn?"https://api.github.com":`https://${e}/api/v3`}async function Nc(e,t=fn,o=Rr){let n=await e.getCredentials(t);if(!n)return{success:!1,error:`Not logged in to ${t}`};if(!n.token.refreshToken)return{success:!1,error:"Token does not support refresh (OAuth App tokens do not expire)"};if(Er(n))return{success:!1,error:"Refresh token has expired. Please login again."};try{let s=await Sr({clientType:"github-app",clientId:o,clientSecret:"",refreshToken:n.token.refreshToken,request:J.defaults({baseUrl:_c(t)})}),i={token:s.authentication.token,tokenType:"oauth",refreshToken:s.authentication.refreshToken,expiresAt:s.authentication.expiresAt,refreshTokenExpiresAt:s.authentication.refreshTokenExpiresAt};return await e.updateToken(t,i),{success:!0,username:n.username,hostname:t}}catch(s){return{success:!1,error:s instanceof Error?Rc(s.message):"Token refresh failed"}}}async function Fc(e,t=fn,o=Rr){let n=await e.getCredentials(t);if(!n||!n.token)return{token:null,source:"none"};if(!Ge(n))return{token:n.token.token,source:"stored",username:n.username};if(n.token.refreshToken){let s=await Nc(e,t,o);if(s.success){let i=await e.getCredentials(t);if(i?.token.token)return{token:i.token.token,source:"refreshed",username:i.username}}return{token:null,source:"none",refreshError:s.error}}return{token:null,source:"none",refreshError:"Token expired and no refresh token available"}}var _r=["OCTOCODE_TOKEN","GH_TOKEN","GITHUB_TOKEN"];function Nr(){for(let e of _r){let t=process.env[e];if(t&&t.trim())return t.trim()}return null}function Tt(){for(let e of _r){let t=process.env[e];if(t&&t.trim())return`env:${e}`}return null}function pt(){return Nr()!==null}var Bc="178c6fc778ccc68e1d6a",jc="github.com",gn=null;function Uc(e){gn=e}function Gc(){if(!gn)throw new Error("Token resolution not initialized. Call initTokenResolution() first.");return gn}async function hn(e){let t=e?.hostname??jc,o=e?.clientId??Bc,n=e?.getGhCliToken,s=Nr();if(s)return{token:s,source:Tt()??"env:GITHUB_TOKEN",wasRefreshed:!1};let i=await Gc().getTokenWithRefresh(t,o);if(i.token)return{token:i.token,source:"file",wasRefreshed:i.source==="refreshed",username:i.username};let a=i.refreshError;if(n)try{let l=await Promise.resolve(n(t));if(l?.trim())return{token:l.trim(),source:"gh-cli",wasRefreshed:!1,refreshError:a}}catch{}return a?{token:"",source:null,wasRefreshed:!1,refreshError:a}:null}var Hc=uo("token-storage");async function mo(e){let t=Re(e.hostname),o={...e,hostname:t,updatedAt:new Date().toISOString()};try{let n=go();return n.credentials[t]=o,Dr(n),Ir(t),{success:!0}}catch(n){let s=n instanceof Error?n.message:String(n);throw Hc.error("CRITICAL: Storage failed",{error:s.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}),new Error("Failed to store credentials")}}async function Ie(e="github.com",t){let o=Re(e);if(!t?.bypassCache){let i=fc(o);if(i!==void 0)return i}let s=go().credentials[o]||null;return hc(o,s),s}function yn(e="github.com"){let t=Re(e);return go().credentials[t]||null}async function Cn(e="github.com"){let t=Re(e),o=!1,n=go();return n.credentials[t]&&(delete n.credentials[t],Object.keys(n.credentials).length===0?Dc():Dr(n),o=!0),Ir(t),{success:o,deletedFromFile:o}}async function Vc(e,t){let o=await Ie(e);return o?(o.token=t,o.updatedAt=new Date().toISOString(),await mo(o),!0):!1}function bn(){return De}async function Wc(e="github.com"){let t=await Ie(e);return!t||!t.token||Ge(t)?null:t.token.token}async function fo(e,t){return Fc({getCredentials:Ie,updateToken:Vc},e,t)}Uc({getToken:Wc,getTokenWithRefresh:fo});var qc=y.object({toolCalls:y.number(),promptCalls:y.number(),errors:y.number(),rateLimits:y.number()}),Fm=y.object({version:y.literal(1),sessionId:y.string(),createdAt:y.string(),lastActiveAt:y.string(),stats:qc}),Bm=uo("session"),jm=ne.session;var Wm=y.object({$schema:y.string().optional(),version:y.number().int().optional(),github:y.record(y.string(),y.unknown()).optional(),gitlab:y.record(y.string(),y.unknown()).optional(),bitbucket:y.record(y.string(),y.unknown()).optional(),local:y.record(y.string(),y.unknown()).optional(),tools:y.record(y.string(),y.unknown()).optional(),network:y.record(y.string(),y.unknown()).optional(),telemetry:y.record(y.string(),y.unknown()).optional(),lsp:y.record(y.string(),y.unknown()).optional(),output:y.record(y.string(),y.unknown()).optional()}).passthrough(),qm=ne.config;var Km=uo("octocode-config");function _e(e){if(!Kc(e))return 0;let t=0,o=[e];for(;o.length>0;){let n=o.pop(),s;try{s=zc(n)}catch{continue}for(let i of s){let a=Yc(n,i);try{let l=Xc(a);if(l.isSymbolicLink())continue;l.isDirectory()?o.push(a):l.isFile()&&(t+=l.size)}catch{}}}return t}function gt(e){if(e<1024)return`${e} B`;let t=e/1024;if(t<1024)return`${t.toFixed(1)} KB`;let o=t/1024;return o<1024?`${o.toFixed(1)} MB`:`${(o/1024).toFixed(2)} GB`}function ho(){process.stdout.write("\x1B[2J\x1B[3J\x1B[H")}function kn(e,t){try{let o,n;return t?(o=t,n=[e]):be?(o="open",n=[e]):V?(o="cmd",n=["/c","start",'""',e]):(o="xdg-open",n=[e]),Jc(o,n,{stdio:"ignore",shell:V&&!t}).status===0}catch{return!1}}function Fr(e,t){switch(t){case"cursor":return kn(e,"cursor");case"vscode":return kn(e,"code");default:return kn(e)}}import L from"node:path";import ie from"node:fs";import vn from"node:path";var Qc=process.env.OCTOCODE_DEBUG==="1";function Y(e,t){try{return e()}catch(o){return Qc&&console.error("[trySafe]",o instanceof Error?o.message:o),t}}function T(e){return Y(()=>ie.existsSync(e)&&ie.statSync(e).isDirectory(),!1)}function Q(e){return Y(()=>ie.existsSync(e)&&ie.statSync(e).isFile(),!1)}function He(e){return Y(()=>Q(e)?ie.readFileSync(e,"utf8"):null,null)}function Ot(e,t){return Y(()=>{let o=vn.dirname(e);return T(o)||ie.mkdirSync(o,{recursive:!0,mode:448}),ie.writeFileSync(e,t,{encoding:"utf8",mode:384}),!0},!1)}function Br(e){return Q(e)?Y(()=>{let t=new Date().toISOString().replace(/[:.]/g,"-"),o=`${e}.backup-${t}`;return ie.copyFileSync(e,o),o},null):null}function jr(e){let t=He(e);return t?Y(()=>JSON.parse(t),null):null}function Ur(e,t){return Y(()=>{let o=JSON.stringify(t,null,2)+`
10
10
  `;return Ot(e,o)},!1)}function mt(e,t){return Y(()=>{if(!T(e))return!1;T(t)||ie.mkdirSync(t,{recursive:!0});let o=ie.readdirSync(e,{withFileTypes:!0});for(let n of o){let s=vn.join(e,n.name),i=vn.join(t,n.name);if(n.isDirectory()){if(!mt(s,i))return!1}else ie.copyFileSync(s,i)}return!0},!1)}function ke(e){return Y(()=>T(e)?ie.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name):[],[])}function ft(e){return Y(()=>T(e)?(ie.rmSync(e,{recursive:!0,force:!0}),!0):!1,!1)}function Gr(){return V?re():be?L.join(B,"Library","Application Support"):process.env.XDG_CONFIG_HOME||L.join(B,".config")}function Zc(){let e=Gr();return V?L.join(e,"Code","User","globalStorage"):be?L.join(e,"Code","User","globalStorage"):L.join(e,"Code","User","globalStorage")}var D={cursor:{id:"cursor",name:"Cursor",description:"AI-first code editor",category:"ide",url:"https://cursor.sh",envVars:["CURSOR_AGENT","CURSOR_TRACE_ID","CURSOR_SESSION_ID","CURSOR"]},"claude-desktop":{id:"claude-desktop",name:"Claude Desktop",description:"Anthropic's desktop app",category:"desktop",url:"https://claude.ai/download"},"claude-code":{id:"claude-code",name:"Claude Code",description:"Claude CLI for terminal",category:"cli",url:"https://docs.anthropic.com/claude-code",envVars:["CLAUDE_CODE"]},"vscode-cline":{id:"vscode-cline",name:"Cline (VS Code)",description:"AI coding assistant extension",category:"extension",url:"https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev",envVars:["VSCODE_PID","TERM_PROGRAM"]},"vscode-roo":{id:"vscode-roo",name:"Roo-Cline (VS Code)",description:"Roo AI coding extension",category:"extension",envVars:["VSCODE_PID"]},windsurf:{id:"windsurf",name:"Windsurf",description:"Codeium AI IDE",category:"ide",url:"https://codeium.com/windsurf",envVars:["WINDSURF_SESSION"]},trae:{id:"trae",name:"Trae",description:"Adaptive AI IDE",category:"ide",url:"https://trae.ai"},antigravity:{id:"antigravity",name:"Antigravity",description:"Gemini-powered AI IDE",category:"ide"},"vscode-continue":{id:"vscode-continue",name:"Continue (VS Code)",description:"Open-source AI assistant",category:"extension",url:"https://continue.dev",envVars:["VSCODE_PID"]},zed:{id:"zed",name:"Zed",description:"High-performance code editor",category:"ide",url:"https://zed.dev",envVars:["ZED_TERM"]},opencode:{id:"opencode",name:"Opencode",description:"AI coding agent CLI",category:"cli",url:"https://opencode.ai",envVars:["OPENCODE"]},codex:{id:"codex",name:"Codex",description:"OpenAI Codex CLI agent",category:"cli",url:"https://github.com/openai/codex",envVars:["CODEX_HOME","CODEX_SANDBOX_TYPE"]},"gemini-cli":{id:"gemini-cli",name:"Gemini CLI",description:"Google Gemini CLI",category:"cli",url:"https://github.com/google-gemini/gemini-cli",envVars:["GEMINI_API_KEY"]},goose:{id:"goose",name:"Goose",description:"Block AI coding agent",category:"desktop",url:"https://block.github.io/goose",envVars:["GOOSE_MODE"]},kiro:{id:"kiro",name:"Kiro",description:"AWS AI IDE",category:"ide",url:"https://kiro.dev"},custom:{id:"custom",name:"Custom Path",description:"Specify your own MCP config path",category:"cli"}};function U(e,t){if(e==="custom"&&t)return t;let o=Gr(),n=Zc();switch(e){case"cursor":return V?L.join(re(),"Cursor","mcp.json"):L.join(B,".cursor","mcp.json");case"claude-desktop":return V?L.join(o,"Claude","claude_desktop_config.json"):be?L.join(o,"Claude","claude_desktop_config.json"):L.join(o,"claude","claude_desktop_config.json");case"claude-code":return L.join(B,".claude.json");case"vscode-cline":return L.join(n,"saoudrizwan.claude-dev","settings","cline_mcp_settings.json");case"vscode-roo":return L.join(n,"rooveterinaryinc.roo-cline","settings","mcp_settings.json");case"windsurf":return L.join(B,".codeium","windsurf","mcp_config.json");case"trae":return V?L.join(re(),"Trae","mcp.json"):be?L.join(o,"Trae","mcp.json"):L.join(o,"Trae","mcp.json");case"antigravity":return L.join(B,".gemini","antigravity","mcp_config.json");case"vscode-continue":return L.join(B,".continue","config.json");case"zed":return V?L.join(re(),"Zed","settings.json"):be?L.join(B,".config","zed","settings.json"):L.join(o,"zed","settings.json");case"opencode":return V?L.join(re(),"opencode","config.json"):L.join(o,"opencode","config.json");case"codex":return L.join(B,".codex","config.toml");case"gemini-cli":return L.join(B,".gemini","settings.json");case"goose":return V?L.join(re(),"goose","config.yaml"):be?L.join(o,"goose","config.yaml"):L.join(o,"goose","config.yaml");case"kiro":return V?L.join(re(),"Kiro","mcp.json"):L.join(B,".kiro","mcp.json");case"custom":throw new Error("Custom path requires customPath parameter");default:throw new Error(`Unknown MCP client: ${e}`)}}function Ne(e,t){try{let o=U(e,t),n=L.dirname(o);return T(n)}catch{return!1}}function yo(e,t){try{let o=U(e,t);return Q(o)}catch{return!1}}function ht(){let e=process.env;return e.CURSOR_AGENT||e.CURSOR_TRACE_ID||e.CURSOR_SESSION_ID||e.CURSOR?"cursor":e.WINDSURF_SESSION?"windsurf":e.CLAUDE_CODE?"claude-code":e.ZED_TERM||e.ZED?"zed":e.OPENCODE?"opencode":e.CODEX_HOME||e.CODEX_SANDBOX_TYPE?"codex":e.GEMINI_API_KEY?"gemini-cli":e.GOOSE_MODE?"goose":e.VSCODE_PID||e.TERM_PROGRAM==="vscode"?e.ROO_CLINE||e.ROO?"vscode-roo":e.CONTINUE_GLOBAL_DIR?"vscode-continue":"vscode-cline":null}function Hr(){let e=[],t=["cursor","claude-desktop","claude-code","vscode-cline","vscode-roo","vscode-continue","windsurf","trae","antigravity","zed","opencode","codex","gemini-cli","goose","kiro"];for(let o of t)Ne(o)&&e.push(o);return e}import eu from"node:path";import tu from"node:fs";function G(e){return Q(e)?jr(e):{mcpServers:{}}}function ee(e,t,o=!0){try{let n;if(o&&Q(e)){let a=Br(e);a&&(n=a)}let s=eu.dirname(e);return T(s)||tu.mkdirSync(s,{recursive:!0,mode:448}),Ur(e,t)?{success:!0,backupPath:n}:{success:!1,error:"Failed to write config file"}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}function Lt(e,t){let o;switch(e){case"direct":o={command:"bash",args:["-c",`set -euo pipefail; TMPDIR=$(mktemp -d); trap 'rm -rf "$TMPDIR"' EXIT; curl -fsSL https://octocodeai.com/octocode/latest/index.js -o "$TMPDIR/index.js"; node "$TMPDIR/index.js"`]};break;case"npx":o={command:"npx",args:["octocode-mcp@latest"]};break;default:throw new Error(`Unknown install method: ${e}`)}if(t){let n={};t.enableLocal&&(n.ENABLE_LOCAL="true"),t.githubToken&&(n.GITHUB_TOKEN=t.githubToken),Object.keys(n).length>0&&(o.env=n)}return o}function Co(e,t){if(e==="direct"){let o={command:"powershell",args:["-Command","$tmpDir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName()); New-Item -ItemType Directory -Path $tmpDir -Force | Out-Null; $tmpFile = Join-Path $tmpDir 'index.js'; Invoke-WebRequest -Uri 'https://octocodeai.com/octocode/latest/index.js' -OutFile $tmpFile; node $tmpFile; Remove-Item -Recurse -Force $tmpDir"]};if(t){let n={};t.enableLocal&&(n.ENABLE_LOCAL="true"),t.githubToken&&(n.GITHUB_TOKEN=t.githubToken),Object.keys(n).length>0&&(o.env=n)}return o}return Lt(e,t)}function wn(e,t,o){let n=V?Co(t,o):Lt(t,o);return{...e,mcpServers:{...e.mcpServers,octocode:n}}}function Me(e){return!!e.mcpServers?.octocode}function bo(e){let t=e.mcpServers?.octocode;return t?t.command==="npx"?"npx":t.command==="bash"||t.command==="powershell"?"direct":null:null}function Sn(e,t){let o=U(e,t),n=yo(e,t),s=!1,i=null;if(n){let a=G(o);a&&(s=Me(a),i=bo(a))}return{client:e,configExists:n,octocodeInstalled:s,method:i,configPath:o}}function ko(){return["cursor","claude-desktop","claude-code","opencode","vscode-cline","vscode-roo","vscode-continue","windsurf","trae","antigravity","zed"].map(t=>Sn(t))}function Vr(e,t){if(!e.mcpServers?.[t])return e;let o=Object.fromEntries(Object.entries(e.mcpServers).filter(([n])=>n!==t));return{...e,mcpServers:o}}function Pn(e){return e==="claude"?"claude-desktop":e}function ou(e){let t=U(Pn(e));if(!Q(t))return{installed:!1,configPath:t,configExists:!1};let n=G(t);return n?{installed:Me(n),configPath:t,configExists:!0}:{installed:!1,configPath:t,configExists:!0}}function Wr(e){let{ide:t,method:o,force:n=!1}=e,s=U(Pn(t)),i=G(s)||{mcpServers:{}};if(Me(i)&&!n)return{success:!1,configPath:s,alreadyInstalled:!0,error:"Octocode is already configured. Use --force to overwrite."};i=wn(i,o);let a=ee(s,i);return a.success?{success:!0,configPath:s,backupPath:a.backupPath}:{success:!1,configPath:s,error:a.error||"Failed to write config"}}function qr(e,t){let o=U(Pn(e)),n=ou(e),s=G(o),i=V?Co(t):Lt(t),a="create";return n.installed?a="override":n.configExists&&(a="add"),{ide:e,method:t,configPath:o,serverConfig:i,action:a,existingMethod:s?bo(s):null}}function nu(e,t){let o=e==="custom"&&t?t:U(e,t);if(!Q(o))return{installed:!1,configPath:o,configExists:!1};let s=G(o);return s?{installed:Me(s),configPath:o,configExists:!0}:{installed:!1,configPath:o,configExists:!0}}function Kr(e){let{client:t,method:o,customPath:n,force:s=!1,envOptions:i}=e,a=t==="custom"&&n?n:U(t,n),l=G(a)||{mcpServers:{}};if(Me(l)&&!s)return{success:!1,configPath:a,alreadyInstalled:!0,error:"Octocode is already configured. Use --force to overwrite."};l=wn(l,o,i);let u=ee(a,l);return u.success?{success:!0,configPath:a,backupPath:u.backupPath}:{success:!1,configPath:a,error:u.error||"Failed to write config"}}function $n(e,t,o,n){let s=e==="custom"&&o?o:U(e,o),i=nu(e,o),a=G(s),l=V?Co(t,n):Lt(t,n),u="create";return i.installed?u="override":i.configExists&&(u="add"),{client:e,method:t,configPath:s,serverConfig:l,action:u,existingMethod:a?bo(a):null}}import{execSync as zr,exec as su}from"node:child_process";import{promisify as ru}from"node:util";var Tf=ru(su),iu=1e3,au=3e3,lu=4e3;function vo(){try{return{installed:!0,version:zr("node --version",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}}catch{return{installed:!1,version:null}}}function wo(){try{return{installed:!0,version:`v${zr("npm --version",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}`}}catch{return{installed:!1,version:null}}}async function Xr(){let e="https://registry.npmjs.org";try{let t=Date.now(),o=new AbortController,n=setTimeout(()=>o.abort(),lu),s=await fetch(e,{method:"HEAD",signal:o.signal});clearTimeout(n);let i=Date.now()-t;return s.ok?i>au?{status:"slow",latency:i}:i>iu?{status:"slow",latency:i}:{status:"ok",latency:i}:{status:"failed",latency:i}}catch{return{status:"failed",latency:null}}}var Dt={cursor:{name:"Cursor",description:"AI-first code editor",url:"https://cursor.sh"},"claude-desktop":{name:"Claude Desktop",description:"Anthropic's Claude desktop app",url:"https://claude.ai/download"},"claude-code":{name:"Claude Code",description:"Claude CLI for terminal",url:"https://docs.anthropic.com/claude-code"},opencode:{name:"Opencode",description:"AI coding agent CLI",url:"https://opencode.ai"},"vscode-cline":{name:"Cline (VS Code)",description:"AI coding assistant extension",url:"https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev"},"vscode-roo":{name:"Roo-Cline (VS Code)",description:"Roo AI coding extension",url:"https://github.com/RooVetGit/Roo-Cline"},"vscode-continue":{name:"Continue (VS Code)",description:"Open-source AI assistant",url:"https://continue.dev"},windsurf:{name:"Windsurf",description:"Codeium AI IDE",url:"https://codeium.com/windsurf"},trae:{name:"Trae",description:"Adaptive AI IDE",url:"https://trae.ai"},antigravity:{name:"Antigravity",description:"Gemini-powered AI IDE",url:"https://antigravity.dev"},zed:{name:"Zed",description:"High-performance code editor",url:"https://zed.dev"},codex:{name:"Codex",description:"OpenAI Codex CLI agent",url:"https://github.com/openai/codex"},"gemini-cli":{name:"Gemini CLI",description:"Google Gemini CLI",url:"https://github.com/google-gemini/gemini-cli"},goose:{name:"Goose",description:"Block AI coding agent",url:"https://block.github.io/goose"},kiro:{name:"Kiro",description:"AWS AI IDE",url:"https://kiro.dev"},custom:{name:"Custom Path",description:"Specify your own MCP config path",url:""},claude:{name:"Claude Desktop",description:"Anthropic's Claude desktop app",url:"https://claude.ai/download"}},xn={cursor:Dt.cursor,claude:Dt.claude},Yr={direct:{name:"Direct (curl)",description:"Download and run directly from octocode.ai",pros:["Always latest version","No npm required"],cons:["Requires curl (or PowerShell on Windows)","Slower startup"]},npx:{name:"NPX",description:"Run via npx from npm registry",pros:["Standard npm workflow","Faster after first run (cached)"],cons:["Requires Node.js/npm"]}};var En=new Set;function So(){process.stdout.write("\x1B[?25h")}var Jr=!1;function cu(){Jr||(Jr=!0,process.on("exit",So),process.on("SIGINT",()=>{So(),process.exit(0)}),process.on("SIGTERM",()=>{So(),process.exit(0)}),process.on("uncaughtException",e=>{So(),console.error("Uncaught exception:",e),process.exit(1)}))}var A=class{text;frames;i;timer;constructor(t=""){this.text=t,this.frames=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],this.i=0,this.timer=null}start(t,o=0){t&&(this.text=t),this.timer&&(clearInterval(this.timer),this.timer=null),cu(),En.add(this),process.stdout.write("\x1B[?25l");let n=" ".repeat(o);return this.timer=setInterval(()=>{let s=this.frames[this.i++%this.frames.length];process.stdout.write(`\r${n}${r("cyan",s)} ${this.text}`)},80),this}clear(){return this.timer&&(clearInterval(this.timer),this.timer=null),En.delete(this),process.stdout.write("\r\x1B[2K"),process.stdout.write("\x1B[?25h"),this}stop(t="\u2713",o="green"){return this.timer&&(clearInterval(this.timer),this.timer=null),En.delete(this),process.stdout.write(`\r\x1B[2K${r(o,t)} ${this.text}
11
11
  `),process.stdout.write("\x1B[?25h"),this}succeed(t){return t&&(this.text=t),this.stop("\u2713","green")}fail(t){return t&&(this.text=t),this.stop("\u2717","red")}info(t){return t&&(this.text=t),this.stop("\u2139","blue")}warn(t){return t&&(this.text=t),this.stop("\u26A0","yellow")}update(t){return this.text=t,this}};var ae=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",ve=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n",In=e=>e.name==="space",Rt=e=>e.name==="backspace",Ve=e=>e.name==="tab",_t=e=>"1234567890".includes(e.name),ge=e=>e.name==="enter"||e.name==="return";var Po=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},$o=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Nt=class extends Error{name="ExitPromptError"},xo=class extends Error{name="HookError"},Fe=class extends Error{name="ValidationError"};import{AsyncResource as gu}from"node:async_hooks";import{AsyncLocalStorage as uu,AsyncResource as du}from"node:async_hooks";var Qr=new uu;function pu(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Zr(e,t){let o=pu(e);return Qr.run(o,()=>{function n(s){o.handleChange=()=>{o.index=0,s()},o.handleChange()}return t(n)})}function We(){let e=Qr.getStore();if(!e)throw new xo("[Inquirer] Hook functions can only be called from within a prompt");return e}function Mn(){return We().rl}function An(e){let t=(...o)=>{let n=We(),s=!1,i=n.handleChange;n.handleChange=()=>{s=!0};let a=e(...o);return s&&i(),n.handleChange=i,a};return du.bind(t)}function yt(e){let t=We(),{index:o}=t,n={get(){return t.hooks[o]},set(i){t.hooks[o]=i},initialized:o in t.hooks},s=e(n);return t.index++,s}function ei(){We().handleChange()}var qe={queue(e){let t=We(),{index:o}=t;t.hooksEffect.push(()=>{t.hooksCleanup[o]?.();let n=e(Mn());if(n!=null&&typeof n!="function")throw new Fe("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[o]=n})},run(){let e=We();An(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=We();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function _(e){return yt(t=>{let o=gu.bind(function(i){t.get()!==i&&(t.set(i),ei())});if(t.initialized)return[t.get(),o];let n=typeof e=="function"?e():e;return t.set(n),[n,o]})}function me(e,t){yt(o=>{let n=o.get();(!Array.isArray(n)||t.some((i,a)=>!Object.is(i,n[a])))&&qe.queue(e),o.set(t)})}import{styleText as fe}from"node:util";import we from"node:process";function mu(){return we.platform!=="win32"?we.env.TERM!=="linux":!!we.env.WT_SESSION||!!we.env.TERMINUS_SUBLIME||we.env.ConEmuTask==="{cmd::Cmder}"||we.env.TERM_PROGRAM==="Terminus-Sublime"||we.env.TERM_PROGRAM==="vscode"||we.env.TERM==="xterm-256color"||we.env.TERM==="alacritty"||we.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ti={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},oi={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},fu={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},hu={...ti,...oi},yu={...ti,...fu},Cu=mu(),bu=Cu?hu:yu,le=bu,Kf=Object.entries(oi);var ni={prefix:{idle:fe("blue","?"),done:fe("green",le.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>fe("yellow",e))},style:{answer:e=>fe("cyan",e),message:e=>fe("bold",e),error:e=>fe("red",`> ${e}`),defaultAnswer:e=>fe("dim",`(${e})`),help:e=>fe("dim",e),highlight:e=>fe("cyan",e),key:e=>fe("cyan",fe("bold",`<${e}>`))}};function si(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ri(...e){let t={};for(let o of e)for(let[n,s]of Object.entries(o)){let i=t[n];t[n]=si(i)&&si(s)?ri(i,s):s}return t}function ce(...e){let t=[ni,...e.filter(o=>o!=null)];return ri(...t)}function he({status:e="idle",theme:t}){let[o,n]=_(!1),[s,i]=_(0),{prefix:a,spinner:l}=ce(t);return me(()=>{if(e==="loading"){let p,d=-1,m=setTimeout(()=>{n(!0),p=setInterval(()=>{d=d+1,i(d%l.frames.length)},l.interval)},300);return()=>{clearTimeout(m),clearInterval(p)}}else n(!1)},[e]),o?l.frames[s]:typeof a=="string"?a:a[e==="loading"?"idle":e]??a.idle}function Ae(e,t){return yt(o=>{let n=o.get();if(!n||n.dependencies.length!==t.length||n.dependencies.some((s,i)=>s!==t[i])){let s=e();return o.set({value:s,dependencies:t}),s}return n.value})}function Te(e){return _({current:e})[0]}function ye(e){let t=Te(e);t.current=e,me(o=>{let n=!1,s=An((i,a)=>{n||t.current(a,o)});return o.input.on("keypress",s),()=>{n=!0,o.input.removeListener("keypress",s)}},[])}var Si=nn(ai(),1);var li=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let o=0;for(e.lastIndex=0;e.test(t);)o+=1;return t.length-o}})(),ci=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ui=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var wu=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Su=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,di=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Pu=/\t{1,1000}/y,pi=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),$u=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,xu=new RegExp("\\p{M}+","gu"),Eu={limit:1/0,ellipsis:""},gi=(e,t={},o={})=>{let n=t.limit??1/0,s=t.ellipsis??"",i=t?.ellipsisWidth??(s?gi(s,Eu,o).width:0),a=0,l=o.controlWidth??0,u=o.tabWidth??8,p=o.emojiWidth??2,d=2,m=o.regularWidth??1,f=o.wideWidth??d,C=[[$u,m],[wu,a],[Su,l],[Pu,u],[pi,p],[di,f]],w=0,v=0,h=e.length,k=0,b=!1,$=h,I=Math.max(0,n-i),R=0,N=0,F=0,z=0;e:for(;;){if(N>R||v>=h&&v>w){let S=e.slice(R,N)||e.slice(w,v);k=0;for(let M of S.replaceAll(xu,"")){let P=M.codePointAt(0)||0;if(ci(P)?z=d:ui(P)?z=f:z=m,F+z>I&&($=Math.min($,Math.max(R,w)+k)),F+z>n){b=!0;break e}k+=M.length,F+=z}R=N=0}if(v>=h)break e;for(let S=0,M=C.length;S<M;S++){let[P,O]=C[S];if(P.lastIndex=v,P.test(e)){if(k=P===di?li(e.slice(v,P.lastIndex)):P===pi?1:P.lastIndex-v,z=k*O,F+z>I&&($=Math.min($,v+Math.floor((I-F)/O))),F+z>n){b=!0;break e}F+=z,R=w,N=v,v=w=P.lastIndex;continue e}}v+=1}return{width:b?I:F,index:b?$:h,truncated:b,ellipsed:b&&n>=i}},mi=gi;var Iu={limit:1/0,ellipsis:"",ellipsisWidth:0},Mu=(e,t={})=>mi(e,Iu,t).width,Oe=Mu;var Eo="\x1B",bi="\x9B",Au=39,On="\x07",ki="[",Tu="]",vi="m",Ln=`${Tu}8;;`,fi=new RegExp(`(?:\\${ki}(?<code>\\d+)m|\\${Ln}(?<uri>.*)${On})`,"y"),hi=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},yi=e=>`${Eo}${ki}${e}${vi}`,Ci=e=>`${Eo}${Ln}${e}${On}`,Tn=(e,t,o)=>{let n=t[Symbol.iterator](),s=!1,i=!1,a=e.at(-1),l=a===void 0?0:Oe(a),u=n.next(),p=n.next(),d=0;for(;!u.done;){let m=u.value,f=Oe(m);l+f<=o?e[e.length-1]+=m:(e.push(m),l=0),(m===Eo||m===bi)&&(s=!0,i=t.startsWith(Ln,d+1)),s?i?m===On&&(s=!1,i=!1):m===vi&&(s=!1):(l+=f,l===o&&!p.done&&(e.push(""),l=0)),u=p,p=n.next(),d+=m.length}a=e.at(-1),!l&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ou=e=>{let t=e.split(" "),o=t.length;for(;o&&!Oe(t[o-1]);)o--;return o===t.length?e:t.slice(0,o).join(" ")+t.slice(o).join("")},Lu=(e,t,o={})=>{if(o.trim!==!1&&e.trim()==="")return"";let n="",s,i,a=e.split(" "),l=[""],u=0;for(let m=0;m<a.length;m++){let f=a[m];if(o.trim!==!1){let w=l.at(-1)??"",v=w.trimStart();w.length!==v.length&&(l[l.length-1]=v,u=Oe(v))}m!==0&&(u>=t&&(o.wordWrap===!1||o.trim===!1)&&(l.push(""),u=0),(u||o.trim===!1)&&(l[l.length-1]+=" ",u++));let C=Oe(f);if(o.hard&&C>t){let w=t-u,v=1+Math.floor((C-w-1)/t);Math.floor((C-1)/t)<v&&l.push(""),Tn(l,f,t),u=Oe(l.at(-1)??"");continue}if(u+C>t&&u&&C){if(o.wordWrap===!1&&u<t){Tn(l,f,t),u=Oe(l.at(-1)??"");continue}l.push(""),u=0}if(u+C>t&&o.wordWrap===!1){Tn(l,f,t),u=Oe(l.at(-1)??"");continue}l[l.length-1]+=f,u+=C}o.trim!==!1&&(l=l.map(m=>Ou(m)));let p=l.join(`
@@ -5,6 +5,6 @@ import { dirname as __dirname_fn } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __dirname_fn(__filename);
8
- import{c as i,e as r}from"./chunk-LH4AZJPA.js";import{a as o,b as t,c as e}from"./chunk-V64AXUWB.js";import"./chunk-YBBF4DTY.js";function u(){let c=["GitHub","Local","LSP","Package"],n=[];for(let l of c){let s=i.filter(a=>r(a.name)===l);if(s.length!==0){n.push(` ${e(l)}`);for(let a of s){let $=a.name.padEnd(28);n.push(` ${o("cyan",$)} ${e("--tool")} ${a.name}`)}}}return n}function m(){let c=u(),n=["",` ${o("magenta",t("\u{1F50D}\u{1F419} Octocode CLI"))}`,"",` ${t("Two things in one binary:")}`,` ${o("magenta","1.")} ${t("Manage")} \u2014 install, auth, skills, MCP marketplace, sync, cache`,` ${o("magenta","2.")} ${t("Run tools")} \u2014 call any Octocode tool directly from terminal`,"",` ${t("USAGE")}`,` ${o("magenta","octocode-cli")} <command> [options] ${e("manage Octocode")}`,` ${o("magenta","octocode-cli")} --tool <name> --queries '<json>' ${e("run a tool")}`,"",` ${t("COMMANDS")} ${e("(manage Octocode configuration)")}`,` ${o("magenta","install")} Configure octocode-mcp for an IDE`,` ${o("magenta","auth")} Manage GitHub authentication`,` ${o("magenta","login / logout")} Sign in or out of GitHub`,` ${o("magenta","status / token")} Show auth status or print token`,` ${o("magenta","skills")} Install/remove bundled Octocode skills`,` ${o("magenta","mcp")} Manage MCP marketplace`,` ${o("magenta","sync")} Sync MCP configs across IDEs`,` ${o("magenta","cache")} Inspect and clean Octocode cache`,"",` ${t("TOOLS")} ${e("(run Octocode tools directly \u2014 for agents and humans)")}`,...c,"",` ${t("OPTIONS")}`,` ${o("cyan","--tool <name> --queries '<json>'")} Run a tool`,` ${o("cyan","--tool <name> --help")} Show tool input/output schema`,` ${o("cyan","--tools-context")} Full MCP instructions + all schemas`,` ${o("cyan","--json")} Raw JSON output`,` ${o("cyan","-h, --help")} Show this help`,` ${o("cyan","-v, --version")} Show version`,"",` ${t("EXAMPLES")}`,` ${e("# Run a tool")}`,` ${o("yellow",`octocode-cli --tool localSearchCode --queries '{"path":".","pattern":"runCLI"}'`)}`,` ${o("yellow",`octocode-cli --tool githubSearchCode --queries '{"keywordsToSearch":["hook"],"owner":"facebook","repo":"react"}'`)}`,"",` ${e("# Discover tools")}`,` ${o("yellow","octocode-cli --tool githubSearchCode --help")}`,` ${o("yellow","octocode-cli --tools-context")}`,"",` ${e("# Manage Octocode")}`,` ${o("yellow","octocode-cli install --ide cursor")}`,` ${o("yellow","octocode-cli skills install --targets claude-code,cursor")}`,"",o("magenta",` \u2500\u2500\u2500 \u{1F50D}\u{1F419} ${t("https://octocode.ai")} \u2500\u2500\u2500`),""];process.stdout.write(`${n.join(`
8
+ import{c as i,e as r}from"./chunk-QCY7Q7YW.js";import{a as o,b as t,c as e}from"./chunk-V64AXUWB.js";import"./chunk-YBBF4DTY.js";function u(){let c=["GitHub","Local","LSP","Package"],n=[];for(let l of c){let s=i.filter(a=>r(a.name)===l);if(s.length!==0){n.push(` ${e(l)}`);for(let a of s){let $=a.name.padEnd(28);n.push(` ${o("cyan",$)} ${e("--tool")} ${a.name}`)}}}return n}function m(){let c=u(),n=["",` ${o("magenta",t("\u{1F50D}\u{1F419} Octocode CLI"))}`,"",` ${t("Two things in one binary:")}`,` ${o("magenta","1.")} ${t("Manage")} \u2014 install, auth, skills, MCP marketplace, sync, cache`,` ${o("magenta","2.")} ${t("Run tools")} \u2014 call any Octocode tool directly from terminal`,"",` ${t("USAGE")}`,` ${o("magenta","octocode-cli")} <command> [options] ${e("manage Octocode")}`,` ${o("magenta","octocode-cli")} --tool <name> --queries '<json>' ${e("run a tool")}`,"",` ${t("COMMANDS")} ${e("(manage Octocode configuration)")}`,` ${o("magenta","install")} Configure octocode-mcp for an IDE`,` ${o("magenta","auth")} Manage GitHub authentication`,` ${o("magenta","login / logout")} Sign in or out of GitHub`,` ${o("magenta","status / token")} Show auth status or print token`,` ${o("magenta","skills")} Install/remove bundled Octocode skills`,` ${o("magenta","mcp")} Manage MCP marketplace`,` ${o("magenta","sync")} Sync MCP configs across IDEs`,` ${o("magenta","cache")} Inspect and clean Octocode cache`,"",` ${t("TOOLS")} ${e("(run Octocode tools directly \u2014 for agents and humans)")}`,...c,"",` ${t("OPTIONS")}`,` ${o("cyan","--tool <name> --queries '<json>'")} Run a tool`,` ${o("cyan","--tool <name> --help")} Show tool input/output schema`,` ${o("cyan","--tools-context")} Full MCP instructions + all schemas`,` ${o("cyan","--json")} Raw JSON output`,` ${o("cyan","-h, --help")} Show this help`,` ${o("cyan","-v, --version")} Show version`,"",` ${t("EXAMPLES")}`,` ${e("# Run a tool")}`,` ${o("yellow",`octocode-cli --tool localSearchCode --queries '{"path":".","pattern":"runCLI"}'`)}`,` ${o("yellow",`octocode-cli --tool githubSearchCode --queries '{"keywordsToSearch":["hook"],"owner":"facebook","repo":"react"}'`)}`,"",` ${e("# Discover tools")}`,` ${o("yellow","octocode-cli --tool githubSearchCode --help")}`,` ${o("yellow","octocode-cli --tools-context")}`,"",` ${e("# Manage Octocode")}`,` ${o("yellow","octocode-cli install --ide cursor")}`,` ${o("yellow","octocode-cli skills install --targets claude-code,cursor")}`,"",o("magenta",` \u2500\u2500\u2500 \u{1F50D}\u{1F419} ${t("https://octocode.ai")} \u2500\u2500\u2500`),""];process.stdout.write(`${n.join(`
9
9
  `)}
10
10
  `)}export{m as showHelp};
@@ -5,4 +5,4 @@ import { dirname as __dirname_fn } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __dirname_fn(__filename);
8
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k}from"./chunk-LH4AZJPA.js";import"./chunk-V64AXUWB.js";import"./chunk-YBBF4DTY.js";export{a as AUTO_FILLED_FIELDS,b as TOOL_DEFINITIONS,j as executeToolCommand,c as findToolDefinition,e as getDisplayFields,d as getToolCategory,h as getToolsContextString,i as printToolsContext,f as showAvailableTools,g as showToolHelp,k as toolCommand};
8
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k}from"./chunk-QCY7Q7YW.js";import"./chunk-V64AXUWB.js";import"./chunk-YBBF4DTY.js";export{a as AUTO_FILLED_FIELDS,b as TOOL_DEFINITIONS,j as executeToolCommand,c as findToolDefinition,e as getDisplayFields,d as getToolCategory,h as getToolsContextString,i as printToolsContext,f as showAvailableTools,g as showToolHelp,k as toolCommand};
@@ -5,4 +5,4 @@ import { dirname as __dirname_fn } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __dirname_fn(__filename);
8
- import{c as m}from"./chunks/chunk-V64AXUWB.js";import"./chunks/chunk-YBBF4DTY.js";var d=new Set(["ide","method","m","output","o","hostname","H","git-protocol","p","type","t","skill","k","targets","mode","model","resume","r","id","client","c","search","category","env","config","tool","queries","input","responseCharLength","responseCharOffset"]),_=new Set(["help","h","version","v","force","source","json","status","dry-run","installed","repos","skills","logs","all","tools","local","lsp","api","list","schema","tools-context"]),x=new Set(["output","responseCharLength","responseCharOffset","tool","queries"]);function h(e,o){return _.has(o)?!1:d.has(o)?!0:e.command==="tool"||typeof e.options.tool=="string"}function g(e=process.argv.slice(2)){let o={command:null,args:[],options:{}},t=0;for(;t<e.length;){let i=e[t];if(i.startsWith("--")){let[n,s]=i.slice(2).split("=");s!==void 0?o.options[n]=s:h(o,n)&&t+1<e.length&&!e[t+1].startsWith("-")?(o.options[n]=e[t+1],t++):o.options[n]=!0}else if(i.startsWith("-")&&!i.startsWith("--")&&i.length>2){let n=i.slice(1),[s,r]=n.split("=");if(x.has(s))r!==void 0?o.options[s]=r:h(o,s)&&t+1<e.length&&!e[t+1].startsWith("-")?(o.options[s]=e[t+1],t++):o.options[s]=!0;else{let l=n,a=l[l.length-1];if(l.length===1&&d.has(a)&&t+1<e.length&&!e[t+1].startsWith("-"))o.options[a]=e[t+1],t++;else for(let c of l)o.options[c]=!0}}else if(i.startsWith("-")&&i.length>1){let n=i.slice(1),s=n[n.length-1];if(n.length===1&&d.has(s)&&t+1<e.length&&!e[t+1].startsWith("-"))o.options[s]=e[t+1],t++;else for(let r of n)o.options[r]=!0}else o.command||typeof o.options.tool=="string"?o.args.push(i):o.command=i;t++}return!o.command&&typeof o.options.tool=="string"&&(o.command="tool",o.args=[o.options.tool,...o.args]),o}function C(e){return!!(e.options.help||e.options.h)}function w(e){return!!(e.options.version||e.options.v)}async function P(){return import("./chunks/commands-M3QTWKWE.js")}async function H(){return import("./chunks/command-help-specs-CQ3RBLP6.js")}async function p(){return import("./chunks/tool-command-VHFLPIHY.js")}async function u(){return import("./chunks/main-help-HXFAFHPG.js")}async function I(){return import("./chunks/help-XPXP46ZT.js")}function A(){console.log(),console.log(" Use octocode-cli --tool <toolName> --queries '<json-stringified-input>'."),console.log(` Example: octocode-cli --tool localSearchCode --queries '{"path":".","pattern":"runCLI"}'`),console.log()}function L(){console.log("octocode-cli v1.3.0")}async function y(e){let o=g(e);if(o.options["tools-context"]===!0){let{printToolsContext:n}=await p();return await n(),!0}if(C(o)){if(o.command==="tool"&&typeof o.options.tool=="string"&&typeof o.args[0]=="string"){let{showToolHelp:s}=await p();if(await s(o.args[0]))return!0}if(o.command==="tool"){let{showHelp:s}=await u();return s(),!0}if(o.command){let[{findStaticCommandHelp:s},{showCommandHelp:r}]=await Promise.all([H(),I()]),l=s(o.command);if(l)return r(l),!0;let[{findCommand:a},{showHelp:c}]=await Promise.all([P(),u()]),f=a(o.command);return f?(r(f),!0):(c(),!0)}let{showHelp:n}=await u();return n(),!0}if(w(o))return L(),!0;if(!o.command)return!1;if(o.command==="tool")return typeof o.options.tool!="string"?(A(),process.exitCode=1,!0):(await(await p()).executeToolCommand(o)||(process.exitCode=1),!0);let{findCommand:t}=await P(),i=t(o.command);return i?(await i.handler(o),!0):(console.log(),console.log(` Unknown command: ${o.command}`),console.log(" Run 'octocode-cli --help' to see available commands."),console.log(),process.exitCode=1,!0)}async function T(){let{showHelp:e}=await import("./chunks/main-help-HXFAFHPG.js");e()}async function O(){await y()||await T()}function S(){process.stdout.write("\x1B[?25h"),console.log(),console.log(m(" Goodbye! \u{1F44B}")),process.exit(0)}process.on("SIGINT",S);process.on("SIGTERM",S);O().catch(e=>{e?.name==="ExitPromptError"&&(console.log(),console.log(m(" Goodbye! \u{1F44B}")),process.exit(0)),console.error("Error:",e),process.exit(1)});
8
+ import{c as m}from"./chunks/chunk-V64AXUWB.js";import"./chunks/chunk-YBBF4DTY.js";var d=new Set(["ide","method","m","output","o","hostname","H","git-protocol","p","type","t","skill","k","targets","mode","model","resume","r","id","client","c","search","category","env","config","tool","queries","input","responseCharLength","responseCharOffset"]),_=new Set(["help","h","version","v","force","source","json","status","dry-run","installed","repos","skills","logs","all","tools","local","lsp","api","list","schema","tools-context"]),x=new Set(["output","responseCharLength","responseCharOffset","tool","queries"]);function h(e,o){return _.has(o)?!1:d.has(o)?!0:e.command==="tool"||typeof e.options.tool=="string"}function g(e=process.argv.slice(2)){let o={command:null,args:[],options:{}},t=0;for(;t<e.length;){let i=e[t];if(i.startsWith("--")){let[n,s]=i.slice(2).split("=");s!==void 0?o.options[n]=s:h(o,n)&&t+1<e.length&&!e[t+1].startsWith("-")?(o.options[n]=e[t+1],t++):o.options[n]=!0}else if(i.startsWith("-")&&!i.startsWith("--")&&i.length>2){let n=i.slice(1),[s,r]=n.split("=");if(x.has(s))r!==void 0?o.options[s]=r:h(o,s)&&t+1<e.length&&!e[t+1].startsWith("-")?(o.options[s]=e[t+1],t++):o.options[s]=!0;else{let l=n,a=l[l.length-1];if(l.length===1&&d.has(a)&&t+1<e.length&&!e[t+1].startsWith("-"))o.options[a]=e[t+1],t++;else for(let c of l)o.options[c]=!0}}else if(i.startsWith("-")&&i.length>1){let n=i.slice(1),s=n[n.length-1];if(n.length===1&&d.has(s)&&t+1<e.length&&!e[t+1].startsWith("-"))o.options[s]=e[t+1],t++;else for(let r of n)o.options[r]=!0}else o.command||typeof o.options.tool=="string"?o.args.push(i):o.command=i;t++}return!o.command&&typeof o.options.tool=="string"&&(o.command="tool",o.args=[o.options.tool,...o.args]),o}function C(e){return!!(e.options.help||e.options.h)}function w(e){return!!(e.options.version||e.options.v)}async function P(){return import("./chunks/commands-OCTZP2TO.js")}async function H(){return import("./chunks/command-help-specs-CQ3RBLP6.js")}async function p(){return import("./chunks/tool-command-HOSMVLNK.js")}async function u(){return import("./chunks/main-help-35HX2UDQ.js")}async function I(){return import("./chunks/help-XPXP46ZT.js")}function A(){console.log(),console.log(" Use octocode-cli --tool <toolName> --queries '<json-stringified-input>'."),console.log(` Example: octocode-cli --tool localSearchCode --queries '{"path":".","pattern":"runCLI"}'`),console.log()}function L(){console.log("octocode-cli v1.3.0")}async function y(e){let o=g(e);if(o.options["tools-context"]===!0){let{printToolsContext:n}=await p();return await n(),!0}if(C(o)){if(o.command==="tool"&&typeof o.options.tool=="string"&&typeof o.args[0]=="string"){let{showToolHelp:s}=await p();if(await s(o.args[0]))return!0}if(o.command==="tool"){let{showHelp:s}=await u();return s(),!0}if(o.command){let[{findStaticCommandHelp:s},{showCommandHelp:r}]=await Promise.all([H(),I()]),l=s(o.command);if(l)return r(l),!0;let[{findCommand:a},{showHelp:c}]=await Promise.all([P(),u()]),f=a(o.command);return f?(r(f),!0):(c(),!0)}let{showHelp:n}=await u();return n(),!0}if(w(o))return L(),!0;if(!o.command)return!1;if(o.command==="tool")return typeof o.options.tool!="string"?(A(),process.exitCode=1,!0):(await(await p()).executeToolCommand(o)||(process.exitCode=1),!0);let{findCommand:t}=await P(),i=t(o.command);return i?(await i.handler(o),!0):(console.log(),console.log(` Unknown command: ${o.command}`),console.log(" Run 'octocode-cli --help' to see available commands."),console.log(),process.exitCode=1,!0)}async function T(){let{showHelp:e}=await import("./chunks/main-help-35HX2UDQ.js");e()}async function O(){await y()||await T()}function S(){process.stdout.write("\x1B[?25h"),console.log(),console.log(m(" Goodbye! \u{1F44B}")),process.exit(0)}process.on("SIGINT",S);process.on("SIGTERM",S);O().catch(e=>{e?.name==="ExitPromptError"&&(console.log(),console.log(m(" Goodbye! \u{1F44B}")),process.exit(0)),console.error("Error:",e),process.exit(1)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octocode-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Interactive CLI installer for octocode-mcp - Configure MCP servers for Cursor, Claude Desktop, and more",
5
5
  "keywords": [
6
6
  "ai-coding",
package/skills/README.md CHANGED
@@ -1,84 +1,74 @@
1
1
  # OctoCode Skills
2
2
 
3
- Specialized AI agent skills extending OctoCode's capabilities.
3
+ Specialized AI agent skills extending OctoCode. 15 skills live under `skills/`.
4
4
 
5
5
  ---
6
6
 
7
- ## Quick Reference
8
-
9
- | Need | Skill | Triggers |
10
- |------|-------|----------|
11
- | Install & configure Octocode | **Install** | "Install octocode", "Set up octocode", "Configure MCP", "Get started" |
12
- | Code search & exploration | **Researcher** | "Find X", "Where is Y?", "Who calls Z?" |
13
- | Deep multi-phase research | **Research** | "Deep-dive auth E2E", "Compare X vs Y" |
14
- | Implementation planning | **Plan** | "Plan this refactor", "Plan this feature" |
15
- | Formal technical decisions | **RFC** | "Create RFC for X", "Design doc for Y" |
16
- | PR & local code review | **PR Reviewer** | "Review PR #123", "Review my changes" |
17
- | Code understanding & implementation | **Engineer** | "How does X work?", "Implement this", "Audit quality" |
18
- | Brutal code critique | **Roast** | "Roast my code", "Find antipatterns" |
19
- | Prompt hardening | **Prompt Optimizer** | "Optimize this SKILL.md", "Agent skips steps" |
20
- | Design system & UI architecture | **Design** | "Generate DESIGN.md", "Design system for this app", "Design review" |
21
- | Repo documentation | **Doc Writer** | "Document this project", "Create dev docs" |
7
+ ## Skill Lookup
8
+
9
+ | Skill | Directory | Use For |
10
+ |-------|-----------|---------|
11
+ | **Install** | `octocode-install/` | Set up OctoCode, auth, IDE MCP, and skills. |
12
+ | **CLI** | `octocode-cli/` | Run Octocode tools from the shell. |
13
+ | **Researcher** | `octocode-researcher/` | Fast code search, symbol lookup, and file discovery. |
14
+ | **Research** | `octocode-research/` | Multi-phase investigations with checkpoints. |
15
+ | **Brainstorming** | `octocode-brainstorming/` | Validate ideas with prior art and market evidence. |
16
+ | **Plan** | `octocode-plan/` | Build evidence-backed implementation plans. |
17
+ | **RFC Generator** | `octocode-rfc-generator/` | Compare approaches and write technical proposals. |
18
+ | **Engineer** | `octocode-engineer/` | Understand, implement, refactor, and audit code. |
19
+ | **PR Reviewer** | `octocode-pull-request-reviewer/` | Review PRs or local diffs for defects and risk. |
20
+ | **Roast** | `octocode-roast/` | Brutal but actionable code-quality critique. |
21
+ | **Prompt Optimizer** | `octocode-prompt-optimizer/` | Harden prompts, skills, and agent instructions. |
22
+ | **Design** | `octocode-design/` | Generate design-system and UI architecture guidance. |
23
+ | **Doc Writer** | `octocode-documentation-writer/` | Produce comprehensive project documentation. |
24
+ | **News** | `octocode-news/` | Research recent AI, DevTools, web, and security updates. |
25
+ | **Search Skill** | `octocode-search-skill/` | Find, preview, and download agent skills. |
22
26
 
23
27
  ---
24
28
 
25
- ## Skills
29
+ ## Skill Details
26
30
 
27
- ### 1. Install
28
- `octocode-install/`
31
+ ### Install
32
+ Guided setup for OctoCode CLI/MCP, authentication, IDE config, and skill installation.
29
33
 
30
- Step-by-step setup for macOS and Windows: install via `npx octocode-cli`, choose an auth method (GitHub OAuth, PAT, GitLab, Bitbucket), configure your IDE, and install skills. Includes efficient skill usage guide.
34
+ ### CLI
35
+ Terminal workflow for Octocode tools, including code search, file reads, repo search, PR search, and package lookup.
31
36
 
32
- ### 2. Researcher
33
- `octocode-researcher/`
37
+ ### Researcher
38
+ Default targeted research skill for local/GitHub code exploration, LSP navigation, callers, references, and package research.
34
39
 
35
- Default research skill. Direct code exploration via Octocode MCP — local (LSP, search, structure) and external (GitHub, npm/PyPI, PRs). No server needed.
40
+ ### Research
41
+ Stateful deep research flow for broad, multi-step questions that need phases, checkpoints, and evidence synthesis.
36
42
 
37
- ### 3. Research (HTTP Server)
38
- `octocode-research/`
43
+ ### Brainstorming
44
+ Evidence-first idea validation across GitHub, package ecosystems, and web sources; outputs a decision brief.
39
45
 
40
- Multi-phase research with session management and checkpoints. Phases: Init > Context > Fast-path > Plan > Research > Output. Use when research spans multiple domains and needs state persistence.
46
+ ### Plan
47
+ Turns researched context into concrete implementation steps, risks, tests, and execution order.
41
48
 
42
- ### 4. Plan
43
- `octocode-plan/`
49
+ ### RFC Generator
50
+ Creates technical decision docs with alternatives, trade-offs, recommendation, and rollout plan.
44
51
 
45
- Evidence-based implementation planning. Understand > Research (delegates to Researcher/Research) > Plan > Implement. For multi-step work needing actionable steps.
52
+ ### Engineer
53
+ Architecture-aware engineering skill for exploration, coding, analysis, audits, refactors, and quality checks.
46
54
 
47
- ### 5. RFC Generator
48
- `octocode-rfc-generator/`
55
+ ### PR Reviewer
56
+ Holistic review of remote PRs or local changes, focused on bugs, security, architecture, flow impact, and tests.
49
57
 
50
- Formal evaluation of technical decisions. Research > Draft RFC with alternatives > Validate > Implementation plan. Use when multiple approaches are viable and trade-offs matter.
58
+ ### Roast
59
+ Entertaining severity-ranked critique with concrete fixes for code smells, antipatterns, and maintainability issues.
51
60
 
52
- ### 6. Engineer
53
- `octocode-engineer/`
61
+ ### Prompt Optimizer
62
+ Improves long prompts and agent instructions with gates, failure-mode controls, and enforceable protocols.
54
63
 
55
- Full-stack code engineering — understand, write, analyze, audit. Combines CLI scanner (dependency graph + AST + 16 structural presets via `@ast-grep/napi`), and Octocode MCP local/LSP tools. Four modes: **Explore**, **Code**, **Analyze**, **Audit**. Enforces architecture-first thinking, TDD, no duplication, dual-layer verification (agentic + deterministic).
64
+ ### Design
65
+ Builds practical UI/design-system guidance for visual language, components, accessibility, performance, and responsiveness.
56
66
 
57
- ### 7. PR & Code Reviewer
58
- `octocode-pull-request-reviewer/`
67
+ ### Doc Writer
68
+ Documentation pipeline for onboarding, architecture, APIs, workflows, and validated developer docs.
59
69
 
60
- Holistic code review: bugs, security, architecture, flow impact. Supports remote PRs and local changes (staged/unstaged). 7 domains, LSP-powered flow tracing, evidence-backed.
70
+ ### News
71
+ Scans recent AI, developer tooling, web platform, security, and notable-repo updates into a concise report.
61
72
 
62
- > Local mode requires `ENABLE_LOCAL=true` — see [README](https://github.com/bgauryy/octocode-mcp/blob/main/skills/octocode-pull-request-reviewer/README.md)
63
-
64
- ### 8. Roast
65
- `octocode-roast/`
66
-
67
- Brutal code critique with `file:line` citations. Severity levels: gentle > nuclear. Sin registry, user picks fixes.
68
-
69
- ### 9. Prompt Optimizer
70
- `octocode-prompt-optimizer/`
71
-
72
- Turns weak prompts into enforceable protocols. Gates, FORBIDDEN lists, failure analysis. Preserves intent, adds reliability. Not for short prompts (<50 lines) or already-optimized docs.
73
-
74
- ### 10. Design
75
- `octocode-design/`
76
-
77
- Dynamic design-system and UI architecture skill for client apps. Generates `DESIGN.md` using Octocode MCP local tools first, then adapts depth by project maturity (existing vs new). Covers visual language, styling strategy, component architecture, framework constraints, accessibility, performance, responsive behavior, SEO, and implementation mapping.
78
-
79
- > See [README](https://github.com/bgauryy/octocode-mcp/blob/main/skills/octocode-design/README.md)
80
-
81
- ### 11. Documentation Writer
82
- `octocode-documentation-writer/`
83
-
84
- 6-phase pipeline: Discovery > Questions > Research > Orchestration > Writing > QA. Produces 16+ validated docs.
73
+ ### Search Skill
74
+ Searches GitHub for `SKILL.md` files, scores relevance, previews results, and downloads selected skill folders.
@@ -0,0 +1,11 @@
1
+ # Environment variables for octocode-brainstorming
2
+ #
3
+ # Copy this file to .env in the same directory and fill in real values:
4
+ # cp .env.example .env
5
+ #
6
+ # Do NOT commit .env — it is gitignored.
7
+ # The skill detects Tavily availability by running: node scripts/tavily-search.mjs --check
8
+
9
+ # Tavily API key — enables AI-powered web research.
10
+ # Get a key at https://app.tavily.com/
11
+ TAVILY_API_KEY=tvly-REPLACE_ME