octocode-mcp 11.1.0 → 11.1.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.
- package/dist/index.js +1 -1
- package/dist/public.js +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ t.exports=ch()})),uh=F((e=>{var t=lh(),n=ve(`path`).extname,r=/^\s*([^;\s]*)(?:;
|
|
|
62
62
|
`+e.map(Dv).join(`
|
|
63
63
|
`):` `+Dv(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var Av={getAdapter:kv,adapters:Ev};function jv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new r_(null,e)}function Mv(e){return jv(e),e.headers=$g.from(e.headers),e.data=e_.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Av.getAdapter(e.adapter||Vg.adapter,e)(e).then(function(t){return jv(e),t.data=e_.call(e,e.transformResponse,t),t.headers=$g.from(t.headers),t},function(t){return t_(t)||(jv(e),t&&t.response&&(t.response.data=e_.call(e,e.transformResponse,t.response),t.response.headers=$g.from(t.response.headers))),Promise.reject(t)})}const Nv={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Nv[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});const Pv={};Nv.transitional=function(e,t,n){function r(e,t){return`[Axios v`+v_+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new ah(r(i,` has been removed`+(t?` in `+t:``)),ah.ERR_DEPRECATED);return t&&!Pv[i]&&(Pv[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},Nv.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Fv(e,t,n){if(typeof e!=`object`)throw new ah(`options must be an object`,ah.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=t[a];if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new ah(`option `+a+` must be `+n,ah.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ah(`Unknown option `+a,ah.ERR_BAD_OPTION)}}var Iv={assertOptions:Fv,validators:Nv};const Lv=Iv.validators;var Rv=class{constructor(e){this.defaults=e||{},this.interceptors={request:new xg,response:new xg}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,``):``;try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,``))&&(e.stack+=`
|
|
64
64
|
`+n):e.stack=n}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=lv(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Iv.assertOptions(n,{silentJSONParsing:Lv.transitional(Lv.boolean),forcedJSONParsing:Lv.transitional(Lv.boolean),clarifyTimeoutError:Lv.transitional(Lv.boolean)},!1),r!=null&&(K.isFunction(r)?t.paramsSerializer={serialize:r}:Iv.assertOptions(r,{encode:Lv.function,serialize:Lv.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Iv.assertOptions(t,{baseUrl:Lv.spelling(`baseURL`),withXsrfToken:Lv.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&K.merge(i.common,i[t.method]);i&&K.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=$g.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){typeof e.runWhen==`function`&&e.runWhen(t)===!1||(s&&=e.synchronous,o.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Mv.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=Mv.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=lv(this.defaults,e),bg(s_(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};K.forEach([`delete`,`get`,`head`,`options`],function(e){Rv.prototype[e]=function(t,n){return this.request(lv(n||{},{method:e,url:t,data:(n||{}).data}))}}),K.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(lv(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}Rv.prototype[e]=t(),Rv.prototype[e+`Form`]=t(!0)});var zv=Rv,Bv=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new r_(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Vv(e){return function(t){return e.apply(null,t)}}function Hv(e){return K.isObject(e)&&e.isAxiosError===!0}const Uv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Uv).forEach(([e,t])=>{Uv[t]=e});var Wv=Uv;function Gv(e){let t=new zv(e),n=Xp(zv.prototype.request,t);return K.extend(n,zv.prototype,t,{allOwnKeys:!0}),K.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Gv(lv(e,t))},n}const Kv=Gv(Vg);Kv.Axios=zv,Kv.CanceledError=r_,Kv.CancelToken=Bv,Kv.isCancel=t_,Kv.VERSION=v_,Kv.toFormData=mg,Kv.AxiosError=ah,Kv.Cancel=Kv.CanceledError,Kv.all=function(e){return Promise.all(e)},Kv.spread=Vv,Kv.isAxiosError=Hv,Kv.mergeConfig=lv,Kv.AxiosHeaders=$g,Kv.formToJSON=e=>Rg(K.isHTMLForm(e)?new FormData(e):e),Kv.getAdapter=Av.getAdapter,Kv.HttpStatusCode=Wv,Kv.default=Kv;var qv=Kv;function Jv(e,t,n={}){let{timeout:r=3e4,cwd:i,env:a={},maxOutputSize:o,removeEnvVars:s=[`NODE_OPTIONS`]}=n;return new Promise(n=>{let c={killed:!1,stdout:``,stderr:``,totalOutputSize:0},l={...process.env,...a};for(let e of s)l[e]=void 0;let u={cwd:i,env:l,stdio:[`ignore`,`pipe`,`pipe`],timeout:r},d;try{d=C(e,t,u)}catch(t){n({stdout:``,stderr:``,exitCode:null,success:!1,error:t instanceof Error?t:Error(`Failed to spawn command '${e}'`)});return}let f=setTimeout(()=>{c.killed||(c.killed=!0,d.kill(`SIGTERM`),n({stdout:c.stdout,stderr:c.stderr,exitCode:null,success:!1,error:Error(`Command timeout after ${r}ms`),timedOut:!0}))},r),p=()=>o&&c.totalOutputSize>o?(c.killed||(c.killed=!0,d.kill(`SIGKILL`),clearTimeout(f),n({stdout:c.stdout,stderr:c.stderr,exitCode:null,success:!1,error:Error(`Output size limit exceeded`),outputLimitExceeded:!0})),!0):!1;d.stdout?.on(`data`,e=>{if(c.killed)return;let t=e.toString();c.totalOutputSize+=Buffer.byteLength(t),!p()&&(c.stdout+=t)}),d.stderr?.on(`data`,e=>{if(c.killed)return;let t=e.toString();c.totalOutputSize+=Buffer.byteLength(t),!p()&&(c.stderr+=t)}),d.on(`close`,e=>{c.killed||(clearTimeout(f),n({stdout:c.stdout,stderr:c.stderr,exitCode:e,success:e===0}))}),d.on(`error`,e=>{c.killed||(c.killed=!0,clearTimeout(f),n({stdout:c.stdout,stderr:c.stderr,exitCode:null,success:!1,error:e}))})})}function Yv(e,t,n=1e4){return new Promise(r=>{let i=!1,a=C(e,t,{stdio:[`ignore`,`pipe`,`pipe`],timeout:n,env:{...process.env,NODE_OPTIONS:void 0}});a.on(`close`,e=>{i||r(e===0)}),a.on(`error`,()=>{i||r(!1)});let o=setTimeout(()=>{i||(i=!0,a.kill(`SIGTERM`),r(!1))},n);a.on(`close`,()=>{clearTimeout(o)})})}function Xv(e,t,n=1e4){return new Promise(r=>{let i=!1,a=``,o=C(e,t,{stdio:[`ignore`,`pipe`,`pipe`],timeout:n,env:{...process.env,NODE_OPTIONS:void 0}});o.stdout?.on(`data`,e=>{a+=e.toString()}),o.stderr?.on(`data`,()=>{}),o.on(`close`,e=>{i||r(e===0&&a.trim()||null)}),o.on(`error`,()=>{i||r(null)});let s=setTimeout(()=>{i||(i=!0,o.kill(`SIGTERM`),r(null))},n);o.on(`close`,()=>{clearTimeout(s)})})}function Zv(e,t=1e3){for(let n of e){if(n.includes(`\0`))return{valid:!1,error:`Null bytes not allowed in arguments`};if(n.length>t)return{valid:!1,error:`Argument too long`}}return{valid:!0}}function Qv(){return c(s(process.execPath),process.platform===`win32`?`npm.cmd`:`npm`)}async function $v(){return Xv(`gh`,[`auth`,`token`],1e4)}const ey=[`view`,`search`,`ping`,`config`,`whoami`];async function ty(e=1e4){return Yv(Qv(),[`--version`],e)}async function ny(e,t,n={}){if(!ey.includes(e))return{stdout:``,stderr:``,error:Error(`Command '${e}' is not allowed`)};let r=Zv(t);if(!r.valid)return{stdout:``,stderr:``,error:Error(`Invalid arguments: ${r.error}`)};let{timeout:i=3e4,cwd:a,env:o}=n,s=await Jv(Qv(),[e,...t],{timeout:i,cwd:a,env:o,removeEnvVars:[`NODE_OPTIONS`,`NPM_CONFIG_SCRIPT_SHELL`]});return{stdout:s.stdout,stderr:s.stderr,exitCode:s.exitCode??void 0,error:s.error}}const ry=[`rg`,`ls`,`find`],iy=[/[;&|`$(){}[\]<>]/,/\${/,/\$\(/],ay=[/\${/,/\$\(/,/`/,/;/];function oy(e,t){return ry.includes(e)?sy(e,t):{isValid:!1,error:`Command '${e}' is not allowed. Allowed commands: ${ry.join(`, `)}`}}function sy(e,t){let n=cy(e,t);for(let e=0;e<t.length;e++){let r=t[e],i=n.has(e),a=i?ay:iy;for(let e of a)if(e.test(r))return{isValid:!1,error:`Dangerous pattern detected in ${i?`search pattern`:`argument`}: '${r}'. This may be a command injection attempt.`}}return{isValid:!0}}function cy(e,t){let n=new Set;if(e===`rg`){let e=!1;for(let r=0;r<t.length;r++){let i=t[r];if(i.startsWith(`-`)){if([`-g`,`--glob`,`--include`,`--exclude`,`--exclude-dir`].includes(i)){r++,n.add(r);continue}[`-A`,`-B`,`-C`,`-m`,`-t`,`--type`,`-T`,`--type-not`,`-j`,`--threads`,`--sort`,`--sortr`,`--max-filesize`,`-E`,`--encoding`,`--color`].includes(i)&&r++;continue}e||=(n.add(r),!0)}}else if(e===`find`)for(let e=0;e<t.length;e++){let r=t[e],i=e>0?t[e-1]:``;[`-name`,`-iname`,`-path`,`-regex`,`-size`,`-perm`].includes(i)&&n.add(e),(r===`(`||r===`)`||r===`-o`)&&n.add(e)}return n}function ly(e){return e?o.resolve(e):process.env.WORKSPACE_ROOT?o.resolve(process.env.WORKSPACE_ROOT):process.cwd()}function uy(e,t){let n=ly(t);if(e===void 0)return{isValid:!0};if(e.trim()===``)return{isValid:!1,error:`Execution context (cwd) cannot be empty`};let r=o.resolve(e);if(r!==n&&!r.startsWith(n+o.sep))return{isValid:!1,error:`Can only execute commands within workspace directory: ${n}. Attempted execution in: ${r}`};try{f.lstatSync(r);let e=f.realpathSync(r);if(e!==n&&!e.startsWith(n+o.sep))return{isValid:!1,error:`Symlink target '${e}' is outside workspace directory: ${n}`}}catch(e){return e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`?{isValid:!0,sanitizedPath:r}:{isValid:!1,error:`Cannot validate execution context: ${e instanceof Error?e.message:String(e)}`}}return{isValid:!0,sanitizedPath:r}}async function dy(e,t=[],n={}){let r=oy(e,t);if(!r.isValid)throw Error(`Command validation failed: ${r.error||`Command not allowed`}`);let i=uy(n.cwd,process.env.WORKSPACE_ROOT);if(!i.isValid)throw Error(`Execution context validation failed: ${i.error||`Invalid working directory`}`);let{timeout:a=3e4,cwd:o,env:s,maxOutputSize:c=10*1024*1024}=n,l=await Jv(e,t,{timeout:a,cwd:o,env:s,maxOutputSize:c,removeEnvVars:[`NODE_OPTIONS`]});if(l.error)throw l.error;return{success:l.success,code:l.exitCode,stdout:l.stdout,stderr:l.stderr}}const fy=new Map,py={rg:{name:`ripgrep`,versionFlag:`--version`,tool:`localSearchCode`},grep:{name:`grep`,versionFlag:`--version`,tool:`localSearchCode (fallback)`},find:{name:`find`,versionFlag:`--version`,tool:`localFindFiles`},ls:{name:`ls`,versionFlag:`--version`,tool:`localViewStructure`}};async function my(e,t=!1){if(!t&&fy.has(e))return fy.get(e);let n=py[e];try{let t;t=e===`find`&&process.platform===`darwin`?await Yv(`find`,[`.`,`-maxdepth`,`0`],5e3):e===`ls`?await Yv(`ls`,[`-la`,`.`],5e3):e===`grep`?await Yv(`grep`,[`--help`],5e3):await Yv(e,[n.versionFlag],5e3);let r={available:t,command:e,...t?{}:{error:`${n.name} (${e}) is not installed or not in PATH`}};return fy.set(e,r),r}catch(t){let n={available:!1,command:e,error:t instanceof Error?t.message:`Failed to check ${e} availability`};return fy.set(e,n),n}}function hy(e){return`${py[e].name} (${e}) is not available. ${{rg:`Install ripgrep: brew install ripgrep (macOS), apt install ripgrep (Ubuntu), or see https://github.com/BurntSushi/ripgrep#installation`,grep:`grep should be available on all Unix systems. Check your PATH configuration.`,find:`find should be available on all Unix systems. Check your PATH configuration.`,ls:`ls should be available on all Unix systems. Check your PATH configuration.`}[e]}`}N.platform(),N.platform(),N.platform();const gy=N.homedir();function _y(){return!0}async function vy(e,t,n){await new oe(e,t).setPassword(n)}async function yy(e,t){try{return await new oe(e,t).getPassword()??null}catch{return null}}const by=3e3;var xy=class extends Error{constructor(e){super(e),this.name=`TimeoutError`}};async function Sy(e,t){return Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(new xy(`Operation timed out after ${t}ms`)),t))])}let Cy=null;function wy(){return Cy===null&&(Cy=_y()),Cy}const Ty=`octocode-cli`,Ey=A(gy,`.octocode`),Dy=A(Ey,`credentials.json`),Oy=A(Ey,`.key`),ky=`aes-256-gcm`,Ay=[`OCTOCODE_TOKEN`,`GH_TOKEN`,`GITHUB_TOKEN`];function jy(){for(let e of Ay){let t=process.env[e];if(t&&t.trim())return t.trim()}return null}let My=null;function Ny(){return My===null&&(My=wy()),My}async function Py(e,t){if(!wy())throw Error(`Keychain not available`);await vy(Ty,e,JSON.stringify(t))}async function Fy(e){if(!wy())return null;try{let t=await yy(Ty,e);return t?JSON.parse(t):null}catch{return null}}function Iy(){if(zy(),w(Oy))return Buffer.from(E(Oy,`utf8`),`hex`);let e=re(32);return k(Oy,e.toString(`hex`),{mode:384}),e}function Ly(e){let t=Iy(),n=re(16),r=j(ky,t,n),i=r.update(e,`utf8`,`hex`);i+=r.final(`hex`);let a=r.getAuthTag();return`${n.toString(`hex`)}:${a.toString(`hex`)}:${i}`}function Ry(e){let t=Iy(),[n,r,i]=e.split(`:`);if(!n||!r||!i)throw Error(`Invalid encrypted data format`);let a=Buffer.from(n,`hex`),o=Buffer.from(r,`hex`),s=ee(ky,t,a);s.setAuthTag(o);let c=s.update(i,`hex`,`utf8`);return c+=s.final(`utf8`),c}function zy(){w(Ey)||T(Ey,{recursive:!0,mode:448})}function By(){if(zy(),!w(Dy))return{version:1,credentials:{}};try{let e=Ry(E(Dy,`utf8`));return JSON.parse(e)}catch(e){return console.error(`
|
|
65
|
-
⚠ Warning: Could not read credentials file. You may need to login again.`),console.error(` File: ${Dy}`),e instanceof Error&&e.message&&console.error(` Reason: ${e.message}\n`),{version:1,credentials:{}}}}function Vy(e){zy(),k(Dy,Ly(JSON.stringify(e,null,2)),{mode:384})}function Hy(e){try{let t=By();return t.credentials[e]?(delete t.credentials[e],Object.keys(t.credentials).length===0?Uy():Vy(t),!0):!1}catch(e){return console.warn(`[token-storage] Failed to remove from file storage: ${e instanceof Error?e.message:String(e)}`),!1}}function Uy(){try{w(Dy)&&O(Dy),w(Oy)&&O(Oy)}catch{}}async function Wy(e,t){try{await Sy(Py(e,t),by),Hy(e)}catch{}}function Gy(e){return e.toLowerCase().replace(/^https?:\/\//,``).replace(/\/$/,``)}async function Ky(e=`github.com`){let t=Gy(e);if(Ny())try{let e=await Sy(Fy(t),by);if(e)return e}catch(e){e instanceof xy||console.warn(`[token-storage] Keyring read failed: ${e instanceof Error?e.message:String(e)}`)}let n=By().credentials[t];return n?(Ny()&&Wy(t,n).catch(()=>{}),n):null}function qy(e){if(!e.token.expiresAt)return!1;let t=new Date(e.token.expiresAt);if(isNaN(t.getTime()))return!0;let n=new Date;return t.getTime()-n.getTime()<300*1e3}async function Jy(e=`github.com`){let t=await Ky(e);return!t||!t.token||qy(t)?null:t.token.token}const Yy=A(Ey,`session.json`);let Xy=null,Zy=!1,Qy=null,$y=!1,eb=null,tb=null,nb=null;function rb(){$y||($y=!0,eb=()=>{fb()},tb=()=>{fb()},nb=()=>{fb()},process.on(`exit`,eb),process.once(`SIGINT`,tb),process.once(`SIGTERM`,nb))}function ib(){Qy||(Qy=setInterval(()=>{Zy&&Xy&&(ab(Xy),Zy=!1)},6e4),Qy.unref())}function ab(e){zy();let t=`${Yy}.tmp`;k(t,JSON.stringify(e,null,2),{mode:384}),D(t,Yy)}function ob(){if(!w(Yy))return null;try{let e=E(Yy,`utf8`),t=JSON.parse(e);return t.version!==1||!t.sessionId||!t.createdAt?null:t}catch{return null}}function sb(){return{toolCalls:0,promptCalls:0,errors:0,rateLimits:0}}function cb(){let e=new Date().toISOString();return{version:1,sessionId:M(),createdAt:e,lastActiveAt:e,stats:sb()}}function lb(){if(Xy)return Xy;let e=ob();return e&&(Xy=e),e}function ub(e){Xy=e,Zy=!0,rb(),ib()}function db(){Zy&&Xy&&(ab(Xy),Zy=!1)}function fb(){if(Zy&&Xy)try{ab(Xy),Zy=!1}catch{}}function pb(e){if(e?.forceNew){let e=cb();return ub(e),db(),e}let t=lb();if(t){let e={...t,lastActiveAt:new Date().toISOString()};return ub(e),db(),e}let n=cb();return ub(n),db(),n}function mb(e){let t=lb();if(!t)return{success:!1,session:null};let n={toolCalls:t.stats.toolCalls+(e.toolCalls??0),promptCalls:t.stats.promptCalls+(e.promptCalls??0),errors:t.stats.errors+(e.errors??0),rateLimits:t.stats.rateLimits+(e.rateLimits??0)},r={...t,lastActiveAt:new Date().toISOString(),stats:n};return ub(r),{success:!0,session:r}}function hb(e=1){return mb({toolCalls:e})}function gb(e=1){return mb({promptCalls:e})}function _b(e=1){return mb({errors:e})}function vb(e=1){return mb({rateLimits:e})}var yb=`octocode-mcp`,bb=`11.1.0`;const xb=process.env.REDACT_ERROR_PATHS===`true`;function Sb(e,t){if(!xb)return e;if(t&&e.startsWith(t))return e.slice(t.length).replace(/^[/\\]/,``)||`.`;let n=b.homedir();return n&&e.startsWith(n)?`~`+e.slice(n.length):o.basename(e)}const Cb={NOT_INITIALIZED:{code:`CONFIG_NOT_INITIALIZED`,message:`Configuration not initialized. Call initialize() and await its completion before calling getServerConfig().`},NO_GITHUB_TOKEN:{code:`CONFIG_NO_GITHUB_TOKEN`,message:`No GitHub token found. Please authenticate with GitHub CLI (gh auth login) or set GITHUB_TOKEN/GH_TOKEN/OCTOCODE_TOKEN environment variable. After setting the token, restart the MCP server to apply changes.`}},wb={PROMISES_NOT_ARRAY:{code:`VALIDATION_PROMISES_NOT_ARRAY`,message:`promises must be an array`},TIMEOUT_NOT_POSITIVE:{code:`VALIDATION_TIMEOUT_NOT_POSITIVE`,message:`timeout must be positive`},CONCURRENCY_NOT_POSITIVE:{code:`VALIDATION_CONCURRENCY_NOT_POSITIVE`,message:`concurrency must be positive`},INVALID_PARAMETERS:{code:`VALIDATION_INVALID_PARAMETERS`,message:`Invalid parameters: must be an object`},INVALID_PARAMETER_KEY:{code:`VALIDATION_INVALID_PARAMETER_KEY`,message:e=>`Invalid parameter key: ${e}`},INVALID_NESTED_OBJECT:{code:`VALIDATION_INVALID_NESTED_OBJECT`,message:(e,t)=>`Invalid nested object in parameter ${e}: ${t}`}},Tb={FETCH_NOT_AVAILABLE:{code:`FETCH_NOT_AVAILABLE`,message:`Global fetch is not available in this environment.`},FETCH_FAILED_AFTER_RETRIES:{code:`FETCH_FAILED_AFTER_RETRIES`,message:(e,t)=>`Failed to fetch after ${e} attempts: ${t}`},FETCH_HTTP_ERROR:{code:`FETCH_HTTP_ERROR`,message:(e,t)=>`Failed to fetch (${e} ${t})`}},Eb={INVALID_FORMAT:{code:`TOOL_METADATA_INVALID_FORMAT`,message:`Invalid tool metadata format from remote source.`},INVALID_API_RESPONSE:{code:`TOOL_METADATA_INVALID_API_RESPONSE`,message:`Invalid API response structure`}},Db={PATH_IS_DIRECTORY:{code:`FILE_PATH_IS_DIRECTORY`,message:e=>`Path is a directory. Use ${e} to list directory contents`},FILE_TOO_LARGE:{code:`FILE_TOO_LARGE`,message:(e,t,n)=>`File too large (${e}KB > ${t}KB). Use ${n} to search within the file or use startLine/endLine parameters to get specific sections`},FILE_EMPTY:{code:`FILE_EMPTY`,message:`File is empty - no content to display`},BINARY_FILE:{code:`FILE_BINARY`,message:`Binary file detected. Cannot display as text - download directly from GitHub`},DECODE_FAILED:{code:`FILE_DECODE_FAILED`,message:`Failed to decode file. Encoding may not be supported (expected UTF-8)`},UNSUPPORTED_TYPE:{code:`FILE_UNSUPPORTED_TYPE`,message:e=>`Unsupported file type: ${e}`},MATCH_STRING_NOT_FOUND:{code:`FILE_MATCH_STRING_NOT_FOUND`,message:e=>`Match string "${e}" not found in file. The file may have changed since the search was performed.`}},Ob={NOT_FOUND:{code:`REPO_NOT_FOUND`,message:(e,t,n)=>`Repository "${e}/${t}" not found or not accessible: ${n}`},PATH_NOT_FOUND:{code:`REPO_PATH_NOT_FOUND`,message:(e,t,n,r)=>`Path "${e}" not found in repository "${t}/${n}" on branch "${r}"`},PATH_NOT_FOUND_ANY_BRANCH:{code:`REPO_PATH_NOT_FOUND_ANY_BRANCH`,message:(e,t,n)=>`Path "${e}" not found in repository "${t}/${n}" on any common branch`},ACCESS_FAILED:{code:`REPO_ACCESS_FAILED`,message:(e,t,n)=>`Failed to access repository "${e}/${t}": ${n}`},BRANCH_NOT_FOUND:{code:`REPO_BRANCH_NOT_FOUND`,message:e=>`Branch '${e}' not found. Ask user: Do you want to get the file from the default branch instead?`},STRUCTURE_EXPLORATION_FAILED:{code:`REPO_STRUCTURE_EXPLORATION_FAILED`,message:`Failed to explore repository structure`}},kb={QUERY_EMPTY:{code:`SEARCH_QUERY_EMPTY`,message:`Search query cannot be empty`},NO_VALID_PARAMETERS:{code:`SEARCH_NO_VALID_PARAMETERS`,message:`No valid search parameters provided`},PR_REQUIRED_PARAMS:{code:`SEARCH_PR_REQUIRED_PARAMS`,message:`Owner, repo, and prNumber are required parameters`},PR_SINGLE_VALUES:{code:`SEARCH_PR_SINGLE_VALUES`,message:`Owner and repo must be single values`},API_REQUEST_FAILED:{code:`SEARCH_API_REQUEST_FAILED`,message:e=>`API request failed: ${e}`},PULL_REQUEST_SEARCH_FAILED:{code:`SEARCH_PR_SEARCH_FAILED`,message:e=>`Pull request search failed: ${e}`},PULL_REQUEST_LIST_FAILED:{code:`SEARCH_PR_LIST_FAILED`,message:e=>`Pull request list failed: ${e}`},PULL_REQUEST_FETCH_FAILED:{code:`SEARCH_PR_FETCH_FAILED`,message:(e,t)=>`Failed to fetch pull request #${e}: ${t}`}},Ab={NO_TOOLS_REGISTERED:{code:`STARTUP_NO_TOOLS_REGISTERED`,message:`No tools were successfully registered`},UNCAUGHT_EXCEPTION:{code:`STARTUP_UNCAUGHT_EXCEPTION`,message:e=>`Uncaught exception: ${e}`},UNHANDLED_REJECTION:{code:`STARTUP_UNHANDLED_REJECTION`,message:e=>`Unhandled rejection: ${e}`},STARTUP_FAILED:{code:`STARTUP_FAILED`,message:e=>`Startup failed: ${e}`}},jb={TIMEOUT:{code:`PROMISE_TIMEOUT`,message:(e,t)=>`Promise ${e} timed out after ${t}ms`},NOT_A_FUNCTION:{code:`PROMISE_NOT_A_FUNCTION`,message:e=>`Promise function at index ${e} is not a function`},FUNCTION_UNDEFINED:{code:`PROMISE_FUNCTION_UNDEFINED`,message:`Promise function is undefined`}},Mb={EXECUTION_FAILED:{code:`TOOL_EXECUTION_FAILED`,message:(e,t)=>`Tool ${e} execution failed: ${t}`},SECURITY_VALIDATION_FAILED:{code:`TOOL_SECURITY_VALIDATION_FAILED`,message:(e,t)=>`Security validation failed for ${e}: ${t}`}};({...Cb,...wb,...Tb,...Eb,...Db,...Ob,...kb,...Ab,...jb,...Mb});const Nb={PATH_VALIDATION_FAILED:`pathValidationFailed`,FILE_ACCESS_FAILED:`fileAccessFailed`,FILE_READ_FAILED:`fileReadFailed`,FILE_TOO_LARGE:`fileTooLarge`,NO_MATCHES:`noMatches`,PATTERN_TOO_BROAD:`patternTooBroad`,PAGINATION_REQUIRED:`paginationRequired`,OUTPUT_TOO_LARGE:`outputTooLarge`,RESPONSE_TOO_LARGE:`responseTooLarge`,COMMAND_NOT_AVAILABLE:`commandNotAvailable`,COMMAND_EXECUTION_FAILED:`commandExecutionFailed`,COMMAND_TIMEOUT:`commandTimeout`,QUERY_EXECUTION_FAILED:`queryExecutionFailed`,TOOL_EXECUTION_FAILED:`toolExecutionFailed`};let Pb=function(e){return e.FILE_SYSTEM=`FILE_SYSTEM`,e.VALIDATION=`VALIDATION`,e.SEARCH=`SEARCH`,e.PAGINATION=`PAGINATION`,e.EXECUTION=`EXECUTION`,e}({});const Fb={[Nb.PATH_VALIDATION_FAILED]:{code:Nb.PATH_VALIDATION_FAILED,category:Pb.VALIDATION,description:`Path validation failed - invalid or unsafe path`,recoverability:`user-action-required`},[Nb.FILE_ACCESS_FAILED]:{code:Nb.FILE_ACCESS_FAILED,category:Pb.FILE_SYSTEM,description:`Cannot access file - may not exist or lack permissions`,recoverability:`unrecoverable`},[Nb.FILE_READ_FAILED]:{code:Nb.FILE_READ_FAILED,category:Pb.FILE_SYSTEM,description:`Failed to read file contents`,recoverability:`unrecoverable`},[Nb.FILE_TOO_LARGE]:{code:Nb.FILE_TOO_LARGE,category:Pb.FILE_SYSTEM,description:`File exceeds size limits for operation`,recoverability:`user-action-required`},[Nb.NO_MATCHES]:{code:Nb.NO_MATCHES,category:Pb.SEARCH,description:`Search pattern found no matches`,recoverability:`user-action-required`},[Nb.PATTERN_TOO_BROAD]:{code:Nb.PATTERN_TOO_BROAD,category:Pb.SEARCH,description:`Search pattern is too broad and would return too many results`,recoverability:`user-action-required`},[Nb.PAGINATION_REQUIRED]:{code:Nb.PAGINATION_REQUIRED,category:Pb.PAGINATION,description:`Result set too large - pagination required`,recoverability:`user-action-required`},[Nb.OUTPUT_TOO_LARGE]:{code:Nb.OUTPUT_TOO_LARGE,category:Pb.PAGINATION,description:`Output exceeds size limits`,recoverability:`user-action-required`},[Nb.RESPONSE_TOO_LARGE]:{code:Nb.RESPONSE_TOO_LARGE,category:Pb.PAGINATION,description:`Response exceeds maximum allowed size`,recoverability:`user-action-required`},[Nb.COMMAND_NOT_AVAILABLE]:{code:Nb.COMMAND_NOT_AVAILABLE,category:Pb.EXECUTION,description:`Required CLI command is not installed or not in PATH`,recoverability:`user-action-required`},[Nb.COMMAND_EXECUTION_FAILED]:{code:Nb.COMMAND_EXECUTION_FAILED,category:Pb.EXECUTION,description:`System command execution failed`,recoverability:`unrecoverable`},[Nb.COMMAND_TIMEOUT]:{code:Nb.COMMAND_TIMEOUT,category:Pb.EXECUTION,description:`Command execution timed out`,recoverability:`user-action-required`},[Nb.QUERY_EXECUTION_FAILED]:{code:Nb.QUERY_EXECUTION_FAILED,category:Pb.EXECUTION,description:`Query execution failed`,recoverability:`unrecoverable`},[Nb.TOOL_EXECUTION_FAILED]:{code:Nb.TOOL_EXECUTION_FAILED,category:Pb.EXECUTION,description:`Generic tool execution failure`,recoverability:`unrecoverable`}};var Ib=class e extends Error{errorCode;category;recoverability;context;constructor(t,n,r,i){let a=Fb[t],o=n||a.description;super(o,i?{cause:i}:void 0),this.name=`ToolError`,this.errorCode=t,this.category=a.category,this.recoverability=a.recoverability,this.context=r,i&&i.stack&&(this.stack=`${this.stack}\nCaused by: ${i.stack}`),Object.setPrototypeOf(this,e.prototype)}isRecoverable(){return this.recoverability===`recoverable`}requiresUserAction(){return this.recoverability===`user-action-required`}toJSON(){return{name:this.name,errorCode:this.errorCode,category:this.category,message:this.message,recoverability:this.recoverability,context:this.context,stack:this.stack}}};function Lb(e){return e instanceof Ib}function Rb(e,t=Nb.TOOL_EXECUTION_FAILED,n){return Lb(e)?e:e instanceof Error?new Ib(t,e.message,n,e):new Ib(t,String(e),n)}const zb={pathValidationFailed:(e,t,n)=>new Ib(Nb.PATH_VALIDATION_FAILED,t||`Path validation failed: ${Sb(e,n)}`,{path:e}),fileAccessFailed:(e,t,n)=>{let r=Sb(e,n),i=`Cannot access file: ${r}`,a=t?.code;return a===`ENOENT`?i=`File not found: ${r}. Verify the path exists using localFindFiles.`:a===`EACCES`?i=`Permission denied: ${r}. Check file permissions.`:a===`EISDIR`?i=`Path is a directory: ${r}. Use localViewStructure instead.`:a===`ENOTDIR`?i=`Invalid path: ${r}. A component of the path is not a directory.`:a===`ENAMETOOLONG`&&(i=`Path too long: ${r}`),new Ib(Nb.FILE_ACCESS_FAILED,i,{path:e,errorCode:a},t)},fileReadFailed:(e,t,n)=>new Ib(Nb.FILE_READ_FAILED,`Failed to read file: ${Sb(e,n)}`,{path:e},t),fileTooLarge:(e,t,n)=>new Ib(Nb.FILE_TOO_LARGE,(()=>{let e=e=>Number.isInteger(e)?`${e}KB`:`${e.toFixed(1)}KB`;return`File too large: ${e(t)} (limit: ${e(n)})`})(),{path:e,sizeKB:t,limitKB:n}),noMatches:(e,t)=>new Ib(Nb.NO_MATCHES,`No matches found for pattern: ${e}`,{pattern:e,...t}),patternTooBroad:(e,t)=>new Ib(Nb.PATTERN_TOO_BROAD,`Pattern too broad: ${t} matches found`,{pattern:e,matchCount:t}),paginationRequired:e=>new Ib(Nb.PAGINATION_REQUIRED,`Pagination required: ${e} characters`,{itemCount:e}),outputTooLarge:(e,t)=>new Ib(Nb.OUTPUT_TOO_LARGE,`Output too large: ${e} (limit: ${t})`,{size:e,limit:t}),responseTooLarge:(e,t)=>new Ib(Nb.RESPONSE_TOO_LARGE,`Response too large: ${e} tokens (limit: ${t})`,{tokens:e,limit:t}),commandNotAvailable:(e,t)=>new Ib(Nb.COMMAND_NOT_AVAILABLE,`Command '${e}' is not available. ${t||`Please install it and ensure it is in your PATH.`}`,{command:e,installHint:t}),commandExecutionFailed:(e,t,n)=>new Ib(Nb.COMMAND_EXECUTION_FAILED,n?`Command '${e}' failed: ${n}`:`Command execution failed: ${e}`,{command:e,stderr:n},t),commandTimeout:(e,t)=>new Ib(Nb.COMMAND_TIMEOUT,`Command '${e}' timed out after ${t}ms. Try a narrower search path or add filters.`,{command:e,timeoutMs:t}),queryExecutionFailed:(e,t)=>new Ib(Nb.QUERY_EXECUTION_FAILED,`Query execution failed`,{queryId:e},t),toolExecutionFailed:(e,t)=>new Ib(Nb.TOOL_EXECUTION_FAILED,`Tool execution failed: ${e}`,{toolName:e},t)};zb.commandNotAvailable,zb.commandExecutionFailed,zb.commandTimeout,zb.queryExecutionFailed,zb.toolExecutionFailed;const Bb=[{name:`openaiApiKey`,description:`OpenAI API key`,regex:/\b(sk-[a-zA-Z0-9_-]+T3BlbkFJ[a-zA-Z0-9_-]+)\b/g,matchAccuracy:`high`},{name:`openaiOrgId`,description:`OpenAI organization ID`,regex:/\borg-[a-zA-Z0-9]{20,}\b/g,matchAccuracy:`high`},{name:`groqApiKey`,description:`Groq API key`,regex:/\bgsk_[a-zA-Z0-9-_]{51,52}\b/g,matchAccuracy:`high`},{name:`cohereApiKey`,description:`Cohere API key`,regex:/\bco-[a-zA-Z0-9-_]{38,64}\b/g,matchAccuracy:`high`},{name:`huggingFaceToken`,description:`Hugging Face API token`,regex:/\bhf_[a-zA-Z0-9]{34}\b/g,matchAccuracy:`high`},{name:`perplexityApiKey`,description:`Perplexity AI API key`,regex:/\bpplx-[a-zA-Z0-9]{30,64}\b/g,matchAccuracy:`high`},{name:`replicateApiToken`,description:`Replicate API token`,regex:/\br8_[a-zA-Z0-9]{30,}\b/g,matchAccuracy:`high`},{name:`anthropicApiKey`,description:`Anthropic API key`,regex:/\b(sk-ant-(?:admin01|api03)-[\w-]{93}AA)\b/g,matchAccuracy:`high`},{name:`mistralApiKey`,description:`Mistral AI API key`,regex:/\b(?:mistral-|mist_)[a-zA-Z0-9]{32,}\b/g,matchAccuracy:`high`},{name:`tavilyApiKey`,description:`Tavily API key`,regex:/\btvly-[a-zA-Z0-9]{30,}\b/g,matchAccuracy:`high`},{name:`deepseekApiKey`,description:`DeepSeek API key`,regex:/\bsk-[a-zA-Z0-9]{32,64}\b/g,matchAccuracy:`medium`},{name:`togetherApiKey`,description:`Together AI API key`,regex:/\b['"]?(?:TOGETHER|together)_?(?:API|api)?_?(?:KEY|key)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{40,64}['"]?\b/g,matchAccuracy:`medium`},{name:`fireworksApiKey`,description:`Fireworks AI API key`,regex:/\b['"]?(?:FIREWORKS|fireworks)_?(?:API|api)?_?(?:KEY|key)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{40,64}['"]?\b/g,matchAccuracy:`medium`},{name:`xaiApiKey`,description:`xAI (Grok) API key`,regex:/\bxai-[a-zA-Z0-9]{48,}\b/g,matchAccuracy:`high`},{name:`openRouterApiKey`,description:`OpenRouter API key`,regex:/\bsk-or-v1-[a-zA-Z0-9]{64}\b/g,matchAccuracy:`high`},{name:`amazonBedrockApiKey`,description:`Amazon Bedrock API key`,regex:/\bABSK[A-Za-z0-9+/]{109,269}={0,2}\b/g,matchAccuracy:`high`},{name:`ai21ApiKey`,description:`AI21 Labs API key`,regex:/\b['"]?(?:AI21|ai21)_?(?:API|api)?_?(?:KEY|key)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{40,64}['"]?\b/g,matchAccuracy:`medium`},{name:`stabilityApiKey`,description:`Stability AI API key`,regex:/\bsk-[a-zA-Z0-9]{48,}\b/g,matchAccuracy:`medium`},{name:`voyageApiKey`,description:`Voyage AI API key`,regex:/\bpa-[a-zA-Z0-9]{40,}\b/g,matchAccuracy:`high`}],Vb=[{name:`awsAccessKeyId`,description:`AWS access key ID`,regex:/\b((?:AKIA|ABIA|ACCA)[A-Z0-9]{16})\b/g,matchAccuracy:`high`},{name:`awsAccountId`,description:`AWS account ID`,regex:/\b['"]?(?:AWS|aws|Aws)?_?(?:ACCOUNT|account|Account)_?(?:ID|id|Id)?['"]?\s*(?::|=>|=)\s*['"]?[0-9]{12}['"]?\b/g,matchAccuracy:`high`},{name:`awsAppSyncApiKey`,description:`AWS AppSync GraphQL API key`,regex:/\bda2-[a-z0-9]{26}\b/g,matchAccuracy:`high`},{name:`awsIamRoleArn`,description:`AWS IAM role ARN`,regex:/\barn:aws:iam::[0-9]{12}:role\/[a-zA-Z0-9_+=,.@-]+\b/g,matchAccuracy:`high`},{name:`awsLambdaFunctionArn`,description:`AWS Lambda function ARN`,regex:/\barn:aws:lambda:[a-z0-9-]+:[0-9]{12}:function:[a-zA-Z0-9_-]+\b/g,matchAccuracy:`high`},{name:`awsMwsAuthToken`,description:`AWS MWS authentication token`,regex:/\bamzn\.mws\.[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/g,matchAccuracy:`high`},{name:`awsS3BucketArn`,description:`AWS S3 bucket ARN`,regex:/\barn:aws:s3:::[a-zA-Z0-9._-]+\b/g,matchAccuracy:`high`},{name:`alibabaAccessKeyId`,description:`Alibaba Cloud AccessKey ID`,regex:/\bLTAI[a-zA-Z0-9]{20}\b/g,matchAccuracy:`high`},{name:`awsSecretAccessKey`,description:`AWS secret access key`,regex:/\b['"]?(?:AWS|aws|Aws)?_?(?:SECRET|secret|Secret)_?(?:ACCESS|access|Access)_?(?:KEY|key|Key)['"]?\s*(?::|=>|=)\s*['"]?[A-Za-z0-9/+=]{40}['"]?\b/g,matchAccuracy:`high`},{name:`awsSessionToken`,description:`AWS session token`,regex:/\b['"]?(?:AWS|aws|Aws)?_?(?:SESSION|session|Session)_?(?:TOKEN|token|Token)['"]?\s*(?::|=>|=)\s*['"]?[A-Za-z0-9/+=]{200,}['"]?\b/g,matchAccuracy:`high`},{name:`awsSecretsManagerArn`,description:`AWS Secrets Manager secret ARN`,regex:/\barn:aws:secretsmanager:[a-z0-9-]+:[0-9]{12}:secret:[a-zA-Z0-9/_+=.@-]+\b/g,matchAccuracy:`high`}],Hb=[{name:`vercelToken`,description:`Vercel API token`,regex:/\bvercel_[a-zA-Z0-9]{24}\b/g},{name:`posthogApiKey`,description:`PostHog API key`,regex:/\bphc_[a-zA-Z0-9_-]{39}\b/g,matchAccuracy:`high`},{name:`posthogPersonalApiKey`,description:`PostHog personal API key`,regex:/\bphx_[a-zA-Z0-9_-]{39}\b/g,matchAccuracy:`high`},{name:`datadogApiKey`,description:`Datadog API and application keys (with context)`,regex:/\bdatadog[\s\w]*(?:api|app)[\s\w]*key[\s:=]*["']?[a-fA-F0-9]{32,40}["']?/gi,matchAccuracy:`medium`},{name:`honeycombApiKey`,description:`Honeycomb API key`,regex:/\bhcaik_[a-zA-Z0-9_-]{32,64}\b/g,matchAccuracy:`high`}],Ub=[{name:`jwtToken`,description:`JWT (JSON Web Token - 3-part)`,regex:/\b(ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9/_-]{17,}\.(?:[a-zA-Z0-9/_-]{10,}={0,2})?)\b/g,matchAccuracy:`high`},{name:`sessionIds`,description:`Session IDs / Cookies`,regex:/(?:JSESSIONID|PHPSESSID|ASP\.NET_SessionId|connect\.sid|session_id)=([a-zA-Z0-9%:._-]+)/gi,matchAccuracy:`high`},{name:`googleOauthToken`,description:`Google OAuth token`,regex:/\bya29\.[a-zA-Z0-9_-]+\b/g,matchAccuracy:`high`},{name:`onePasswordSecretKey`,description:`1Password secret key`,regex:/\bA3-[A-Z0-9]{6}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}\b/g,matchAccuracy:`high`},{name:`onePasswordServiceAccountToken`,description:`1Password service account token`,regex:/\bops_eyJ[a-zA-Z0-9+/]+={0,2}\b/g,matchAccuracy:`high`},{name:`jsonWebTokenEnhanced`,description:`JSON Web Token with enhanced detection`,regex:/\bey[a-zA-Z0-9]+\.ey[a-zA-Z0-9/_-]+\.(?:[a-zA-Z0-9/_-]+={0,2})?\b/g,matchAccuracy:`high`},{name:`authressServiceClientAccessKey`,description:`Authress service client access key`,regex:/\b(?:sc|ext|scauth|authress)_[a-z0-9]+\.[a-z0-9]+\.acc[_-][a-z0-9-]+\.[a-z0-9+/_=-]+\b/gi,matchAccuracy:`high`}],Wb=[{name:`googleApiKey`,description:`Google API key`,regex:/\bAIza[a-zA-Z0-9_-]{30,}\b/g,matchAccuracy:`high`},{name:`googleAiApiKey`,description:`Google AI API key`,regex:/\bAIza[0-9A-Za-z_-]{30,}\b/g,matchAccuracy:`high`},{name:`googleOAuth2ClientId`,description:`Google OAuth2 client ID`,regex:/\b[0-9]+-[a-z0-9]+\.apps\.googleusercontent\.com\b/g,matchAccuracy:`high`},{name:`googleOAuthClientSecret`,description:`Google OAuth client secret`,regex:/\b"client_secret":\s*"[a-zA-Z0-9-_]{24}"\b/g,matchAccuracy:`high`},{name:`gcpServiceAccountEmail`,description:`GCP service account email`,regex:/\b[a-z0-9-]+@[a-z0-9-]+\.iam\.gserviceaccount\.com\b/g,matchAccuracy:`high`},{name:`azureStorageConnectionString`,description:`Azure storage account connection string`,regex:/\bDefaultEndpointsProtocol=https?;AccountName=[a-z0-9]+;AccountKey=[a-zA-Z0-9+/]+={0,2};EndpointSuffix=core\.windows\.net\b/g,matchAccuracy:`high`},{name:`azureSubscriptionId`,description:`Azure subscription ID`,regex:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.onmicrosoft\.com\b/g,matchAccuracy:`high`},{name:`azureCosmosDbConnectionString`,description:`Azure Cosmos DB connection string`,regex:/\bAccountEndpoint=https:\/\/[a-z0-9-]+\.documents\.azure\.com:443\/;AccountKey=[a-zA-Z0-9+/]+={0,2}\b/g,matchAccuracy:`high`},{name:`azureServiceBusConnectionString`,description:`Azure Service Bus connection string`,regex:/\bEndpoint=sb:\/\/[a-z0-9-]+\.servicebus\.windows\.net\/;SharedAccessKeyName=[a-zA-Z0-9]+;SharedAccessKey=[a-zA-Z0-9+/]+={0,2}\b/g,matchAccuracy:`high`},{name:`dropboxAccessToken`,description:`Dropbox access token`,regex:/\bsl\.[a-zA-Z0-9_-]{64}\b/g,matchAccuracy:`high`},{name:`dropboxAppKey`,description:`Dropbox app key`,regex:/\b[a-z0-9]{15}\.(?:app|apps)\.dropbox\.com\b/g,matchAccuracy:`high`},{name:`supabaseServiceKey`,description:`Supabase service role key`,regex:/\bsbp_[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`planetScaleConnectionString`,description:`PlanetScale connection string`,regex:/\bmysql:\/\/[a-zA-Z0-9_-]+:[a-zA-Z0-9_=-]+@[a-z0-9.-]+\.psdb\.cloud\/[a-zA-Z0-9_-]+\?sslaccept=strict\b/g,matchAccuracy:`high`},{name:`planetScaleToken`,description:`PlanetScale API token`,regex:/\bpscale_tkn_[a-zA-Z0-9_-]{38,43}\b/g,matchAccuracy:`high`},{name:`sendgridApiKey`,description:`SendGrid API key`,regex:/\bSG\.[A-Za-z0-9_-]{20,22}\.[A-Za-z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`mailgunApiKey`,description:`Mailgun API key`,regex:/\bkey-[0-9a-z]{32}\b/g,matchAccuracy:`high`},{name:`mailchimpApiKey`,description:`MailChimp API key`,regex:/\b[0-9a-f]{32}-us[0-9]{1,2}\b/g,matchAccuracy:`high`},{name:`discordBotToken`,description:`Discord bot token`,regex:/\b[MN][A-Za-z\d]{23}\.[\w-]{6}\.[\w-]{27}\b/g,matchAccuracy:`high`},{name:`discordWebhookUrl`,description:`Discord webhook URL`,regex:/\bhttps:\/\/discord\.com\/api\/webhooks\/[0-9]{18}\/[A-Za-z0-9_-]{68}\b/g,matchAccuracy:`high`},{name:`telegramBotToken`,description:`Telegram bot token`,regex:/\b[0-9]{8,10}:[A-Za-z0-9_-]{35}\b/g,matchAccuracy:`high`},{name:`twilioApiKey`,description:`Twilio API key`,regex:/\bSK[a-z0-9]{32}\b/g,matchAccuracy:`high`},{name:`twilioAccountSid`,description:`Twilio account SID`,regex:/\bAC[0-9a-fA-F]{32}\b/g,matchAccuracy:`high`},{name:`dockerHubToken`,description:`Docker Hub personal access token`,regex:/\bdckr_pat_[a-zA-Z0-9_]{36}\b/g,matchAccuracy:`high`},{name:`pypiApiToken`,description:`PyPI API token`,regex:/\bpypi-[a-zA-Z0-9_-]{84}\b/g,matchAccuracy:`high`},{name:`figmaToken`,description:`Figma personal access token`,regex:/\bfigd_[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`renderToken`,description:`Render API token`,regex:/\brnd_[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`airtablePersonalAccessToken`,description:`Airtable personal access token`,regex:/\bpat[a-zA-Z0-9]{14}\.[a-zA-Z0-9]{64}\b/g,matchAccuracy:`high`},{name:`typeformToken`,description:`Typeform API token`,regex:/\btfp_[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`intercomAccessToken`,description:`Intercom access token`,regex:/\bdG9rOi[a-zA-Z0-9+/]{46,48}={0,2}\b/g,matchAccuracy:`high`},{name:`digitalOceanToken`,description:`DigitalOcean API token`,regex:/\bdop_v1_[a-f0-9]{64}\b/g,matchAccuracy:`high`},{name:`digitalOceanOAuthToken`,description:`DigitalOcean OAuth access token`,regex:/\bdoo_v1_[a-f0-9]{64}\b/g,matchAccuracy:`high`},{name:`digitalOceanRefreshToken`,description:`DigitalOcean OAuth refresh token`,regex:/\bdor_v1_[a-f0-9]{64}\b/g,matchAccuracy:`high`},{name:`cloudflareApiKey`,description:`Cloudflare API key`,regex:/\b['"]?(?:cloudflare)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9_-]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`cloudflareGlobalApiKey`,description:`Cloudflare Global API key`,regex:/\b['"]?(?:cloudflare)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{37}['"]?\b/gi,matchAccuracy:`medium`},{name:`cloudflareOriginCaKey`,description:`Cloudflare Origin CA key`,regex:/\bv1\.0-[a-f0-9]{24}-[a-f0-9]{146}\b/g,matchAccuracy:`high`},{name:`flyioAccessToken`,description:`Fly.io API access token`,regex:/\bfo1_[\w-]{43}\b/g,matchAccuracy:`high`},{name:`flyioMachineToken`,description:`Fly.io machine token`,regex:/\bfm[12][ar]?_[a-zA-Z0-9+/]{100,}={0,3}\b/g,matchAccuracy:`high`},{name:`dopplerApiToken`,description:`Doppler API token`,regex:/\bdp\.pt\.[a-z0-9]{43}\b/gi,matchAccuracy:`high`},{name:`dynatraceApiToken`,description:`Dynatrace API token`,regex:/\bdt0c01\.[a-z0-9]{24}\.[a-z0-9]{64}\b/gi,matchAccuracy:`high`},{name:`netlifyAccessToken`,description:`Netlify access token`,regex:/\b['"]?(?:netlify)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9=_-]{40,46}['"]?\b/gi,matchAccuracy:`medium`},{name:`scalingoApiToken`,description:`Scalingo API token`,regex:/\btk-us-[\w-]{48}\b/g,matchAccuracy:`high`},{name:`infracostApiToken`,description:`Infracost API token`,regex:/\bico-[a-zA-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`harnessApiKey`,description:`Harness Access Token (PAT or SAT)`,regex:/\b(?:pat|sat)\.[a-zA-Z0-9_-]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}\b/g,matchAccuracy:`high`},{name:`azureAdClientSecret`,description:`Azure AD client secret`,regex:/(?:^|[\\'"` \s>=:(,)])([a-zA-Z0-9_~.]{3}\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\'"` \s<),])/g,matchAccuracy:`high`},{name:`herokuApiKeyV2`,description:`Heroku API key (new format)`,regex:/\bHRKU-AA[0-9a-zA-Z_-]{58}\b/g,matchAccuracy:`high`},{name:`microsoftTeamsWebhook`,description:`Microsoft Teams incoming webhook URL`,regex:/https:\/\/[a-z0-9]+\.webhook\.office\.com\/webhookb2\/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}\/IncomingWebhook\/[a-z0-9]{32}\/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/gi,matchAccuracy:`high`},{name:`oktaAccessToken`,description:`Okta access token`,regex:/\b['"]?(?:okta)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?00[\w=-]{40}['"]?\b/gi,matchAccuracy:`high`},{name:`openshiftUserToken`,description:`OpenShift user token`,regex:/\bsha256~[\w-]{43}\b/g,matchAccuracy:`high`}],Gb=[{name:`jwtSecrets`,description:`JWT secrets`,regex:/\bjwt[_-]?secret\s*[:=]\s*['"][^'"]{16,}['"]\b/gi,matchAccuracy:`high`},{name:`kubernetesSecrets`,description:`Kubernetes secrets in YAML`,regex:/\bkind:\s*["']?Secret["']?[\s\S]{0,2000}?\bdata:\s*[\s\S]{0,2000}?[a-zA-Z0-9_-]+:\s*[a-zA-Z0-9+/]{16,}={0,3}\b/gi,matchAccuracy:`high`,fileContext:/\.ya?ml$/i},{name:`dockerComposeSecrets`,description:`Docker Compose secrets`,regex:/\b(?:MYSQL_ROOT_PASSWORD|POSTGRES_PASSWORD|REDIS_PASSWORD|MONGODB_PASSWORD)\s*[:=]\s*['"][^'"]{4,}['"]\b/gi,matchAccuracy:`medium`,fileContext:/docker-compose\.ya?ml$/i},{name:`springBootSecrets`,description:`Spring Boot application secrets`,regex:/\b(?:spring\.datasource\.password|spring\.security\.oauth2\.client\.registration\..*\.client-secret)\s*[:=]\s*['"][^'"]{4,}['"]\b/gi,matchAccuracy:`medium`,fileContext:/(?:application|bootstrap)(?:-\w+)?\.(?:properties|ya?ml)$/i},{name:`dotnetConnectionStrings`,description:`.NET connection strings with credentials`,regex:/\b(?:ConnectionStrings?|connectionString)\s*[:=]\s*['"][^'"]*(?:password|pwd)\s*=\s*[^;'"]{4,}[^'"]*['"]\b/gi,matchAccuracy:`medium`,fileContext:/(?:appsettings|web\.config).*\.(?:json|config)$/i},{name:`base64EncodedSecrets`,description:`Base64 encoded secrets in config`,regex:/\b(?:secret|password|key|token)[_-]?(?:base64|encoded)?\s*[:=]\s*['"][A-Za-z0-9+/]{32,}={0,3}['"]\b/gi,matchAccuracy:`medium`}],Kb=[{name:`rsaPrivateKey`,description:`RSA private key`,regex:/-----BEGIN (?:RSA )?PRIVATE KEY-----[\s\S]*?-----END (?:RSA )?PRIVATE KEY-----/g,matchAccuracy:`high`},{name:`pkcs8PrivateKey`,description:`PKCS#8 private key`,regex:/\b-----BEGIN (?:ENCRYPTED )?PRIVATE KEY-----\s*[\s\S]*?-----END (?:ENCRYPTED )?PRIVATE KEY-----\b/g,matchAccuracy:`high`},{name:`ecPrivateKey`,description:`Elliptic Curve private key`,regex:/\b-----BEGIN EC PRIVATE KEY-----\s*[\s\S]*?-----END EC PRIVATE KEY-----\b/g,matchAccuracy:`high`},{name:`dsaPrivateKey`,description:`DSA private key`,regex:/\b-----BEGIN DSA PRIVATE KEY-----\s*[\s\S]*?-----END DSA PRIVATE KEY-----\b/g,matchAccuracy:`high`},{name:`opensshPrivateKey`,description:`OpenSSH private key`,regex:/-----BEGIN OPENSSH PRIVATE KEY-----[\s\S]*?-----END OPENSSH PRIVATE KEY-----/g,matchAccuracy:`high`},{name:`sshPrivateKeyEncrypted`,description:`SSH private key (SSH2 encrypted format)`,regex:/\b-----BEGIN SSH2 ENCRYPTED PRIVATE KEY-----\s*[\s\S]*?-----END SSH2 ENCRYPTED PRIVATE KEY-----\b/g,matchAccuracy:`high`},{name:`puttyPrivateKey`,description:`PuTTY private key file`,regex:/\bPuTTY-User-Key-File-[23]:\s*[\s\S]*?Private-MAC:\b/g,matchAccuracy:`high`},{name:`pgpPrivateKey`,description:`PGP private key block`,regex:/\b-----BEGIN PGP PRIVATE KEY BLOCK-----\s*[\s\S]*?-----END PGP PRIVATE KEY BLOCK-----\b/g,matchAccuracy:`high`},{name:`firebaseServiceAccountPrivateKey`,description:`Firebase service account private key (JSON format)`,regex:/\b"private_key":\s*"-----BEGIN PRIVATE KEY-----\\n[a-zA-Z0-9+/=\\n]+\\n-----END PRIVATE KEY-----"\b/g,matchAccuracy:`high`},{name:`openvpnClientPrivateKey`,description:`OpenVPN client private key`,regex:/\b<key>\s*-----BEGIN[^<]*-----END[^<]*<\/key>\b/g,matchAccuracy:`high`},{name:`dhParameters`,description:`Diffie-Hellman parameters`,regex:/\b-----BEGIN DH PARAMETERS-----\s*[\s\S]*?-----END DH PARAMETERS-----\b/g,matchAccuracy:`high`},{name:`ageSecretKey`,description:`Age encryption secret key`,regex:/\bAGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}\b/g,matchAccuracy:`high`},{name:`vaultBatchToken`,description:`HashiCorp Vault batch token`,regex:/\bhvb\.[a-zA-Z0-9_-]{20,}\b/g,matchAccuracy:`high`},{name:`vaultServiceToken`,description:`HashiCorp Vault service token`,regex:/\bhvs\.[a-zA-Z0-9_-]{20,}\b/g,matchAccuracy:`high`},{name:`vaultPeriodicToken`,description:`HashiCorp Vault periodic token`,regex:/\bhvp\.[a-zA-Z0-9_-]{20,}\b/g,matchAccuracy:`high`},{name:`base64PrivateKeyContent`,description:`Base64 encoded private key content`,regex:/\b(?:private[_-]?key|secret[_-]?key)\s*[:=]\s*["'][A-Za-z0-9+/]{64,}={0,2}["']\b/gi,matchAccuracy:`medium`},{name:`hexEncodedKey`,description:`Hexadecimal encoded cryptographic key`,regex:/\b(?:key|secret)\s*[:=]\s*["'][a-fA-F0-9]{32,}["']\b/gi,matchAccuracy:`medium`}],qb=[{name:`postgresqlConnectionString`,description:`PostgreSQL connection string with credentials`,regex:/\bpostgresql:\/\/[^:]+:[^@]+@[^/\s]+\/[^?\s]+\b/gi,matchAccuracy:`high`},{name:`mysqlConnectionString`,description:`MySQL connection string with credentials`,regex:/\bmysql:\/\/[^:]+:[^@]+@[^/\s]+\/[^?\s]+\b/gi,matchAccuracy:`high`},{name:`mongodbConnectionString`,description:`MongoDB connection string with credentials`,regex:/\bmongodb:\/\/[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+:[0-9]+\/[a-zA-Z0-9._-]+\b/g,matchAccuracy:`high`},{name:`redisConnectionString`,description:`Redis connection string with credentials`,regex:/\bredis:\/\/[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+:[0-9]+\b/g,matchAccuracy:`high`},{name:`redisAuthPassword`,description:`Redis AUTH password command`,regex:/\bAUTH\s+[a-zA-Z0-9_-]{8,}\b/gi,matchAccuracy:`medium`},{name:`elasticsearchCredentials`,description:`Elasticsearch credentials in URL`,regex:/\bhttps?:\/\/[^:]+:[^@]+@[^/\s]+:9200\b/gi,matchAccuracy:`high`},{name:`couchdbCredentials`,description:`CouchDB credentials in URL`,regex:/\bhttp[s]?:\/\/[^:]+:[^@]+@[^/\s]+:5984\b/gi,matchAccuracy:`high`},{name:`neo4jCredentials`,description:`Neo4j database credentials in URL`,regex:/\bbolt[s]?:\/\/[^:]+:[^@]+@[^/\s]+:7687\b/gi,matchAccuracy:`high`},{name:`timescaledbConnectionString`,description:`TimescaleDB connection string with credentials`,regex:/\btimescaledb:\/\/[^:]+:[^@]+@[^/\s]+\/[^?\s]+\b/gi,matchAccuracy:`high`},{name:`clickhouseCredentials`,description:`ClickHouse connection string with credentials`,regex:/\bclickhouse:\/\/[^:]+:[^@]+@[^/\s]+:8123\b/gi,matchAccuracy:`high`},{name:`cassandraConnectionString`,description:`Cassandra connection string with credentials`,regex:/\bcassandra:\/\/[^:]+:[^@]+@[^/\s]+:9042\b/gi,matchAccuracy:`high`},{name:`faunadbKey`,description:`FaunaDB secret key`,regex:/\bfn[a-zA-Z0-9]{40}\b/g,matchAccuracy:`high`},{name:`databricksApiToken`,description:`Databricks API token`,regex:/\bdapi[a-f0-9]{32}(?:-\d)?\b/g,matchAccuracy:`high`},{name:`pineconeApiKey`,description:`Pinecone API key`,regex:/\bpinecone[\s\w]*(?:api|key|env)[\s:=]*["']?[a-zA-Z0-9_-]{32}["']?\b/gi,matchAccuracy:`medium`},{name:`databaseUrlWithCredentials`,description:`Generic database URL with embedded credentials`,regex:/\b(?:postgres|mysql|mongodb|redis):\/\/[^:]+:[^@]+@[^/\s]+\b/gi,matchAccuracy:`medium`},{name:`clickhouseCloudApiKey`,description:`ClickHouse Cloud API secret key`,regex:/\b4b1d[A-Za-z0-9]{38}\b/g,matchAccuracy:`high`},{name:`neonDatabaseConnectionString`,description:`Neon database connection string`,regex:/\bpostgres:\/\/[^:]+:[^@]+@[^/\s]*neon\.tech[^?\s]*\b/gi,matchAccuracy:`high`},{name:`tursoDatabaseToken`,description:`Turso database auth token`,regex:/\b['"]?(?:turso|libsql)(?:[\s\w.-]{0,20})(?:token|auth)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9._-]{50,}['"]?\b/gi,matchAccuracy:`medium`},{name:`upstashRedisToken`,description:`Upstash Redis REST token`,regex:/\b['"]?(?:upstash)(?:[\s\w.-]{0,20})(?:token|key)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9=]{40,}['"]?\b/gi,matchAccuracy:`medium`}],Jb=[{name:`npmAccessToken`,description:`NPM access token`,regex:/\bnpm_[a-zA-Z0-9]{36}\b/g,matchAccuracy:`high`},{name:`nugetApiKey`,description:`NuGet API key`,regex:/\boy2[a-z0-9]{43}\b/g,matchAccuracy:`high`},{name:`artifactoryApiKey`,description:`JFrog Artifactory API key`,regex:/\bAKCp[A-Za-z0-9]{69}\b/g,matchAccuracy:`high`},{name:`herokuApiKey`,description:`Heroku API key`,regex:/\bheroku.*[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\b/gi,matchAccuracy:`high`},{name:`terraformCloudToken`,description:`Terraform Cloud API token`,regex:/\b[a-zA-Z0-9]{14}\.[a-zA-Z0-9]{6}\.[a-zA-Z0-9]{16}\b/g,matchAccuracy:`high`},{name:`pulumiAccessToken`,description:`Pulumi access token`,regex:/\bpul-[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`atlassianApiToken`,description:`Atlassian API token (Jira/Confluence)`,regex:/\bATATT3[A-Za-z0-9_\-=]{186}\b/g,matchAccuracy:`high`},{name:`sourcegraphApiKey`,description:`Sourcegraph API key`,regex:/\bsgp_[a-zA-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`linearApiKey`,description:`Linear API key`,regex:/\blin_api_[0-9A-Za-z]{40}\b/g,matchAccuracy:`high`},{name:`notionIntegrationToken`,description:`Notion integration token`,regex:/\bntn_[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`stackhawkApiKey`,description:`StackHawk API key`,regex:/\bhawk\.[0-9A-Za-z\-_]{20}\.[0-9A-Za-z\-_]{20}\b/g,matchAccuracy:`high`},{name:`sentryAuthToken`,description:`Sentry authentication token`,regex:/\bsentry[\s\w]*(?:auth|token)[\s:=]*["']?[a-f0-9]{64}["']?\b/gi,matchAccuracy:`medium`},{name:`bugsnagApiKey`,description:`Bugsnag API key`,regex:/\bbugsnag[\s\w]*(?:api|key)[\s:=]*["']?[a-f0-9]{32}["']?\b/gi,matchAccuracy:`medium`},{name:`rollbarAccessToken`,description:`Rollbar access token`,regex:/\brollbar[\s\w]*(?:access|token)[\s:=]*["']?[a-f0-9]{32}["']?\b/gi,matchAccuracy:`medium`},{name:`postmanApiToken`,description:`Postman API token`,regex:/\bPMAK-[a-f0-9]{24}-[a-f0-9]{34}\b/gi,matchAccuracy:`high`},{name:`prefectApiToken`,description:`Prefect API token`,regex:/\bpnu_[a-zA-Z0-9]{36}\b/g,matchAccuracy:`high`},{name:`readmeApiToken`,description:`Readme API token`,regex:/\brdme_[a-z0-9]{70}\b/g,matchAccuracy:`high`},{name:`rubygemsApiToken`,description:`RubyGems API token`,regex:/\brubygems_[a-f0-9]{48}\b/g,matchAccuracy:`high`},{name:`clojarsApiToken`,description:`Clojars API token`,regex:/\bCLOJARS_[a-z0-9]{60}\b/gi,matchAccuracy:`high`},{name:`snykApiToken`,description:`Snyk API token`,regex:/\b['"]?(?:snyk[_.-]?(?:(?:api|oauth)[_.-]?)?(?:key|token))['"]?\s*(?::|=>|=)\s*['"]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"]?\b/gi,matchAccuracy:`high`},{name:`sonarqubeToken`,description:`SonarQube/SonarCloud token`,regex:/\b(?:squ_|sqp_|sqa_)[a-z0-9=_-]{40}\b/gi,matchAccuracy:`high`},{name:`travisciAccessToken`,description:`Travis CI access token`,regex:/\b['"]?(?:travis)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{22}['"]?\b/gi,matchAccuracy:`medium`},{name:`codecovAccessToken`,description:`Codecov access token`,regex:/\b['"]?(?:codecov)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`droneCiAccessToken`,description:`DroneCI access token`,regex:/\b['"]?(?:droneci|drone)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`octopusDeployApiKey`,description:`Octopus Deploy API key`,regex:/\bAPI-[A-Z0-9]{26}\b/g,matchAccuracy:`high`},{name:`circleciToken`,description:`CircleCI personal API token`,regex:/\b['"]?(?:circleci|circle)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`buildkiteAgentToken`,description:`Buildkite agent token`,regex:/\bbkagent_[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`launchdarklyAccessToken`,description:`LaunchDarkly access token`,regex:/\b['"]?(?:launchdarkly)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9=_-]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`algoliaApiKey`,description:`Algolia API key`,regex:/\b['"]?(?:algolia)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{32}['"]?\b/gi,matchAccuracy:`medium`}],Yb=[{name:`shopifyStorefrontAccessToken`,description:`Shopify storefront API access token`,regex:/\bshpatf_[0-9a-f]{32}\b/g,matchAccuracy:`high`},{name:`woocommerceConsumerKey`,description:`WooCommerce consumer key`,regex:/\bck_[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`woocommerceConsumerSecret`,description:`WooCommerce consumer secret`,regex:/\bcs_[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`contentfulAccessToken`,description:`Contentful access token`,regex:/\bCFPAT-[0-9a-zA-Z]{20}\b/g,matchAccuracy:`high`},{name:`mailchimpEcommerceApiKey`,description:`MailChimp E-commerce API key`,regex:/\b[0-9a-f]{32}-[a-z]{2,3}[0-9]{1,2}\b/g,matchAccuracy:`high`}],Xb=[{name:`gitlabPersonalAccessToken`,description:`GitLab personal access token`,regex:/\bglpat-[A-Za-z0-9_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabDeployToken`,description:`GitLab deploy token`,regex:/\bgldt-[A-Za-z0-9_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabRunnerToken`,description:`GitLab runner registration token`,regex:/\bglrt-[A-Za-z0-9_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabCiJobToken`,description:`GitLab CI/CD job token`,regex:/\bglcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabRunnerAuthToken`,description:`GitLab runner authentication token`,regex:/\bglrt-[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabPipelineTriggerToken`,description:`GitLab pipeline trigger token`,regex:/\bglptt-[0-9a-f]{40}\b/g,matchAccuracy:`high`},{name:`bitbucketAppPassword`,description:`Bitbucket app password`,regex:/\bATBB[a-zA-Z0-9]{24}\b/g,matchAccuracy:`high`},{name:`githubTokens`,description:`GitHub personal access token (classic)`,regex:/\b((?:ghp|gho|ghu|ghs|ghr|github_pat)_[a-zA-Z0-9_]{36,255})\b/g,matchAccuracy:`high`},{name:`githubAppInstallationToken`,description:`GitHub App installation token`,regex:/\bghs_[0-9a-zA-Z]{37}\b/g,matchAccuracy:`high`},{name:`gitlabScimToken`,description:`GitLab SCIM token`,regex:/\bglsoat-[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabFeatureFlagToken`,description:`GitLab feature flag client token`,regex:/\bglffct-[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabFeedToken`,description:`GitLab feed token`,regex:/\bglft-[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabIncomingMailToken`,description:`GitLab incoming mail token`,regex:/\bglimt-[0-9a-zA-Z_-]{25}\b/g,matchAccuracy:`high`},{name:`gitlabK8sAgentToken`,description:`GitLab Kubernetes agent token`,regex:/\bglagent-[0-9a-zA-Z_-]{50}\b/g,matchAccuracy:`high`},{name:`gitlabOAuthAppSecret`,description:`GitLab OAuth application secret`,regex:/\bgloas-[0-9a-zA-Z_-]{64}\b/g,matchAccuracy:`high`},{name:`gitlabSessionCookie`,description:`GitLab session cookie`,regex:/_gitlab_session=[0-9a-z]{32}/g,matchAccuracy:`high`},{name:`bitbucketRepoToken`,description:`Bitbucket repository access token`,regex:/\bATCTT3[a-zA-Z0-9]{24}\b/g,matchAccuracy:`high`}],Zb=[{name:`mapboxSecretToken`,description:`Mapbox secret access token`,regex:/\bsk\.eyJ[a-zA-Z0-9._-]{87}\b/g,matchAccuracy:`high`},{name:`grafanaCloudApiKey`,description:`Grafana Cloud API key`,regex:/\bglc_[a-zA-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`newRelicApiKey`,description:`New Relic API key`,regex:/\bNRAK-[A-Z0-9]{27}\b/g,matchAccuracy:`high`},{name:`newRelicInsightKey`,description:`New Relic Insights query key`,regex:/\bNRIK-[A-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`newRelicBrowserApiToken`,description:`New Relic browser API token`,regex:/\bNRJS-[a-f0-9]{19}\b/g,matchAccuracy:`high`},{name:`newRelicInsertKey`,description:`New Relic ingest insert key`,regex:/\bNRII-[a-z0-9-]{32}\b/gi,matchAccuracy:`high`},{name:`grafanaApiKey`,description:`Grafana API key`,regex:/\beyJrIjoi[A-Za-z0-9]{70,400}={0,3}\b/gi,matchAccuracy:`high`},{name:`grafanaServiceAccountToken`,description:`Grafana service account token`,regex:/\bglsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8}\b/g,matchAccuracy:`high`},{name:`sentryOrgToken`,description:`Sentry organization token`,regex:/\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}\b/g,matchAccuracy:`high`},{name:`sentryUserToken`,description:`Sentry user token`,regex:/\bsntryu_[a-f0-9]{64}\b/g,matchAccuracy:`high`},{name:`sumoLogicAccessId`,description:`SumoLogic access ID`,regex:/\b['"]?(?:sumo)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?su[a-zA-Z0-9]{12}['"]?\b/gi,matchAccuracy:`high`},{name:`splunkApiToken`,description:`Splunk HEC token`,regex:/\b['"]?(?:splunk)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}['"]?\b/gi,matchAccuracy:`medium`},{name:`logdnaApiKey`,description:`LogDNA/Mezmo API key`,regex:/\b['"]?(?:logdna|mezmo)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`logglyToken`,description:`Loggly customer token`,regex:/\b['"]?(?:loggly)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}['"]?\b/gi,matchAccuracy:`medium`}],Qb=[{name:`stripeSecretKey`,description:`Stripe secret key (sk_*, rk_*)`,regex:/\b[rs]k_live_[a-zA-Z0-9]{20,247}\b/g,matchAccuracy:`high`},{name:`stripeWebhookSecret`,description:`Stripe webhook signing secret`,regex:/\bwhsec_[a-zA-Z0-9]{32,}\b/g,matchAccuracy:`high`},{name:`paypalAccessToken`,description:`PayPal access token`,regex:/\bA21AA[a-zA-Z0-9_-]{50,}\b/g,matchAccuracy:`high`},{name:`paypalBraintreeAccessToken`,description:`PayPal Braintree access token`,regex:/\baccess_token\$(?:production|sandbox)\$[0-9a-z]{16}\$[0-9a-f]{32}\b/g,matchAccuracy:`high`},{name:`squareAccessToken`,description:`Square access token (all formats)`,regex:/\b(?:EAAAE[A-Za-z0-9_-]{94,}|sq0[a-z]?atp-[0-9A-Za-z\-_]{22,26})\b/g,matchAccuracy:`high`},{name:`squareOauthSecret`,description:`Square OAuth secret`,regex:/\bsq0csp-[0-9A-Za-z\-_]{43}\b/g,matchAccuracy:`high`},{name:`squareApplicationId`,description:`Square application ID`,regex:/\bsq0ids-[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`shopifyPrivateAppPassword`,description:`Shopify private app password`,regex:/\bshppa_[a-fA-F0-9]{32}\b/g,matchAccuracy:`high`},{name:`shopifyAccessToken`,description:`Shopify access token`,regex:/\bshpat_[a-fA-F0-9]{32}\b/g,matchAccuracy:`high`},{name:`shopifyWebhookToken`,description:`Shopify webhook token`,regex:/\bshpwh_[a-fA-F0-9]{32}\b/g,matchAccuracy:`high`},{name:`adyenApiKey`,description:`Adyen API key`,regex:/\bAQE[a-zA-Z0-9]{70,}\b/g,matchAccuracy:`high`},{name:`razorpayApiKey`,description:`Razorpay API key`,regex:/\brzp_(?:test|live)_[a-zA-Z0-9]{14}\b/g,matchAccuracy:`high`},{name:`flutterwaveKeys`,description:`Flutterwave API keys`,regex:/\bFLW(?:PUBK|SECK)_(?:TEST|LIVE)-[a-h0-9]{32}-X\b/g,matchAccuracy:`high`},{name:`coinbaseAccessToken`,description:`Coinbase access token`,regex:/\b['"]?(?:coinbase)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9_-]{64}['"]?\b/gi,matchAccuracy:`medium`},{name:`krakenAccessToken`,description:`Kraken access token`,regex:/\b['"]?(?:kraken)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9/=_+-]{80,90}['"]?\b/gi,matchAccuracy:`medium`},{name:`kucoinAccessToken`,description:`Kucoin access token`,regex:/\b['"]?(?:kucoin)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{24}['"]?\b/gi,matchAccuracy:`medium`},{name:`kucoinSecretKey`,description:`Kucoin secret key`,regex:/\b['"]?(?:kucoin)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"]?\b/gi,matchAccuracy:`medium`},{name:`bittrexAccessKey`,description:`Bittrex access key`,regex:/\b['"]?(?:bittrex)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`binanceApiKey`,description:`Binance API key`,regex:/\b['"]?(?:binance)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[A-Za-z0-9]{64}['"]?\b/gi,matchAccuracy:`medium`},{name:`bybitApiKey`,description:`Bybit API key`,regex:/\b['"]?(?:bybit)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[A-Za-z0-9]{18,24}['"]?\b/gi,matchAccuracy:`medium`},{name:`gocardlessApiToken`,description:`GoCardless API token`,regex:/\blive_[a-z0-9\-_=]{40}\b/gi,matchAccuracy:`high`},{name:`plaidApiToken`,description:`Plaid API token`,regex:/\baccess-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/g,matchAccuracy:`high`}],$b=[{name:`privateKeyPem`,description:`Private key in PEM format (comprehensive)`,regex:/-----BEGIN\s?(?:(?:RSA|DSA|EC|OPENSSH|ENCRYPTED)\s+)?PRIVATE\s+KEY(?:\s+BLOCK)?-----[\s\S]*?-----END\s?(?:(?:RSA|DSA|EC|OPENSSH|ENCRYPTED)\s+)?PRIVATE\s+KEY(?:\s+BLOCK)?-----/g,matchAccuracy:`high`},{name:`pgpPrivateKeyBlock`,description:`PGP private key block (comprehensive)`,regex:/-----BEGIN\s+PGP\s+PRIVATE\s+KEY\s+BLOCK-----[\s\S]*?-----END\s+PGP\s+PRIVATE\s+KEY\s+BLOCK-----/g,matchAccuracy:`high`}],ex=[{name:`credentialsInUrl`,description:`Credentials embedded in URL`,regex:/\b[a-zA-Z]{3,10}:\/\/[^\\/\s:@]{3,20}:[^\\/\s:@]{3,20}@[^\s'"]+\b/g,matchAccuracy:`high`},{name:`envVarSecrets`,description:`Environment variable secrets (KEY, SECRET, TOKEN, PASSWORD)`,regex:/\b(?:\w+_)?(?:SECRET|secret|password|key|token|jwt_secret)(?:_\w+)?\s*=\s*["'][^"']{16,}["']/gi,matchAccuracy:`medium`}],tx=[{name:`slackBotToken`,description:`Slack bot token`,regex:/\bxoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*\b/g,matchAccuracy:`high`},{name:`slackUserToken`,description:`Slack user token`,regex:/\bxoxp-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*\b/g,matchAccuracy:`high`},{name:`slackWorkspaceToken`,description:`Slack workspace token`,regex:/\bxoxa-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*\b/g,matchAccuracy:`high`},{name:`slackRefreshToken`,description:`Slack refresh token`,regex:/\bxoxr-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*\b/g,matchAccuracy:`high`},{name:`slackWebhookUrl`,description:`Slack incoming webhook URL`,regex:/(?:https?:\/\/)?hooks\.slack\.com\/(?:services|workflows|triggers)\/[A-Za-z0-9+/]{43,56}/gi,matchAccuracy:`high`},{name:`slackAppToken`,description:`Slack app-level token`,regex:/\bxapp-\d-[A-Z0-9]+-\d+-[a-z0-9]+\b/gi,matchAccuracy:`high`},{name:`slackConfigAccessToken`,description:`Slack configuration access token`,regex:/\bxoxe\.xox[bp]-\d-[A-Z0-9]{163,166}\b/gi,matchAccuracy:`high`},{name:`sendbirdAccessToken`,description:`Sendbird access token`,regex:/\b['"]?(?:sendbird)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`messagebirdApiToken`,description:`MessageBird API token`,regex:/\b['"]?(?:messagebird|message_bird|message-bird)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{25}['"]?\b/gi,matchAccuracy:`medium`},{name:`mattermostAccessToken`,description:`Mattermost access token`,regex:/\b['"]?(?:mattermost)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{26}['"]?\b/gi,matchAccuracy:`medium`},{name:`zendeskSecretKey`,description:`Zendesk secret key`,regex:/\b['"]?(?:zendesk)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`freshdeskApiKey`,description:`Freshdesk API key`,regex:/\b['"]?(?:freshdesk)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{20}['"]?\b/gi,matchAccuracy:`medium`},{name:`sendinblueApiToken`,description:`Sendinblue (Brevo) API token`,regex:/\bxkeysib-[a-f0-9]{64}-[a-z0-9]{16}\b/g,matchAccuracy:`high`}],nx=[{name:`twitterBearerToken`,description:`Twitter/X Bearer token`,regex:/\bAAAAAAAAAAAAAAAAAAAAA[a-zA-Z0-9%]{50,}\b/g,matchAccuracy:`high`},{name:`facebookAccessToken`,description:`Facebook/Meta access token`,regex:/\bEAA[a-zA-Z0-9]{80,120}\b/g,matchAccuracy:`high`},{name:`facebookPageAccessToken`,description:`Facebook/Meta page access token`,regex:/\bEAAB[a-zA-Z0-9+/]{100,}\b/g,matchAccuracy:`high`},{name:`instagramAccessToken`,description:`Instagram access token`,regex:/\bIGQV[a-zA-Z0-9_-]{100,}\b/g,matchAccuracy:`high`},{name:`discordSocialBotToken`,description:`Discord social bot token`,regex:/\b[MN][A-Za-z\d]{23}\.[A-Za-z\d-_]{6}\.[A-Za-z\d-_]{27}\b/g,matchAccuracy:`high`},{name:`discordSocialWebhookUrl`,description:`Discord social webhook URL`,regex:/\bhttps:\/\/discord(?:app)?\.com\/api\/webhooks\/[0-9]{17,19}\/[A-Za-z0-9_-]{68}\b/g,matchAccuracy:`high`},{name:`pinterestAccessToken`,description:`Pinterest access token`,regex:/\bpina_[a-zA-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`linkedinApiToken`,description:`LinkedIn API token`,regex:/\b['"]?(?:linkedin|linked_in|linked-in)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{14,16}['"]?\b/gi,matchAccuracy:`medium`},{name:`youtubeApiKey`,description:`YouTube Data API key`,regex:/\b['"]?(?:youtube)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?AIza[a-zA-Z0-9_-]{35}['"]?\b/gi,matchAccuracy:`high`},{name:`tiktokApiToken`,description:`TikTok API token`,regex:/\b['"]?(?:tiktok)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9_-]{40,}['"]?\b/gi,matchAccuracy:`medium`}],rx=[{name:`shippoApiToken`,description:`Shippo API token`,regex:/\bshippo_(?:live|test)_[a-fA-F0-9]{40}\b/g,matchAccuracy:`high`},{name:`easypostApiToken`,description:`EasyPost API token`,regex:/\bEZAK[a-z0-9]{54}\b/gi,matchAccuracy:`high`},{name:`easypostTestApiToken`,description:`EasyPost test API token`,regex:/\bEZTK[a-z0-9]{54}\b/gi,matchAccuracy:`high`},{name:`duffelApiToken`,description:`Duffel travel API token`,regex:/\bduffel_(?:test|live)_[a-z0-9_\-=]{43}\b/gi,matchAccuracy:`high`},{name:`frameioApiToken`,description:`Frame.io API token`,regex:/\bfio-u-[a-z0-9\-_=]{64}\b/gi,matchAccuracy:`high`},{name:`maxmindLicenseKey`,description:`MaxMind license key`,regex:/\b[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk\b/g,matchAccuracy:`high`},{name:`asanaPersonalAccessToken`,description:`Asana personal access token`,regex:/\b['"]?(?:asana)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[0-9]{16}['"]?\b/gi,matchAccuracy:`medium`},{name:`mondayApiToken`,description:`Monday.com API token`,regex:/\b['"]?(?:monday)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?eyJ[a-zA-Z0-9_-]{100,}['"]?\b/gi,matchAccuracy:`medium`},{name:`trelloApiKey`,description:`Trello API key`,regex:/\b['"]?(?:trello)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`jiraApiToken`,description:`Jira API token`,regex:/\b['"]?(?:jira)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{24}['"]?\b/gi,matchAccuracy:`medium`},{name:`settlemintApplicationAccessToken`,description:`SettleMint application access token`,regex:/\bsm_aat_[a-zA-Z0-9]{16}\b/g,matchAccuracy:`high`},{name:`settlemintPersonalAccessToken`,description:`SettleMint personal access token`,regex:/\bsm_pat_[a-zA-Z0-9]{16}\b/g,matchAccuracy:`high`},{name:`settlemintServiceAccessToken`,description:`SettleMint service access token`,regex:/\bsm_sat_[a-zA-Z0-9]{16}\b/g,matchAccuracy:`high`}],ix=[...Bb,...Hb,...Ub,...Vb,...Wb,...Gb,...Kb,...qb,...Jb,...Yb,...ex,...Zb,...Qb,...$b,...rx,...tx,...nx,...Xb];let ax=null,ox=[];function sx(e){if(!e)return e;let t=cx(),n=[],r;for(;(r=t.exec(e))!==null;){for(let e=0;e<ox.length;e++)if(r.groups?.[`p${e}`]){n.push({start:r.index,end:r.index+r[0].length,accuracy:ox[e]?.matchAccuracy||`medium`});break}r[0].length===0&&t.lastIndex++}if(n.length===0)return e;n.sort((e,t)=>e.start-t.start);let i=[],a=-1;for(let e of n)e.start>=a&&(i.push(e),a=e.end);let o=e;for(let t=i.length-1;t>=0;t--){let n=i[t];if(n){let t=lx(e.slice(n.start,n.end));o=o.slice(0,n.start)+t+o.slice(n.end)}}return o}function cx(){return ax||(ax=ux(ix),ox=ix),ax}function lx(e){let t=``;for(let n=0;n<e.length;n++)n%2==0?t+=`*`:t+=e[n];return t}function ux(e){let t=e.map((e,t)=>`(?<p${t}>${e.regex.source})`);return new RegExp(t.join(`|`),`gi`)}let dx=null,fx=null,px=null,mx=null,hx=jy,gx=Jy,_x=$v;function vx(e){if(e?.trim())return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function yx(e,t){if(e==null)return t;let n=e.trim().toLowerCase();return n===``?t:n===`true`||n===`1`}function bx(e){if(e==null)return!0;let t=e.trim().toLowerCase();return t===``?!0:t!==`false`&&t!==`0`}async function xx(){let e=hx();if(e)return e;try{let e=await _x();if(e?.trim())return e.trim()}catch(e){e instanceof Error&&e.message&&(e.message=sx(e.message))}try{let e=await gx();if(e)return e}catch(e){e instanceof Error&&e.message&&(e.message=sx(e.message))}return null}async function Sx(){if(dx===null){if(px!==null)return px;px=(async()=>{fx=await xx();let e=bx(process.env.LOG),t=yx(process.env.ENABLE_LOCAL,!1)||yx(process.env.LOCAL,!1);dx={version:bb,githubApiUrl:process.env.GITHUB_API_URL?.trim()||`https://api.github.com`,toolsToRun:vx(process.env.TOOLS_TO_RUN),enableTools:vx(process.env.ENABLE_TOOLS),disableTools:vx(process.env.DISABLE_TOOLS),enableLogging:e,timeout:Math.max(3e4,parseInt(process.env.REQUEST_TIMEOUT?.trim()||`30000`)||3e4),maxRetries:Math.max(0,Math.min(10,parseInt(process.env.MAX_RETRIES?.trim()||`3`)||3)),loggingEnabled:e,enableLocal:t}})(),await px}}function Cx(){dx=null,fx=null,px=null,mx=null}function wx(){if(!dx){let e=sx(Cb.NOT_INITIALIZED.message);throw Error(e)}return dx}async function Tx(){return fx||mx||(mx=(async()=>{try{return fx=await xx(),fx}finally{mx=null}})(),mx)}function Ex(){return wx().enableLocal}function Dx(){return dx?.loggingEnabled??!1}var Ox=class{session;logEndpoint=`https://octocode-mcp-host.onrender.com/log`;constructor(){this.session=pb()}getSessionId(){return this.session.sessionId}getSession(){return this.session}async logInit(){await this.sendLog(`init`,{})}async logToolCall(e,t,n,r,i){let a=hb(1);a.session&&(this.session=a.session);let o={tool_name:e,repos:t,...n&&{mainResearchGoal:n},...r&&{researchGoal:r},...i&&{reasoning:i}};await this.sendLog(`tool_call`,o)}async logPromptCall(e){let t=gb(1);t.session&&(this.session=t.session);let n={prompt_name:e};await this.sendLog(`prompt_call`,n)}async logError(e,t){let n=_b(1);n.session&&(this.session=n.session),await this.sendLog(`error`,{error:`${e}:${t}`})}async logRateLimit(e){let t=vb(1);t.session&&(this.session=t.session),await this.sendLog(`rate_limit`,e)}async sendLog(e,t){if(Dx())try{let n={sessionId:this.session.sessionId,intent:e,data:t,timestamp:new Date().toISOString(),version:bb};await qv.post(this.logEndpoint,n,{timeout:5e3,headers:{"Content-Type":`application/json`}})}catch(t){let n=t instanceof Error?t.message:String(t);process.stderr.write(`[session] Failed to send log (${e}): ${n}\n`)}}};let kx=null;function Ax(){return kx||=new Ox,kx}function jx(){return kx}async function Mx(){let e=jx();e&&await e.logInit()}async function Nx(e,t,n,r,i){let a=jx();a&&await a.logToolCall(e,t,n,r,i)}async function Px(e){let t=jx();t&&await t.logPromptCall(e)}async function Fx(e,t){let n=jx();n&&await n.logError(e,t)}async function Ix(e){let t=jx();t&&await t.logRateLimit(e)}function Lx(e,t){let n=t.prompts;if(n)for(let t of Object.values(n)){if(!t||typeof t.name!=`string`||t.name.trim().length===0||typeof t.description!=`string`||t.description.trim().length===0||typeof t.content!=`string`||t.content.trim().length===0)continue;let n={};if(t.args&&Array.isArray(t.args))for(let e of t.args){if(!e||typeof e.name!=`string`)continue;let t=U().describe(e.description);e.required||(t=t.optional()),n[e.name]=t}e.registerPrompt(t.name,{description:t.description,argsSchema:n},async e=>{await Px(t.name);let n=t.content;if(e&&Object.keys(e).length>0){n+=`
|
|
65
|
+
⚠ Warning: Could not read credentials file. You may need to login again.`),console.error(` File: ${Dy}`),e instanceof Error&&e.message&&console.error(` Reason: ${e.message}\n`),{version:1,credentials:{}}}}function Vy(e){zy(),k(Dy,Ly(JSON.stringify(e,null,2)),{mode:384})}function Hy(e){try{let t=By();return t.credentials[e]?(delete t.credentials[e],Object.keys(t.credentials).length===0?Uy():Vy(t),!0):!1}catch(e){return console.warn(`[token-storage] Failed to remove from file storage: ${e instanceof Error?e.message:String(e)}`),!1}}function Uy(){try{w(Dy)&&O(Dy),w(Oy)&&O(Oy)}catch{}}async function Wy(e,t){try{await Sy(Py(e,t),by),Hy(e)}catch{}}function Gy(e){return e.toLowerCase().replace(/^https?:\/\//,``).replace(/\/$/,``)}async function Ky(e=`github.com`){let t=Gy(e);if(Ny())try{let e=await Sy(Fy(t),by);if(e)return e}catch(e){e instanceof xy||console.warn(`[token-storage] Keyring read failed: ${e instanceof Error?e.message:String(e)}`)}let n=By().credentials[t];return n?(Ny()&&Wy(t,n).catch(()=>{}),n):null}function qy(e){if(!e.token.expiresAt)return!1;let t=new Date(e.token.expiresAt);if(isNaN(t.getTime()))return!0;let n=new Date;return t.getTime()-n.getTime()<300*1e3}async function Jy(e=`github.com`){let t=await Ky(e);return!t||!t.token||qy(t)?null:t.token.token}const Yy=A(Ey,`session.json`);let Xy=null,Zy=!1,Qy=null,$y=!1,eb=null,tb=null,nb=null;function rb(){$y||($y=!0,eb=()=>{fb()},tb=()=>{fb()},nb=()=>{fb()},process.on(`exit`,eb),process.once(`SIGINT`,tb),process.once(`SIGTERM`,nb))}function ib(){Qy||(Qy=setInterval(()=>{Zy&&Xy&&(ab(Xy),Zy=!1)},6e4),Qy.unref())}function ab(e){zy();let t=`${Yy}.tmp`;k(t,JSON.stringify(e,null,2),{mode:384}),D(t,Yy)}function ob(){if(!w(Yy))return null;try{let e=E(Yy,`utf8`),t=JSON.parse(e);return t.version!==1||!t.sessionId||!t.createdAt?null:t}catch{return null}}function sb(){return{toolCalls:0,promptCalls:0,errors:0,rateLimits:0}}function cb(){let e=new Date().toISOString();return{version:1,sessionId:M(),createdAt:e,lastActiveAt:e,stats:sb()}}function lb(){if(Xy)return Xy;let e=ob();return e&&(Xy=e),e}function ub(e){Xy=e,Zy=!0,rb(),ib()}function db(){Zy&&Xy&&(ab(Xy),Zy=!1)}function fb(){if(Zy&&Xy)try{ab(Xy),Zy=!1}catch{}}function pb(e){if(e?.forceNew){let e=cb();return ub(e),db(),e}let t=lb();if(t){let e={...t,lastActiveAt:new Date().toISOString()};return ub(e),db(),e}let n=cb();return ub(n),db(),n}function mb(e){let t=lb();if(!t)return{success:!1,session:null};let n={toolCalls:t.stats.toolCalls+(e.toolCalls??0),promptCalls:t.stats.promptCalls+(e.promptCalls??0),errors:t.stats.errors+(e.errors??0),rateLimits:t.stats.rateLimits+(e.rateLimits??0)},r={...t,lastActiveAt:new Date().toISOString(),stats:n};return ub(r),{success:!0,session:r}}function hb(e=1){return mb({toolCalls:e})}function gb(e=1){return mb({promptCalls:e})}function _b(e=1){return mb({errors:e})}function vb(e=1){return mb({rateLimits:e})}var yb=`octocode-mcp`,bb=`11.1.1`;const xb=process.env.REDACT_ERROR_PATHS===`true`;function Sb(e,t){if(!xb)return e;if(t&&e.startsWith(t))return e.slice(t.length).replace(/^[/\\]/,``)||`.`;let n=b.homedir();return n&&e.startsWith(n)?`~`+e.slice(n.length):o.basename(e)}const Cb={NOT_INITIALIZED:{code:`CONFIG_NOT_INITIALIZED`,message:`Configuration not initialized. Call initialize() and await its completion before calling getServerConfig().`},NO_GITHUB_TOKEN:{code:`CONFIG_NO_GITHUB_TOKEN`,message:`No GitHub token found. Please authenticate with GitHub CLI (gh auth login) or set GITHUB_TOKEN/GH_TOKEN/OCTOCODE_TOKEN environment variable. After setting the token, restart the MCP server to apply changes.`}},wb={PROMISES_NOT_ARRAY:{code:`VALIDATION_PROMISES_NOT_ARRAY`,message:`promises must be an array`},TIMEOUT_NOT_POSITIVE:{code:`VALIDATION_TIMEOUT_NOT_POSITIVE`,message:`timeout must be positive`},CONCURRENCY_NOT_POSITIVE:{code:`VALIDATION_CONCURRENCY_NOT_POSITIVE`,message:`concurrency must be positive`},INVALID_PARAMETERS:{code:`VALIDATION_INVALID_PARAMETERS`,message:`Invalid parameters: must be an object`},INVALID_PARAMETER_KEY:{code:`VALIDATION_INVALID_PARAMETER_KEY`,message:e=>`Invalid parameter key: ${e}`},INVALID_NESTED_OBJECT:{code:`VALIDATION_INVALID_NESTED_OBJECT`,message:(e,t)=>`Invalid nested object in parameter ${e}: ${t}`}},Tb={FETCH_NOT_AVAILABLE:{code:`FETCH_NOT_AVAILABLE`,message:`Global fetch is not available in this environment.`},FETCH_FAILED_AFTER_RETRIES:{code:`FETCH_FAILED_AFTER_RETRIES`,message:(e,t)=>`Failed to fetch after ${e} attempts: ${t}`},FETCH_HTTP_ERROR:{code:`FETCH_HTTP_ERROR`,message:(e,t)=>`Failed to fetch (${e} ${t})`}},Eb={INVALID_FORMAT:{code:`TOOL_METADATA_INVALID_FORMAT`,message:`Invalid tool metadata format from remote source.`},INVALID_API_RESPONSE:{code:`TOOL_METADATA_INVALID_API_RESPONSE`,message:`Invalid API response structure`}},Db={PATH_IS_DIRECTORY:{code:`FILE_PATH_IS_DIRECTORY`,message:e=>`Path is a directory. Use ${e} to list directory contents`},FILE_TOO_LARGE:{code:`FILE_TOO_LARGE`,message:(e,t,n)=>`File too large (${e}KB > ${t}KB). Use ${n} to search within the file or use startLine/endLine parameters to get specific sections`},FILE_EMPTY:{code:`FILE_EMPTY`,message:`File is empty - no content to display`},BINARY_FILE:{code:`FILE_BINARY`,message:`Binary file detected. Cannot display as text - download directly from GitHub`},DECODE_FAILED:{code:`FILE_DECODE_FAILED`,message:`Failed to decode file. Encoding may not be supported (expected UTF-8)`},UNSUPPORTED_TYPE:{code:`FILE_UNSUPPORTED_TYPE`,message:e=>`Unsupported file type: ${e}`},MATCH_STRING_NOT_FOUND:{code:`FILE_MATCH_STRING_NOT_FOUND`,message:e=>`Match string "${e}" not found in file. The file may have changed since the search was performed.`}},Ob={NOT_FOUND:{code:`REPO_NOT_FOUND`,message:(e,t,n)=>`Repository "${e}/${t}" not found or not accessible: ${n}`},PATH_NOT_FOUND:{code:`REPO_PATH_NOT_FOUND`,message:(e,t,n,r)=>`Path "${e}" not found in repository "${t}/${n}" on branch "${r}"`},PATH_NOT_FOUND_ANY_BRANCH:{code:`REPO_PATH_NOT_FOUND_ANY_BRANCH`,message:(e,t,n)=>`Path "${e}" not found in repository "${t}/${n}" on any common branch`},ACCESS_FAILED:{code:`REPO_ACCESS_FAILED`,message:(e,t,n)=>`Failed to access repository "${e}/${t}": ${n}`},BRANCH_NOT_FOUND:{code:`REPO_BRANCH_NOT_FOUND`,message:e=>`Branch '${e}' not found. Ask user: Do you want to get the file from the default branch instead?`},STRUCTURE_EXPLORATION_FAILED:{code:`REPO_STRUCTURE_EXPLORATION_FAILED`,message:`Failed to explore repository structure`}},kb={QUERY_EMPTY:{code:`SEARCH_QUERY_EMPTY`,message:`Search query cannot be empty`},NO_VALID_PARAMETERS:{code:`SEARCH_NO_VALID_PARAMETERS`,message:`No valid search parameters provided`},PR_REQUIRED_PARAMS:{code:`SEARCH_PR_REQUIRED_PARAMS`,message:`Owner, repo, and prNumber are required parameters`},PR_SINGLE_VALUES:{code:`SEARCH_PR_SINGLE_VALUES`,message:`Owner and repo must be single values`},API_REQUEST_FAILED:{code:`SEARCH_API_REQUEST_FAILED`,message:e=>`API request failed: ${e}`},PULL_REQUEST_SEARCH_FAILED:{code:`SEARCH_PR_SEARCH_FAILED`,message:e=>`Pull request search failed: ${e}`},PULL_REQUEST_LIST_FAILED:{code:`SEARCH_PR_LIST_FAILED`,message:e=>`Pull request list failed: ${e}`},PULL_REQUEST_FETCH_FAILED:{code:`SEARCH_PR_FETCH_FAILED`,message:(e,t)=>`Failed to fetch pull request #${e}: ${t}`}},Ab={NO_TOOLS_REGISTERED:{code:`STARTUP_NO_TOOLS_REGISTERED`,message:`No tools were successfully registered`},UNCAUGHT_EXCEPTION:{code:`STARTUP_UNCAUGHT_EXCEPTION`,message:e=>`Uncaught exception: ${e}`},UNHANDLED_REJECTION:{code:`STARTUP_UNHANDLED_REJECTION`,message:e=>`Unhandled rejection: ${e}`},STARTUP_FAILED:{code:`STARTUP_FAILED`,message:e=>`Startup failed: ${e}`}},jb={TIMEOUT:{code:`PROMISE_TIMEOUT`,message:(e,t)=>`Promise ${e} timed out after ${t}ms`},NOT_A_FUNCTION:{code:`PROMISE_NOT_A_FUNCTION`,message:e=>`Promise function at index ${e} is not a function`},FUNCTION_UNDEFINED:{code:`PROMISE_FUNCTION_UNDEFINED`,message:`Promise function is undefined`}},Mb={EXECUTION_FAILED:{code:`TOOL_EXECUTION_FAILED`,message:(e,t)=>`Tool ${e} execution failed: ${t}`},SECURITY_VALIDATION_FAILED:{code:`TOOL_SECURITY_VALIDATION_FAILED`,message:(e,t)=>`Security validation failed for ${e}: ${t}`}};({...Cb,...wb,...Tb,...Eb,...Db,...Ob,...kb,...Ab,...jb,...Mb});const Nb={PATH_VALIDATION_FAILED:`pathValidationFailed`,FILE_ACCESS_FAILED:`fileAccessFailed`,FILE_READ_FAILED:`fileReadFailed`,FILE_TOO_LARGE:`fileTooLarge`,NO_MATCHES:`noMatches`,PATTERN_TOO_BROAD:`patternTooBroad`,PAGINATION_REQUIRED:`paginationRequired`,OUTPUT_TOO_LARGE:`outputTooLarge`,RESPONSE_TOO_LARGE:`responseTooLarge`,COMMAND_NOT_AVAILABLE:`commandNotAvailable`,COMMAND_EXECUTION_FAILED:`commandExecutionFailed`,COMMAND_TIMEOUT:`commandTimeout`,QUERY_EXECUTION_FAILED:`queryExecutionFailed`,TOOL_EXECUTION_FAILED:`toolExecutionFailed`};let Pb=function(e){return e.FILE_SYSTEM=`FILE_SYSTEM`,e.VALIDATION=`VALIDATION`,e.SEARCH=`SEARCH`,e.PAGINATION=`PAGINATION`,e.EXECUTION=`EXECUTION`,e}({});const Fb={[Nb.PATH_VALIDATION_FAILED]:{code:Nb.PATH_VALIDATION_FAILED,category:Pb.VALIDATION,description:`Path validation failed - invalid or unsafe path`,recoverability:`user-action-required`},[Nb.FILE_ACCESS_FAILED]:{code:Nb.FILE_ACCESS_FAILED,category:Pb.FILE_SYSTEM,description:`Cannot access file - may not exist or lack permissions`,recoverability:`unrecoverable`},[Nb.FILE_READ_FAILED]:{code:Nb.FILE_READ_FAILED,category:Pb.FILE_SYSTEM,description:`Failed to read file contents`,recoverability:`unrecoverable`},[Nb.FILE_TOO_LARGE]:{code:Nb.FILE_TOO_LARGE,category:Pb.FILE_SYSTEM,description:`File exceeds size limits for operation`,recoverability:`user-action-required`},[Nb.NO_MATCHES]:{code:Nb.NO_MATCHES,category:Pb.SEARCH,description:`Search pattern found no matches`,recoverability:`user-action-required`},[Nb.PATTERN_TOO_BROAD]:{code:Nb.PATTERN_TOO_BROAD,category:Pb.SEARCH,description:`Search pattern is too broad and would return too many results`,recoverability:`user-action-required`},[Nb.PAGINATION_REQUIRED]:{code:Nb.PAGINATION_REQUIRED,category:Pb.PAGINATION,description:`Result set too large - pagination required`,recoverability:`user-action-required`},[Nb.OUTPUT_TOO_LARGE]:{code:Nb.OUTPUT_TOO_LARGE,category:Pb.PAGINATION,description:`Output exceeds size limits`,recoverability:`user-action-required`},[Nb.RESPONSE_TOO_LARGE]:{code:Nb.RESPONSE_TOO_LARGE,category:Pb.PAGINATION,description:`Response exceeds maximum allowed size`,recoverability:`user-action-required`},[Nb.COMMAND_NOT_AVAILABLE]:{code:Nb.COMMAND_NOT_AVAILABLE,category:Pb.EXECUTION,description:`Required CLI command is not installed or not in PATH`,recoverability:`user-action-required`},[Nb.COMMAND_EXECUTION_FAILED]:{code:Nb.COMMAND_EXECUTION_FAILED,category:Pb.EXECUTION,description:`System command execution failed`,recoverability:`unrecoverable`},[Nb.COMMAND_TIMEOUT]:{code:Nb.COMMAND_TIMEOUT,category:Pb.EXECUTION,description:`Command execution timed out`,recoverability:`user-action-required`},[Nb.QUERY_EXECUTION_FAILED]:{code:Nb.QUERY_EXECUTION_FAILED,category:Pb.EXECUTION,description:`Query execution failed`,recoverability:`unrecoverable`},[Nb.TOOL_EXECUTION_FAILED]:{code:Nb.TOOL_EXECUTION_FAILED,category:Pb.EXECUTION,description:`Generic tool execution failure`,recoverability:`unrecoverable`}};var Ib=class e extends Error{errorCode;category;recoverability;context;constructor(t,n,r,i){let a=Fb[t],o=n||a.description;super(o,i?{cause:i}:void 0),this.name=`ToolError`,this.errorCode=t,this.category=a.category,this.recoverability=a.recoverability,this.context=r,i&&i.stack&&(this.stack=`${this.stack}\nCaused by: ${i.stack}`),Object.setPrototypeOf(this,e.prototype)}isRecoverable(){return this.recoverability===`recoverable`}requiresUserAction(){return this.recoverability===`user-action-required`}toJSON(){return{name:this.name,errorCode:this.errorCode,category:this.category,message:this.message,recoverability:this.recoverability,context:this.context,stack:this.stack}}};function Lb(e){return e instanceof Ib}function Rb(e,t=Nb.TOOL_EXECUTION_FAILED,n){return Lb(e)?e:e instanceof Error?new Ib(t,e.message,n,e):new Ib(t,String(e),n)}const zb={pathValidationFailed:(e,t,n)=>new Ib(Nb.PATH_VALIDATION_FAILED,t||`Path validation failed: ${Sb(e,n)}`,{path:e}),fileAccessFailed:(e,t,n)=>{let r=Sb(e,n),i=`Cannot access file: ${r}`,a=t?.code;return a===`ENOENT`?i=`File not found: ${r}. Verify the path exists using localFindFiles.`:a===`EACCES`?i=`Permission denied: ${r}. Check file permissions.`:a===`EISDIR`?i=`Path is a directory: ${r}. Use localViewStructure instead.`:a===`ENOTDIR`?i=`Invalid path: ${r}. A component of the path is not a directory.`:a===`ENAMETOOLONG`&&(i=`Path too long: ${r}`),new Ib(Nb.FILE_ACCESS_FAILED,i,{path:e,errorCode:a},t)},fileReadFailed:(e,t,n)=>new Ib(Nb.FILE_READ_FAILED,`Failed to read file: ${Sb(e,n)}`,{path:e},t),fileTooLarge:(e,t,n)=>new Ib(Nb.FILE_TOO_LARGE,(()=>{let e=e=>Number.isInteger(e)?`${e}KB`:`${e.toFixed(1)}KB`;return`File too large: ${e(t)} (limit: ${e(n)})`})(),{path:e,sizeKB:t,limitKB:n}),noMatches:(e,t)=>new Ib(Nb.NO_MATCHES,`No matches found for pattern: ${e}`,{pattern:e,...t}),patternTooBroad:(e,t)=>new Ib(Nb.PATTERN_TOO_BROAD,`Pattern too broad: ${t} matches found`,{pattern:e,matchCount:t}),paginationRequired:e=>new Ib(Nb.PAGINATION_REQUIRED,`Pagination required: ${e} characters`,{itemCount:e}),outputTooLarge:(e,t)=>new Ib(Nb.OUTPUT_TOO_LARGE,`Output too large: ${e} (limit: ${t})`,{size:e,limit:t}),responseTooLarge:(e,t)=>new Ib(Nb.RESPONSE_TOO_LARGE,`Response too large: ${e} tokens (limit: ${t})`,{tokens:e,limit:t}),commandNotAvailable:(e,t)=>new Ib(Nb.COMMAND_NOT_AVAILABLE,`Command '${e}' is not available. ${t||`Please install it and ensure it is in your PATH.`}`,{command:e,installHint:t}),commandExecutionFailed:(e,t,n)=>new Ib(Nb.COMMAND_EXECUTION_FAILED,n?`Command '${e}' failed: ${n}`:`Command execution failed: ${e}`,{command:e,stderr:n},t),commandTimeout:(e,t)=>new Ib(Nb.COMMAND_TIMEOUT,`Command '${e}' timed out after ${t}ms. Try a narrower search path or add filters.`,{command:e,timeoutMs:t}),queryExecutionFailed:(e,t)=>new Ib(Nb.QUERY_EXECUTION_FAILED,`Query execution failed`,{queryId:e},t),toolExecutionFailed:(e,t)=>new Ib(Nb.TOOL_EXECUTION_FAILED,`Tool execution failed: ${e}`,{toolName:e},t)};zb.commandNotAvailable,zb.commandExecutionFailed,zb.commandTimeout,zb.queryExecutionFailed,zb.toolExecutionFailed;const Bb=[{name:`openaiApiKey`,description:`OpenAI API key`,regex:/\b(sk-[a-zA-Z0-9_-]+T3BlbkFJ[a-zA-Z0-9_-]+)\b/g,matchAccuracy:`high`},{name:`openaiOrgId`,description:`OpenAI organization ID`,regex:/\borg-[a-zA-Z0-9]{20,}\b/g,matchAccuracy:`high`},{name:`groqApiKey`,description:`Groq API key`,regex:/\bgsk_[a-zA-Z0-9-_]{51,52}\b/g,matchAccuracy:`high`},{name:`cohereApiKey`,description:`Cohere API key`,regex:/\bco-[a-zA-Z0-9-_]{38,64}\b/g,matchAccuracy:`high`},{name:`huggingFaceToken`,description:`Hugging Face API token`,regex:/\bhf_[a-zA-Z0-9]{34}\b/g,matchAccuracy:`high`},{name:`perplexityApiKey`,description:`Perplexity AI API key`,regex:/\bpplx-[a-zA-Z0-9]{30,64}\b/g,matchAccuracy:`high`},{name:`replicateApiToken`,description:`Replicate API token`,regex:/\br8_[a-zA-Z0-9]{30,}\b/g,matchAccuracy:`high`},{name:`anthropicApiKey`,description:`Anthropic API key`,regex:/\b(sk-ant-(?:admin01|api03)-[\w-]{93}AA)\b/g,matchAccuracy:`high`},{name:`mistralApiKey`,description:`Mistral AI API key`,regex:/\b(?:mistral-|mist_)[a-zA-Z0-9]{32,}\b/g,matchAccuracy:`high`},{name:`tavilyApiKey`,description:`Tavily API key`,regex:/\btvly-[a-zA-Z0-9]{30,}\b/g,matchAccuracy:`high`},{name:`deepseekApiKey`,description:`DeepSeek API key`,regex:/\bsk-[a-zA-Z0-9]{32,64}\b/g,matchAccuracy:`medium`},{name:`togetherApiKey`,description:`Together AI API key`,regex:/\b['"]?(?:TOGETHER|together)_?(?:API|api)?_?(?:KEY|key)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{40,64}['"]?\b/g,matchAccuracy:`medium`},{name:`fireworksApiKey`,description:`Fireworks AI API key`,regex:/\b['"]?(?:FIREWORKS|fireworks)_?(?:API|api)?_?(?:KEY|key)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{40,64}['"]?\b/g,matchAccuracy:`medium`},{name:`xaiApiKey`,description:`xAI (Grok) API key`,regex:/\bxai-[a-zA-Z0-9]{48,}\b/g,matchAccuracy:`high`},{name:`openRouterApiKey`,description:`OpenRouter API key`,regex:/\bsk-or-v1-[a-zA-Z0-9]{64}\b/g,matchAccuracy:`high`},{name:`amazonBedrockApiKey`,description:`Amazon Bedrock API key`,regex:/\bABSK[A-Za-z0-9+/]{109,269}={0,2}\b/g,matchAccuracy:`high`},{name:`ai21ApiKey`,description:`AI21 Labs API key`,regex:/\b['"]?(?:AI21|ai21)_?(?:API|api)?_?(?:KEY|key)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{40,64}['"]?\b/g,matchAccuracy:`medium`},{name:`stabilityApiKey`,description:`Stability AI API key`,regex:/\bsk-[a-zA-Z0-9]{48,}\b/g,matchAccuracy:`medium`},{name:`voyageApiKey`,description:`Voyage AI API key`,regex:/\bpa-[a-zA-Z0-9]{40,}\b/g,matchAccuracy:`high`}],Vb=[{name:`awsAccessKeyId`,description:`AWS access key ID`,regex:/\b((?:AKIA|ABIA|ACCA)[A-Z0-9]{16})\b/g,matchAccuracy:`high`},{name:`awsAccountId`,description:`AWS account ID`,regex:/\b['"]?(?:AWS|aws|Aws)?_?(?:ACCOUNT|account|Account)_?(?:ID|id|Id)?['"]?\s*(?::|=>|=)\s*['"]?[0-9]{12}['"]?\b/g,matchAccuracy:`high`},{name:`awsAppSyncApiKey`,description:`AWS AppSync GraphQL API key`,regex:/\bda2-[a-z0-9]{26}\b/g,matchAccuracy:`high`},{name:`awsIamRoleArn`,description:`AWS IAM role ARN`,regex:/\barn:aws:iam::[0-9]{12}:role\/[a-zA-Z0-9_+=,.@-]+\b/g,matchAccuracy:`high`},{name:`awsLambdaFunctionArn`,description:`AWS Lambda function ARN`,regex:/\barn:aws:lambda:[a-z0-9-]+:[0-9]{12}:function:[a-zA-Z0-9_-]+\b/g,matchAccuracy:`high`},{name:`awsMwsAuthToken`,description:`AWS MWS authentication token`,regex:/\bamzn\.mws\.[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/g,matchAccuracy:`high`},{name:`awsS3BucketArn`,description:`AWS S3 bucket ARN`,regex:/\barn:aws:s3:::[a-zA-Z0-9._-]+\b/g,matchAccuracy:`high`},{name:`alibabaAccessKeyId`,description:`Alibaba Cloud AccessKey ID`,regex:/\bLTAI[a-zA-Z0-9]{20}\b/g,matchAccuracy:`high`},{name:`awsSecretAccessKey`,description:`AWS secret access key`,regex:/\b['"]?(?:AWS|aws|Aws)?_?(?:SECRET|secret|Secret)_?(?:ACCESS|access|Access)_?(?:KEY|key|Key)['"]?\s*(?::|=>|=)\s*['"]?[A-Za-z0-9/+=]{40}['"]?\b/g,matchAccuracy:`high`},{name:`awsSessionToken`,description:`AWS session token`,regex:/\b['"]?(?:AWS|aws|Aws)?_?(?:SESSION|session|Session)_?(?:TOKEN|token|Token)['"]?\s*(?::|=>|=)\s*['"]?[A-Za-z0-9/+=]{200,}['"]?\b/g,matchAccuracy:`high`},{name:`awsSecretsManagerArn`,description:`AWS Secrets Manager secret ARN`,regex:/\barn:aws:secretsmanager:[a-z0-9-]+:[0-9]{12}:secret:[a-zA-Z0-9/_+=.@-]+\b/g,matchAccuracy:`high`}],Hb=[{name:`vercelToken`,description:`Vercel API token`,regex:/\bvercel_[a-zA-Z0-9]{24}\b/g},{name:`posthogApiKey`,description:`PostHog API key`,regex:/\bphc_[a-zA-Z0-9_-]{39}\b/g,matchAccuracy:`high`},{name:`posthogPersonalApiKey`,description:`PostHog personal API key`,regex:/\bphx_[a-zA-Z0-9_-]{39}\b/g,matchAccuracy:`high`},{name:`datadogApiKey`,description:`Datadog API and application keys (with context)`,regex:/\bdatadog[\s\w]*(?:api|app)[\s\w]*key[\s:=]*["']?[a-fA-F0-9]{32,40}["']?/gi,matchAccuracy:`medium`},{name:`honeycombApiKey`,description:`Honeycomb API key`,regex:/\bhcaik_[a-zA-Z0-9_-]{32,64}\b/g,matchAccuracy:`high`}],Ub=[{name:`jwtToken`,description:`JWT (JSON Web Token - 3-part)`,regex:/\b(ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9/_-]{17,}\.(?:[a-zA-Z0-9/_-]{10,}={0,2})?)\b/g,matchAccuracy:`high`},{name:`sessionIds`,description:`Session IDs / Cookies`,regex:/(?:JSESSIONID|PHPSESSID|ASP\.NET_SessionId|connect\.sid|session_id)=([a-zA-Z0-9%:._-]+)/gi,matchAccuracy:`high`},{name:`googleOauthToken`,description:`Google OAuth token`,regex:/\bya29\.[a-zA-Z0-9_-]+\b/g,matchAccuracy:`high`},{name:`onePasswordSecretKey`,description:`1Password secret key`,regex:/\bA3-[A-Z0-9]{6}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}\b/g,matchAccuracy:`high`},{name:`onePasswordServiceAccountToken`,description:`1Password service account token`,regex:/\bops_eyJ[a-zA-Z0-9+/]+={0,2}\b/g,matchAccuracy:`high`},{name:`jsonWebTokenEnhanced`,description:`JSON Web Token with enhanced detection`,regex:/\bey[a-zA-Z0-9]+\.ey[a-zA-Z0-9/_-]+\.(?:[a-zA-Z0-9/_-]+={0,2})?\b/g,matchAccuracy:`high`},{name:`authressServiceClientAccessKey`,description:`Authress service client access key`,regex:/\b(?:sc|ext|scauth|authress)_[a-z0-9]+\.[a-z0-9]+\.acc[_-][a-z0-9-]+\.[a-z0-9+/_=-]+\b/gi,matchAccuracy:`high`}],Wb=[{name:`googleApiKey`,description:`Google API key`,regex:/\bAIza[a-zA-Z0-9_-]{30,}\b/g,matchAccuracy:`high`},{name:`googleAiApiKey`,description:`Google AI API key`,regex:/\bAIza[0-9A-Za-z_-]{30,}\b/g,matchAccuracy:`high`},{name:`googleOAuth2ClientId`,description:`Google OAuth2 client ID`,regex:/\b[0-9]+-[a-z0-9]+\.apps\.googleusercontent\.com\b/g,matchAccuracy:`high`},{name:`googleOAuthClientSecret`,description:`Google OAuth client secret`,regex:/\b"client_secret":\s*"[a-zA-Z0-9-_]{24}"\b/g,matchAccuracy:`high`},{name:`gcpServiceAccountEmail`,description:`GCP service account email`,regex:/\b[a-z0-9-]+@[a-z0-9-]+\.iam\.gserviceaccount\.com\b/g,matchAccuracy:`high`},{name:`azureStorageConnectionString`,description:`Azure storage account connection string`,regex:/\bDefaultEndpointsProtocol=https?;AccountName=[a-z0-9]+;AccountKey=[a-zA-Z0-9+/]+={0,2};EndpointSuffix=core\.windows\.net\b/g,matchAccuracy:`high`},{name:`azureSubscriptionId`,description:`Azure subscription ID`,regex:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.onmicrosoft\.com\b/g,matchAccuracy:`high`},{name:`azureCosmosDbConnectionString`,description:`Azure Cosmos DB connection string`,regex:/\bAccountEndpoint=https:\/\/[a-z0-9-]+\.documents\.azure\.com:443\/;AccountKey=[a-zA-Z0-9+/]+={0,2}\b/g,matchAccuracy:`high`},{name:`azureServiceBusConnectionString`,description:`Azure Service Bus connection string`,regex:/\bEndpoint=sb:\/\/[a-z0-9-]+\.servicebus\.windows\.net\/;SharedAccessKeyName=[a-zA-Z0-9]+;SharedAccessKey=[a-zA-Z0-9+/]+={0,2}\b/g,matchAccuracy:`high`},{name:`dropboxAccessToken`,description:`Dropbox access token`,regex:/\bsl\.[a-zA-Z0-9_-]{64}\b/g,matchAccuracy:`high`},{name:`dropboxAppKey`,description:`Dropbox app key`,regex:/\b[a-z0-9]{15}\.(?:app|apps)\.dropbox\.com\b/g,matchAccuracy:`high`},{name:`supabaseServiceKey`,description:`Supabase service role key`,regex:/\bsbp_[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`planetScaleConnectionString`,description:`PlanetScale connection string`,regex:/\bmysql:\/\/[a-zA-Z0-9_-]+:[a-zA-Z0-9_=-]+@[a-z0-9.-]+\.psdb\.cloud\/[a-zA-Z0-9_-]+\?sslaccept=strict\b/g,matchAccuracy:`high`},{name:`planetScaleToken`,description:`PlanetScale API token`,regex:/\bpscale_tkn_[a-zA-Z0-9_-]{38,43}\b/g,matchAccuracy:`high`},{name:`sendgridApiKey`,description:`SendGrid API key`,regex:/\bSG\.[A-Za-z0-9_-]{20,22}\.[A-Za-z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`mailgunApiKey`,description:`Mailgun API key`,regex:/\bkey-[0-9a-z]{32}\b/g,matchAccuracy:`high`},{name:`mailchimpApiKey`,description:`MailChimp API key`,regex:/\b[0-9a-f]{32}-us[0-9]{1,2}\b/g,matchAccuracy:`high`},{name:`discordBotToken`,description:`Discord bot token`,regex:/\b[MN][A-Za-z\d]{23}\.[\w-]{6}\.[\w-]{27}\b/g,matchAccuracy:`high`},{name:`discordWebhookUrl`,description:`Discord webhook URL`,regex:/\bhttps:\/\/discord\.com\/api\/webhooks\/[0-9]{18}\/[A-Za-z0-9_-]{68}\b/g,matchAccuracy:`high`},{name:`telegramBotToken`,description:`Telegram bot token`,regex:/\b[0-9]{8,10}:[A-Za-z0-9_-]{35}\b/g,matchAccuracy:`high`},{name:`twilioApiKey`,description:`Twilio API key`,regex:/\bSK[a-z0-9]{32}\b/g,matchAccuracy:`high`},{name:`twilioAccountSid`,description:`Twilio account SID`,regex:/\bAC[0-9a-fA-F]{32}\b/g,matchAccuracy:`high`},{name:`dockerHubToken`,description:`Docker Hub personal access token`,regex:/\bdckr_pat_[a-zA-Z0-9_]{36}\b/g,matchAccuracy:`high`},{name:`pypiApiToken`,description:`PyPI API token`,regex:/\bpypi-[a-zA-Z0-9_-]{84}\b/g,matchAccuracy:`high`},{name:`figmaToken`,description:`Figma personal access token`,regex:/\bfigd_[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`renderToken`,description:`Render API token`,regex:/\brnd_[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`airtablePersonalAccessToken`,description:`Airtable personal access token`,regex:/\bpat[a-zA-Z0-9]{14}\.[a-zA-Z0-9]{64}\b/g,matchAccuracy:`high`},{name:`typeformToken`,description:`Typeform API token`,regex:/\btfp_[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`intercomAccessToken`,description:`Intercom access token`,regex:/\bdG9rOi[a-zA-Z0-9+/]{46,48}={0,2}\b/g,matchAccuracy:`high`},{name:`digitalOceanToken`,description:`DigitalOcean API token`,regex:/\bdop_v1_[a-f0-9]{64}\b/g,matchAccuracy:`high`},{name:`digitalOceanOAuthToken`,description:`DigitalOcean OAuth access token`,regex:/\bdoo_v1_[a-f0-9]{64}\b/g,matchAccuracy:`high`},{name:`digitalOceanRefreshToken`,description:`DigitalOcean OAuth refresh token`,regex:/\bdor_v1_[a-f0-9]{64}\b/g,matchAccuracy:`high`},{name:`cloudflareApiKey`,description:`Cloudflare API key`,regex:/\b['"]?(?:cloudflare)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9_-]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`cloudflareGlobalApiKey`,description:`Cloudflare Global API key`,regex:/\b['"]?(?:cloudflare)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{37}['"]?\b/gi,matchAccuracy:`medium`},{name:`cloudflareOriginCaKey`,description:`Cloudflare Origin CA key`,regex:/\bv1\.0-[a-f0-9]{24}-[a-f0-9]{146}\b/g,matchAccuracy:`high`},{name:`flyioAccessToken`,description:`Fly.io API access token`,regex:/\bfo1_[\w-]{43}\b/g,matchAccuracy:`high`},{name:`flyioMachineToken`,description:`Fly.io machine token`,regex:/\bfm[12][ar]?_[a-zA-Z0-9+/]{100,}={0,3}\b/g,matchAccuracy:`high`},{name:`dopplerApiToken`,description:`Doppler API token`,regex:/\bdp\.pt\.[a-z0-9]{43}\b/gi,matchAccuracy:`high`},{name:`dynatraceApiToken`,description:`Dynatrace API token`,regex:/\bdt0c01\.[a-z0-9]{24}\.[a-z0-9]{64}\b/gi,matchAccuracy:`high`},{name:`netlifyAccessToken`,description:`Netlify access token`,regex:/\b['"]?(?:netlify)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9=_-]{40,46}['"]?\b/gi,matchAccuracy:`medium`},{name:`scalingoApiToken`,description:`Scalingo API token`,regex:/\btk-us-[\w-]{48}\b/g,matchAccuracy:`high`},{name:`infracostApiToken`,description:`Infracost API token`,regex:/\bico-[a-zA-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`harnessApiKey`,description:`Harness Access Token (PAT or SAT)`,regex:/\b(?:pat|sat)\.[a-zA-Z0-9_-]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}\b/g,matchAccuracy:`high`},{name:`azureAdClientSecret`,description:`Azure AD client secret`,regex:/(?:^|[\\'"` \s>=:(,)])([a-zA-Z0-9_~.]{3}\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\'"` \s<),])/g,matchAccuracy:`high`},{name:`herokuApiKeyV2`,description:`Heroku API key (new format)`,regex:/\bHRKU-AA[0-9a-zA-Z_-]{58}\b/g,matchAccuracy:`high`},{name:`microsoftTeamsWebhook`,description:`Microsoft Teams incoming webhook URL`,regex:/https:\/\/[a-z0-9]+\.webhook\.office\.com\/webhookb2\/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}\/IncomingWebhook\/[a-z0-9]{32}\/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/gi,matchAccuracy:`high`},{name:`oktaAccessToken`,description:`Okta access token`,regex:/\b['"]?(?:okta)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?00[\w=-]{40}['"]?\b/gi,matchAccuracy:`high`},{name:`openshiftUserToken`,description:`OpenShift user token`,regex:/\bsha256~[\w-]{43}\b/g,matchAccuracy:`high`}],Gb=[{name:`jwtSecrets`,description:`JWT secrets`,regex:/\bjwt[_-]?secret\s*[:=]\s*['"][^'"]{16,}['"]\b/gi,matchAccuracy:`high`},{name:`kubernetesSecrets`,description:`Kubernetes secrets in YAML`,regex:/\bkind:\s*["']?Secret["']?[\s\S]{0,2000}?\bdata:\s*[\s\S]{0,2000}?[a-zA-Z0-9_-]+:\s*[a-zA-Z0-9+/]{16,}={0,3}\b/gi,matchAccuracy:`high`,fileContext:/\.ya?ml$/i},{name:`dockerComposeSecrets`,description:`Docker Compose secrets`,regex:/\b(?:MYSQL_ROOT_PASSWORD|POSTGRES_PASSWORD|REDIS_PASSWORD|MONGODB_PASSWORD)\s*[:=]\s*['"][^'"]{4,}['"]\b/gi,matchAccuracy:`medium`,fileContext:/docker-compose\.ya?ml$/i},{name:`springBootSecrets`,description:`Spring Boot application secrets`,regex:/\b(?:spring\.datasource\.password|spring\.security\.oauth2\.client\.registration\..*\.client-secret)\s*[:=]\s*['"][^'"]{4,}['"]\b/gi,matchAccuracy:`medium`,fileContext:/(?:application|bootstrap)(?:-\w+)?\.(?:properties|ya?ml)$/i},{name:`dotnetConnectionStrings`,description:`.NET connection strings with credentials`,regex:/\b(?:ConnectionStrings?|connectionString)\s*[:=]\s*['"][^'"]*(?:password|pwd)\s*=\s*[^;'"]{4,}[^'"]*['"]\b/gi,matchAccuracy:`medium`,fileContext:/(?:appsettings|web\.config).*\.(?:json|config)$/i},{name:`base64EncodedSecrets`,description:`Base64 encoded secrets in config`,regex:/\b(?:secret|password|key|token)[_-]?(?:base64|encoded)?\s*[:=]\s*['"][A-Za-z0-9+/]{32,}={0,3}['"]\b/gi,matchAccuracy:`medium`}],Kb=[{name:`rsaPrivateKey`,description:`RSA private key`,regex:/-----BEGIN (?:RSA )?PRIVATE KEY-----[\s\S]*?-----END (?:RSA )?PRIVATE KEY-----/g,matchAccuracy:`high`},{name:`pkcs8PrivateKey`,description:`PKCS#8 private key`,regex:/\b-----BEGIN (?:ENCRYPTED )?PRIVATE KEY-----\s*[\s\S]*?-----END (?:ENCRYPTED )?PRIVATE KEY-----\b/g,matchAccuracy:`high`},{name:`ecPrivateKey`,description:`Elliptic Curve private key`,regex:/\b-----BEGIN EC PRIVATE KEY-----\s*[\s\S]*?-----END EC PRIVATE KEY-----\b/g,matchAccuracy:`high`},{name:`dsaPrivateKey`,description:`DSA private key`,regex:/\b-----BEGIN DSA PRIVATE KEY-----\s*[\s\S]*?-----END DSA PRIVATE KEY-----\b/g,matchAccuracy:`high`},{name:`opensshPrivateKey`,description:`OpenSSH private key`,regex:/-----BEGIN OPENSSH PRIVATE KEY-----[\s\S]*?-----END OPENSSH PRIVATE KEY-----/g,matchAccuracy:`high`},{name:`sshPrivateKeyEncrypted`,description:`SSH private key (SSH2 encrypted format)`,regex:/\b-----BEGIN SSH2 ENCRYPTED PRIVATE KEY-----\s*[\s\S]*?-----END SSH2 ENCRYPTED PRIVATE KEY-----\b/g,matchAccuracy:`high`},{name:`puttyPrivateKey`,description:`PuTTY private key file`,regex:/\bPuTTY-User-Key-File-[23]:\s*[\s\S]*?Private-MAC:\b/g,matchAccuracy:`high`},{name:`pgpPrivateKey`,description:`PGP private key block`,regex:/\b-----BEGIN PGP PRIVATE KEY BLOCK-----\s*[\s\S]*?-----END PGP PRIVATE KEY BLOCK-----\b/g,matchAccuracy:`high`},{name:`firebaseServiceAccountPrivateKey`,description:`Firebase service account private key (JSON format)`,regex:/\b"private_key":\s*"-----BEGIN PRIVATE KEY-----\\n[a-zA-Z0-9+/=\\n]+\\n-----END PRIVATE KEY-----"\b/g,matchAccuracy:`high`},{name:`openvpnClientPrivateKey`,description:`OpenVPN client private key`,regex:/\b<key>\s*-----BEGIN[^<]*-----END[^<]*<\/key>\b/g,matchAccuracy:`high`},{name:`dhParameters`,description:`Diffie-Hellman parameters`,regex:/\b-----BEGIN DH PARAMETERS-----\s*[\s\S]*?-----END DH PARAMETERS-----\b/g,matchAccuracy:`high`},{name:`ageSecretKey`,description:`Age encryption secret key`,regex:/\bAGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}\b/g,matchAccuracy:`high`},{name:`vaultBatchToken`,description:`HashiCorp Vault batch token`,regex:/\bhvb\.[a-zA-Z0-9_-]{20,}\b/g,matchAccuracy:`high`},{name:`vaultServiceToken`,description:`HashiCorp Vault service token`,regex:/\bhvs\.[a-zA-Z0-9_-]{20,}\b/g,matchAccuracy:`high`},{name:`vaultPeriodicToken`,description:`HashiCorp Vault periodic token`,regex:/\bhvp\.[a-zA-Z0-9_-]{20,}\b/g,matchAccuracy:`high`},{name:`base64PrivateKeyContent`,description:`Base64 encoded private key content`,regex:/\b(?:private[_-]?key|secret[_-]?key)\s*[:=]\s*["'][A-Za-z0-9+/]{64,}={0,2}["']\b/gi,matchAccuracy:`medium`},{name:`hexEncodedKey`,description:`Hexadecimal encoded cryptographic key`,regex:/\b(?:key|secret)\s*[:=]\s*["'][a-fA-F0-9]{32,}["']\b/gi,matchAccuracy:`medium`}],qb=[{name:`postgresqlConnectionString`,description:`PostgreSQL connection string with credentials`,regex:/\bpostgresql:\/\/[^:]+:[^@]+@[^/\s]+\/[^?\s]+\b/gi,matchAccuracy:`high`},{name:`mysqlConnectionString`,description:`MySQL connection string with credentials`,regex:/\bmysql:\/\/[^:]+:[^@]+@[^/\s]+\/[^?\s]+\b/gi,matchAccuracy:`high`},{name:`mongodbConnectionString`,description:`MongoDB connection string with credentials`,regex:/\bmongodb:\/\/[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+:[0-9]+\/[a-zA-Z0-9._-]+\b/g,matchAccuracy:`high`},{name:`redisConnectionString`,description:`Redis connection string with credentials`,regex:/\bredis:\/\/[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+:[0-9]+\b/g,matchAccuracy:`high`},{name:`redisAuthPassword`,description:`Redis AUTH password command`,regex:/\bAUTH\s+[a-zA-Z0-9_-]{8,}\b/gi,matchAccuracy:`medium`},{name:`elasticsearchCredentials`,description:`Elasticsearch credentials in URL`,regex:/\bhttps?:\/\/[^:]+:[^@]+@[^/\s]+:9200\b/gi,matchAccuracy:`high`},{name:`couchdbCredentials`,description:`CouchDB credentials in URL`,regex:/\bhttp[s]?:\/\/[^:]+:[^@]+@[^/\s]+:5984\b/gi,matchAccuracy:`high`},{name:`neo4jCredentials`,description:`Neo4j database credentials in URL`,regex:/\bbolt[s]?:\/\/[^:]+:[^@]+@[^/\s]+:7687\b/gi,matchAccuracy:`high`},{name:`timescaledbConnectionString`,description:`TimescaleDB connection string with credentials`,regex:/\btimescaledb:\/\/[^:]+:[^@]+@[^/\s]+\/[^?\s]+\b/gi,matchAccuracy:`high`},{name:`clickhouseCredentials`,description:`ClickHouse connection string with credentials`,regex:/\bclickhouse:\/\/[^:]+:[^@]+@[^/\s]+:8123\b/gi,matchAccuracy:`high`},{name:`cassandraConnectionString`,description:`Cassandra connection string with credentials`,regex:/\bcassandra:\/\/[^:]+:[^@]+@[^/\s]+:9042\b/gi,matchAccuracy:`high`},{name:`faunadbKey`,description:`FaunaDB secret key`,regex:/\bfn[a-zA-Z0-9]{40}\b/g,matchAccuracy:`high`},{name:`databricksApiToken`,description:`Databricks API token`,regex:/\bdapi[a-f0-9]{32}(?:-\d)?\b/g,matchAccuracy:`high`},{name:`pineconeApiKey`,description:`Pinecone API key`,regex:/\bpinecone[\s\w]*(?:api|key|env)[\s:=]*["']?[a-zA-Z0-9_-]{32}["']?\b/gi,matchAccuracy:`medium`},{name:`databaseUrlWithCredentials`,description:`Generic database URL with embedded credentials`,regex:/\b(?:postgres|mysql|mongodb|redis):\/\/[^:]+:[^@]+@[^/\s]+\b/gi,matchAccuracy:`medium`},{name:`clickhouseCloudApiKey`,description:`ClickHouse Cloud API secret key`,regex:/\b4b1d[A-Za-z0-9]{38}\b/g,matchAccuracy:`high`},{name:`neonDatabaseConnectionString`,description:`Neon database connection string`,regex:/\bpostgres:\/\/[^:]+:[^@]+@[^/\s]*neon\.tech[^?\s]*\b/gi,matchAccuracy:`high`},{name:`tursoDatabaseToken`,description:`Turso database auth token`,regex:/\b['"]?(?:turso|libsql)(?:[\s\w.-]{0,20})(?:token|auth)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9._-]{50,}['"]?\b/gi,matchAccuracy:`medium`},{name:`upstashRedisToken`,description:`Upstash Redis REST token`,regex:/\b['"]?(?:upstash)(?:[\s\w.-]{0,20})(?:token|key)['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9=]{40,}['"]?\b/gi,matchAccuracy:`medium`}],Jb=[{name:`npmAccessToken`,description:`NPM access token`,regex:/\bnpm_[a-zA-Z0-9]{36}\b/g,matchAccuracy:`high`},{name:`nugetApiKey`,description:`NuGet API key`,regex:/\boy2[a-z0-9]{43}\b/g,matchAccuracy:`high`},{name:`artifactoryApiKey`,description:`JFrog Artifactory API key`,regex:/\bAKCp[A-Za-z0-9]{69}\b/g,matchAccuracy:`high`},{name:`herokuApiKey`,description:`Heroku API key`,regex:/\bheroku.*[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\b/gi,matchAccuracy:`high`},{name:`terraformCloudToken`,description:`Terraform Cloud API token`,regex:/\b[a-zA-Z0-9]{14}\.[a-zA-Z0-9]{6}\.[a-zA-Z0-9]{16}\b/g,matchAccuracy:`high`},{name:`pulumiAccessToken`,description:`Pulumi access token`,regex:/\bpul-[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`atlassianApiToken`,description:`Atlassian API token (Jira/Confluence)`,regex:/\bATATT3[A-Za-z0-9_\-=]{186}\b/g,matchAccuracy:`high`},{name:`sourcegraphApiKey`,description:`Sourcegraph API key`,regex:/\bsgp_[a-zA-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`linearApiKey`,description:`Linear API key`,regex:/\blin_api_[0-9A-Za-z]{40}\b/g,matchAccuracy:`high`},{name:`notionIntegrationToken`,description:`Notion integration token`,regex:/\bntn_[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`stackhawkApiKey`,description:`StackHawk API key`,regex:/\bhawk\.[0-9A-Za-z\-_]{20}\.[0-9A-Za-z\-_]{20}\b/g,matchAccuracy:`high`},{name:`sentryAuthToken`,description:`Sentry authentication token`,regex:/\bsentry[\s\w]*(?:auth|token)[\s:=]*["']?[a-f0-9]{64}["']?\b/gi,matchAccuracy:`medium`},{name:`bugsnagApiKey`,description:`Bugsnag API key`,regex:/\bbugsnag[\s\w]*(?:api|key)[\s:=]*["']?[a-f0-9]{32}["']?\b/gi,matchAccuracy:`medium`},{name:`rollbarAccessToken`,description:`Rollbar access token`,regex:/\brollbar[\s\w]*(?:access|token)[\s:=]*["']?[a-f0-9]{32}["']?\b/gi,matchAccuracy:`medium`},{name:`postmanApiToken`,description:`Postman API token`,regex:/\bPMAK-[a-f0-9]{24}-[a-f0-9]{34}\b/gi,matchAccuracy:`high`},{name:`prefectApiToken`,description:`Prefect API token`,regex:/\bpnu_[a-zA-Z0-9]{36}\b/g,matchAccuracy:`high`},{name:`readmeApiToken`,description:`Readme API token`,regex:/\brdme_[a-z0-9]{70}\b/g,matchAccuracy:`high`},{name:`rubygemsApiToken`,description:`RubyGems API token`,regex:/\brubygems_[a-f0-9]{48}\b/g,matchAccuracy:`high`},{name:`clojarsApiToken`,description:`Clojars API token`,regex:/\bCLOJARS_[a-z0-9]{60}\b/gi,matchAccuracy:`high`},{name:`snykApiToken`,description:`Snyk API token`,regex:/\b['"]?(?:snyk[_.-]?(?:(?:api|oauth)[_.-]?)?(?:key|token))['"]?\s*(?::|=>|=)\s*['"]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"]?\b/gi,matchAccuracy:`high`},{name:`sonarqubeToken`,description:`SonarQube/SonarCloud token`,regex:/\b(?:squ_|sqp_|sqa_)[a-z0-9=_-]{40}\b/gi,matchAccuracy:`high`},{name:`travisciAccessToken`,description:`Travis CI access token`,regex:/\b['"]?(?:travis)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{22}['"]?\b/gi,matchAccuracy:`medium`},{name:`codecovAccessToken`,description:`Codecov access token`,regex:/\b['"]?(?:codecov)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`droneCiAccessToken`,description:`DroneCI access token`,regex:/\b['"]?(?:droneci|drone)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`octopusDeployApiKey`,description:`Octopus Deploy API key`,regex:/\bAPI-[A-Z0-9]{26}\b/g,matchAccuracy:`high`},{name:`circleciToken`,description:`CircleCI personal API token`,regex:/\b['"]?(?:circleci|circle)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`buildkiteAgentToken`,description:`Buildkite agent token`,regex:/\bbkagent_[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`launchdarklyAccessToken`,description:`LaunchDarkly access token`,regex:/\b['"]?(?:launchdarkly)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9=_-]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`algoliaApiKey`,description:`Algolia API key`,regex:/\b['"]?(?:algolia)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{32}['"]?\b/gi,matchAccuracy:`medium`}],Yb=[{name:`shopifyStorefrontAccessToken`,description:`Shopify storefront API access token`,regex:/\bshpatf_[0-9a-f]{32}\b/g,matchAccuracy:`high`},{name:`woocommerceConsumerKey`,description:`WooCommerce consumer key`,regex:/\bck_[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`woocommerceConsumerSecret`,description:`WooCommerce consumer secret`,regex:/\bcs_[a-f0-9]{40}\b/g,matchAccuracy:`high`},{name:`contentfulAccessToken`,description:`Contentful access token`,regex:/\bCFPAT-[0-9a-zA-Z]{20}\b/g,matchAccuracy:`high`},{name:`mailchimpEcommerceApiKey`,description:`MailChimp E-commerce API key`,regex:/\b[0-9a-f]{32}-[a-z]{2,3}[0-9]{1,2}\b/g,matchAccuracy:`high`}],Xb=[{name:`gitlabPersonalAccessToken`,description:`GitLab personal access token`,regex:/\bglpat-[A-Za-z0-9_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabDeployToken`,description:`GitLab deploy token`,regex:/\bgldt-[A-Za-z0-9_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabRunnerToken`,description:`GitLab runner registration token`,regex:/\bglrt-[A-Za-z0-9_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabCiJobToken`,description:`GitLab CI/CD job token`,regex:/\bglcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabRunnerAuthToken`,description:`GitLab runner authentication token`,regex:/\bglrt-[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabPipelineTriggerToken`,description:`GitLab pipeline trigger token`,regex:/\bglptt-[0-9a-f]{40}\b/g,matchAccuracy:`high`},{name:`bitbucketAppPassword`,description:`Bitbucket app password`,regex:/\bATBB[a-zA-Z0-9]{24}\b/g,matchAccuracy:`high`},{name:`githubTokens`,description:`GitHub personal access token (classic)`,regex:/\b((?:ghp|gho|ghu|ghs|ghr|github_pat)_[a-zA-Z0-9_]{36,255})\b/g,matchAccuracy:`high`},{name:`githubAppInstallationToken`,description:`GitHub App installation token`,regex:/\bghs_[0-9a-zA-Z]{37}\b/g,matchAccuracy:`high`},{name:`gitlabScimToken`,description:`GitLab SCIM token`,regex:/\bglsoat-[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabFeatureFlagToken`,description:`GitLab feature flag client token`,regex:/\bglffct-[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabFeedToken`,description:`GitLab feed token`,regex:/\bglft-[0-9a-zA-Z_-]{20}\b/g,matchAccuracy:`high`},{name:`gitlabIncomingMailToken`,description:`GitLab incoming mail token`,regex:/\bglimt-[0-9a-zA-Z_-]{25}\b/g,matchAccuracy:`high`},{name:`gitlabK8sAgentToken`,description:`GitLab Kubernetes agent token`,regex:/\bglagent-[0-9a-zA-Z_-]{50}\b/g,matchAccuracy:`high`},{name:`gitlabOAuthAppSecret`,description:`GitLab OAuth application secret`,regex:/\bgloas-[0-9a-zA-Z_-]{64}\b/g,matchAccuracy:`high`},{name:`gitlabSessionCookie`,description:`GitLab session cookie`,regex:/_gitlab_session=[0-9a-z]{32}/g,matchAccuracy:`high`},{name:`bitbucketRepoToken`,description:`Bitbucket repository access token`,regex:/\bATCTT3[a-zA-Z0-9]{24}\b/g,matchAccuracy:`high`}],Zb=[{name:`mapboxSecretToken`,description:`Mapbox secret access token`,regex:/\bsk\.eyJ[a-zA-Z0-9._-]{87}\b/g,matchAccuracy:`high`},{name:`grafanaCloudApiKey`,description:`Grafana Cloud API key`,regex:/\bglc_[a-zA-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`newRelicApiKey`,description:`New Relic API key`,regex:/\bNRAK-[A-Z0-9]{27}\b/g,matchAccuracy:`high`},{name:`newRelicInsightKey`,description:`New Relic Insights query key`,regex:/\bNRIK-[A-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`newRelicBrowserApiToken`,description:`New Relic browser API token`,regex:/\bNRJS-[a-f0-9]{19}\b/g,matchAccuracy:`high`},{name:`newRelicInsertKey`,description:`New Relic ingest insert key`,regex:/\bNRII-[a-z0-9-]{32}\b/gi,matchAccuracy:`high`},{name:`grafanaApiKey`,description:`Grafana API key`,regex:/\beyJrIjoi[A-Za-z0-9]{70,400}={0,3}\b/gi,matchAccuracy:`high`},{name:`grafanaServiceAccountToken`,description:`Grafana service account token`,regex:/\bglsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8}\b/g,matchAccuracy:`high`},{name:`sentryOrgToken`,description:`Sentry organization token`,regex:/\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}\b/g,matchAccuracy:`high`},{name:`sentryUserToken`,description:`Sentry user token`,regex:/\bsntryu_[a-f0-9]{64}\b/g,matchAccuracy:`high`},{name:`sumoLogicAccessId`,description:`SumoLogic access ID`,regex:/\b['"]?(?:sumo)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?su[a-zA-Z0-9]{12}['"]?\b/gi,matchAccuracy:`high`},{name:`splunkApiToken`,description:`Splunk HEC token`,regex:/\b['"]?(?:splunk)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}['"]?\b/gi,matchAccuracy:`medium`},{name:`logdnaApiKey`,description:`LogDNA/Mezmo API key`,regex:/\b['"]?(?:logdna|mezmo)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`logglyToken`,description:`Loggly customer token`,regex:/\b['"]?(?:loggly)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}['"]?\b/gi,matchAccuracy:`medium`}],Qb=[{name:`stripeSecretKey`,description:`Stripe secret key (sk_*, rk_*)`,regex:/\b[rs]k_live_[a-zA-Z0-9]{20,247}\b/g,matchAccuracy:`high`},{name:`stripeWebhookSecret`,description:`Stripe webhook signing secret`,regex:/\bwhsec_[a-zA-Z0-9]{32,}\b/g,matchAccuracy:`high`},{name:`paypalAccessToken`,description:`PayPal access token`,regex:/\bA21AA[a-zA-Z0-9_-]{50,}\b/g,matchAccuracy:`high`},{name:`paypalBraintreeAccessToken`,description:`PayPal Braintree access token`,regex:/\baccess_token\$(?:production|sandbox)\$[0-9a-z]{16}\$[0-9a-f]{32}\b/g,matchAccuracy:`high`},{name:`squareAccessToken`,description:`Square access token (all formats)`,regex:/\b(?:EAAAE[A-Za-z0-9_-]{94,}|sq0[a-z]?atp-[0-9A-Za-z\-_]{22,26})\b/g,matchAccuracy:`high`},{name:`squareOauthSecret`,description:`Square OAuth secret`,regex:/\bsq0csp-[0-9A-Za-z\-_]{43}\b/g,matchAccuracy:`high`},{name:`squareApplicationId`,description:`Square application ID`,regex:/\bsq0ids-[a-zA-Z0-9_-]{43}\b/g,matchAccuracy:`high`},{name:`shopifyPrivateAppPassword`,description:`Shopify private app password`,regex:/\bshppa_[a-fA-F0-9]{32}\b/g,matchAccuracy:`high`},{name:`shopifyAccessToken`,description:`Shopify access token`,regex:/\bshpat_[a-fA-F0-9]{32}\b/g,matchAccuracy:`high`},{name:`shopifyWebhookToken`,description:`Shopify webhook token`,regex:/\bshpwh_[a-fA-F0-9]{32}\b/g,matchAccuracy:`high`},{name:`adyenApiKey`,description:`Adyen API key`,regex:/\bAQE[a-zA-Z0-9]{70,}\b/g,matchAccuracy:`high`},{name:`razorpayApiKey`,description:`Razorpay API key`,regex:/\brzp_(?:test|live)_[a-zA-Z0-9]{14}\b/g,matchAccuracy:`high`},{name:`flutterwaveKeys`,description:`Flutterwave API keys`,regex:/\bFLW(?:PUBK|SECK)_(?:TEST|LIVE)-[a-h0-9]{32}-X\b/g,matchAccuracy:`high`},{name:`coinbaseAccessToken`,description:`Coinbase access token`,regex:/\b['"]?(?:coinbase)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9_-]{64}['"]?\b/gi,matchAccuracy:`medium`},{name:`krakenAccessToken`,description:`Kraken access token`,regex:/\b['"]?(?:kraken)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9/=_+-]{80,90}['"]?\b/gi,matchAccuracy:`medium`},{name:`kucoinAccessToken`,description:`Kucoin access token`,regex:/\b['"]?(?:kucoin)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{24}['"]?\b/gi,matchAccuracy:`medium`},{name:`kucoinSecretKey`,description:`Kucoin secret key`,regex:/\b['"]?(?:kucoin)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"]?\b/gi,matchAccuracy:`medium`},{name:`bittrexAccessKey`,description:`Bittrex access key`,regex:/\b['"]?(?:bittrex)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`binanceApiKey`,description:`Binance API key`,regex:/\b['"]?(?:binance)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[A-Za-z0-9]{64}['"]?\b/gi,matchAccuracy:`medium`},{name:`bybitApiKey`,description:`Bybit API key`,regex:/\b['"]?(?:bybit)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[A-Za-z0-9]{18,24}['"]?\b/gi,matchAccuracy:`medium`},{name:`gocardlessApiToken`,description:`GoCardless API token`,regex:/\blive_[a-z0-9\-_=]{40}\b/gi,matchAccuracy:`high`},{name:`plaidApiToken`,description:`Plaid API token`,regex:/\baccess-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/g,matchAccuracy:`high`}],$b=[{name:`privateKeyPem`,description:`Private key in PEM format (comprehensive)`,regex:/-----BEGIN\s?(?:(?:RSA|DSA|EC|OPENSSH|ENCRYPTED)\s+)?PRIVATE\s+KEY(?:\s+BLOCK)?-----[\s\S]*?-----END\s?(?:(?:RSA|DSA|EC|OPENSSH|ENCRYPTED)\s+)?PRIVATE\s+KEY(?:\s+BLOCK)?-----/g,matchAccuracy:`high`},{name:`pgpPrivateKeyBlock`,description:`PGP private key block (comprehensive)`,regex:/-----BEGIN\s+PGP\s+PRIVATE\s+KEY\s+BLOCK-----[\s\S]*?-----END\s+PGP\s+PRIVATE\s+KEY\s+BLOCK-----/g,matchAccuracy:`high`}],ex=[{name:`credentialsInUrl`,description:`Credentials embedded in URL`,regex:/\b[a-zA-Z]{3,10}:\/\/[^\\/\s:@]{3,20}:[^\\/\s:@]{3,20}@[^\s'"]+\b/g,matchAccuracy:`high`},{name:`envVarSecrets`,description:`Environment variable secrets (KEY, SECRET, TOKEN, PASSWORD)`,regex:/\b(?:\w+_)?(?:SECRET|secret|password|key|token|jwt_secret)(?:_\w+)?\s*=\s*["'][^"']{16,}["']/gi,matchAccuracy:`medium`}],tx=[{name:`slackBotToken`,description:`Slack bot token`,regex:/\bxoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*\b/g,matchAccuracy:`high`},{name:`slackUserToken`,description:`Slack user token`,regex:/\bxoxp-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*\b/g,matchAccuracy:`high`},{name:`slackWorkspaceToken`,description:`Slack workspace token`,regex:/\bxoxa-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*\b/g,matchAccuracy:`high`},{name:`slackRefreshToken`,description:`Slack refresh token`,regex:/\bxoxr-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*\b/g,matchAccuracy:`high`},{name:`slackWebhookUrl`,description:`Slack incoming webhook URL`,regex:/(?:https?:\/\/)?hooks\.slack\.com\/(?:services|workflows|triggers)\/[A-Za-z0-9+/]{43,56}/gi,matchAccuracy:`high`},{name:`slackAppToken`,description:`Slack app-level token`,regex:/\bxapp-\d-[A-Z0-9]+-\d+-[a-z0-9]+\b/gi,matchAccuracy:`high`},{name:`slackConfigAccessToken`,description:`Slack configuration access token`,regex:/\bxoxe\.xox[bp]-\d-[A-Z0-9]{163,166}\b/gi,matchAccuracy:`high`},{name:`sendbirdAccessToken`,description:`Sendbird access token`,regex:/\b['"]?(?:sendbird)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`messagebirdApiToken`,description:`MessageBird API token`,regex:/\b['"]?(?:messagebird|message_bird|message-bird)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{25}['"]?\b/gi,matchAccuracy:`medium`},{name:`mattermostAccessToken`,description:`Mattermost access token`,regex:/\b['"]?(?:mattermost)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{26}['"]?\b/gi,matchAccuracy:`medium`},{name:`zendeskSecretKey`,description:`Zendesk secret key`,regex:/\b['"]?(?:zendesk)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{40}['"]?\b/gi,matchAccuracy:`medium`},{name:`freshdeskApiKey`,description:`Freshdesk API key`,regex:/\b['"]?(?:freshdesk)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{20}['"]?\b/gi,matchAccuracy:`medium`},{name:`sendinblueApiToken`,description:`Sendinblue (Brevo) API token`,regex:/\bxkeysib-[a-f0-9]{64}-[a-z0-9]{16}\b/g,matchAccuracy:`high`}],nx=[{name:`twitterBearerToken`,description:`Twitter/X Bearer token`,regex:/\bAAAAAAAAAAAAAAAAAAAAA[a-zA-Z0-9%]{50,}\b/g,matchAccuracy:`high`},{name:`facebookAccessToken`,description:`Facebook/Meta access token`,regex:/\bEAA[a-zA-Z0-9]{80,120}\b/g,matchAccuracy:`high`},{name:`facebookPageAccessToken`,description:`Facebook/Meta page access token`,regex:/\bEAAB[a-zA-Z0-9+/]{100,}\b/g,matchAccuracy:`high`},{name:`instagramAccessToken`,description:`Instagram access token`,regex:/\bIGQV[a-zA-Z0-9_-]{100,}\b/g,matchAccuracy:`high`},{name:`discordSocialBotToken`,description:`Discord social bot token`,regex:/\b[MN][A-Za-z\d]{23}\.[A-Za-z\d-_]{6}\.[A-Za-z\d-_]{27}\b/g,matchAccuracy:`high`},{name:`discordSocialWebhookUrl`,description:`Discord social webhook URL`,regex:/\bhttps:\/\/discord(?:app)?\.com\/api\/webhooks\/[0-9]{17,19}\/[A-Za-z0-9_-]{68}\b/g,matchAccuracy:`high`},{name:`pinterestAccessToken`,description:`Pinterest access token`,regex:/\bpina_[a-zA-Z0-9]{32}\b/g,matchAccuracy:`high`},{name:`linkedinApiToken`,description:`LinkedIn API token`,regex:/\b['"]?(?:linkedin|linked_in|linked-in)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-z0-9]{14,16}['"]?\b/gi,matchAccuracy:`medium`},{name:`youtubeApiKey`,description:`YouTube Data API key`,regex:/\b['"]?(?:youtube)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?AIza[a-zA-Z0-9_-]{35}['"]?\b/gi,matchAccuracy:`high`},{name:`tiktokApiToken`,description:`TikTok API token`,regex:/\b['"]?(?:tiktok)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9_-]{40,}['"]?\b/gi,matchAccuracy:`medium`}],rx=[{name:`shippoApiToken`,description:`Shippo API token`,regex:/\bshippo_(?:live|test)_[a-fA-F0-9]{40}\b/g,matchAccuracy:`high`},{name:`easypostApiToken`,description:`EasyPost API token`,regex:/\bEZAK[a-z0-9]{54}\b/gi,matchAccuracy:`high`},{name:`easypostTestApiToken`,description:`EasyPost test API token`,regex:/\bEZTK[a-z0-9]{54}\b/gi,matchAccuracy:`high`},{name:`duffelApiToken`,description:`Duffel travel API token`,regex:/\bduffel_(?:test|live)_[a-z0-9_\-=]{43}\b/gi,matchAccuracy:`high`},{name:`frameioApiToken`,description:`Frame.io API token`,regex:/\bfio-u-[a-z0-9\-_=]{64}\b/gi,matchAccuracy:`high`},{name:`maxmindLicenseKey`,description:`MaxMind license key`,regex:/\b[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk\b/g,matchAccuracy:`high`},{name:`asanaPersonalAccessToken`,description:`Asana personal access token`,regex:/\b['"]?(?:asana)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[0-9]{16}['"]?\b/gi,matchAccuracy:`medium`},{name:`mondayApiToken`,description:`Monday.com API token`,regex:/\b['"]?(?:monday)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?eyJ[a-zA-Z0-9_-]{100,}['"]?\b/gi,matchAccuracy:`medium`},{name:`trelloApiKey`,description:`Trello API key`,regex:/\b['"]?(?:trello)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-f0-9]{32}['"]?\b/gi,matchAccuracy:`medium`},{name:`jiraApiToken`,description:`Jira API token`,regex:/\b['"]?(?:jira)(?:[\s\w.-]{0,20})['"]?\s*(?::|=>|=)\s*['"]?[a-zA-Z0-9]{24}['"]?\b/gi,matchAccuracy:`medium`},{name:`settlemintApplicationAccessToken`,description:`SettleMint application access token`,regex:/\bsm_aat_[a-zA-Z0-9]{16}\b/g,matchAccuracy:`high`},{name:`settlemintPersonalAccessToken`,description:`SettleMint personal access token`,regex:/\bsm_pat_[a-zA-Z0-9]{16}\b/g,matchAccuracy:`high`},{name:`settlemintServiceAccessToken`,description:`SettleMint service access token`,regex:/\bsm_sat_[a-zA-Z0-9]{16}\b/g,matchAccuracy:`high`}],ix=[...Bb,...Hb,...Ub,...Vb,...Wb,...Gb,...Kb,...qb,...Jb,...Yb,...ex,...Zb,...Qb,...$b,...rx,...tx,...nx,...Xb];let ax=null,ox=[];function sx(e){if(!e)return e;let t=cx(),n=[],r;for(;(r=t.exec(e))!==null;){for(let e=0;e<ox.length;e++)if(r.groups?.[`p${e}`]){n.push({start:r.index,end:r.index+r[0].length,accuracy:ox[e]?.matchAccuracy||`medium`});break}r[0].length===0&&t.lastIndex++}if(n.length===0)return e;n.sort((e,t)=>e.start-t.start);let i=[],a=-1;for(let e of n)e.start>=a&&(i.push(e),a=e.end);let o=e;for(let t=i.length-1;t>=0;t--){let n=i[t];if(n){let t=lx(e.slice(n.start,n.end));o=o.slice(0,n.start)+t+o.slice(n.end)}}return o}function cx(){return ax||(ax=ux(ix),ox=ix),ax}function lx(e){let t=``;for(let n=0;n<e.length;n++)n%2==0?t+=`*`:t+=e[n];return t}function ux(e){let t=e.map((e,t)=>`(?<p${t}>${e.regex.source})`);return new RegExp(t.join(`|`),`gi`)}let dx=null,fx=null,px=null,mx=null,hx=jy,gx=Jy,_x=$v;function vx(e){if(e?.trim())return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function yx(e,t){if(e==null)return t;let n=e.trim().toLowerCase();return n===``?t:n===`true`||n===`1`}function bx(e){if(e==null)return!0;let t=e.trim().toLowerCase();return t===``?!0:t!==`false`&&t!==`0`}async function xx(){let e=hx();if(e)return e;try{let e=await _x();if(e?.trim())return e.trim()}catch(e){e instanceof Error&&e.message&&(e.message=sx(e.message))}try{let e=await gx();if(e)return e}catch(e){e instanceof Error&&e.message&&(e.message=sx(e.message))}return null}async function Sx(){if(dx===null){if(px!==null)return px;px=(async()=>{fx=await xx();let e=bx(process.env.LOG),t=yx(process.env.ENABLE_LOCAL,!1)||yx(process.env.LOCAL,!1);dx={version:bb,githubApiUrl:process.env.GITHUB_API_URL?.trim()||`https://api.github.com`,toolsToRun:vx(process.env.TOOLS_TO_RUN),enableTools:vx(process.env.ENABLE_TOOLS),disableTools:vx(process.env.DISABLE_TOOLS),enableLogging:e,timeout:Math.max(3e4,parseInt(process.env.REQUEST_TIMEOUT?.trim()||`30000`)||3e4),maxRetries:Math.max(0,Math.min(10,parseInt(process.env.MAX_RETRIES?.trim()||`3`)||3)),loggingEnabled:e,enableLocal:t}})(),await px}}function Cx(){dx=null,fx=null,px=null,mx=null}function wx(){if(!dx){let e=sx(Cb.NOT_INITIALIZED.message);throw Error(e)}return dx}async function Tx(){return fx||mx||(mx=(async()=>{try{return fx=await xx(),fx}finally{mx=null}})(),mx)}function Ex(){return wx().enableLocal}function Dx(){return dx?.loggingEnabled??!1}var Ox=class{session;logEndpoint=`https://octocode-mcp-host.onrender.com/log`;constructor(){this.session=pb()}getSessionId(){return this.session.sessionId}getSession(){return this.session}async logInit(){await this.sendLog(`init`,{})}async logToolCall(e,t,n,r,i){let a=hb(1);a.session&&(this.session=a.session);let o={tool_name:e,repos:t,...n&&{mainResearchGoal:n},...r&&{researchGoal:r},...i&&{reasoning:i}};await this.sendLog(`tool_call`,o)}async logPromptCall(e){let t=gb(1);t.session&&(this.session=t.session);let n={prompt_name:e};await this.sendLog(`prompt_call`,n)}async logError(e,t){let n=_b(1);n.session&&(this.session=n.session),await this.sendLog(`error`,{error:`${e}:${t}`})}async logRateLimit(e){let t=vb(1);t.session&&(this.session=t.session),await this.sendLog(`rate_limit`,e)}async sendLog(e,t){if(Dx())try{let n={sessionId:this.session.sessionId,intent:e,data:t,timestamp:new Date().toISOString(),version:bb};await qv.post(this.logEndpoint,n,{timeout:5e3,headers:{"Content-Type":`application/json`}})}catch(t){let n=t instanceof Error?t.message:String(t);process.stderr.write(`[session] Failed to send log (${e}): ${n}\n`)}}};let kx=null;function Ax(){return kx||=new Ox,kx}function jx(){return kx}async function Mx(){let e=jx();e&&await e.logInit()}async function Nx(e,t,n,r,i){let a=jx();a&&await a.logToolCall(e,t,n,r,i)}async function Px(e){let t=jx();t&&await t.logPromptCall(e)}async function Fx(e,t){let n=jx();n&&await n.logError(e,t)}async function Ix(e){let t=jx();t&&await t.logRateLimit(e)}function Lx(e,t){let n=t.prompts;if(n)for(let t of Object.values(n)){if(!t||typeof t.name!=`string`||t.name.trim().length===0||typeof t.description!=`string`||t.description.trim().length===0||typeof t.content!=`string`||t.content.trim().length===0)continue;let n={};if(t.args&&Array.isArray(t.args))for(let e of t.args){if(!e||typeof e.name!=`string`)continue;let t=U().describe(e.description);e.required||(t=t.optional()),n[e.name]=t}e.registerPrompt(t.name,{description:t.description,argsSchema:n},async e=>{await Px(t.name);let n=t.content;if(e&&Object.keys(e).length>0){n+=`
|
|
66
66
|
|
|
67
67
|
Use Input
|
|
68
68
|
|