@testream/webdriverio-reporter 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,77 +7,23 @@ Bridges WebdriverIO/Selenium test runs from your codebase into Jira with Testrea
7
7
  ## Quick Start
8
8
 
9
9
  ```bash
10
- npm install --save-dev @testream/webdriverio-reporter
10
+ npm install --save-dev @testream/webdriverio-reporter wdio-ctrf-json-reporter
11
11
  ```
12
12
 
13
- ```typescript
13
+ ```ts
14
14
  // wdio.conf.ts
15
- export const config = {
16
- reporters: [
17
- 'spec',
18
- [
19
- '@testream/webdriverio-reporter',
20
- {
21
- apiKey: process.env.TESTREAM_API_KEY,
22
- uploadEnabled: true,
23
- },
24
- ],
25
- ],
15
+ const testreamConfig = {
16
+ apiKey: process.env.TESTREAM_API_KEY,
17
+ uploadEnabled: true,
26
18
  };
27
- ```
28
-
29
- ## Configuration Options
30
-
31
- | Option | Type | Default | Description |
32
- |--------|------|---------|-------------|
33
- | `apiKey` | string | **required** | Your Testream API key |
34
- | `uploadEnabled` | boolean | `true` | Enable/disable automatic upload |
35
- | `failOnUploadError` | boolean | `false` | Fail the test run if upload fails |
36
- | `outputDir` | string | `'ctrf'` | Directory for CTRF report |
37
- | `outputFile` | string | `'ctrf-report.json'` | Filename for CTRF report |
38
- | `testType` | string | `'e2e'` | Test type identifier |
39
- | `testEnvironment` | string | - | Environment name (e.g., 'staging') |
40
- | `appName` | string | - | Application name under test |
41
- | `appVersion` | string | - | Application version |
42
- | `buildName` | string | - | Build name/identifier |
43
- | `buildNumber` | string | - | Build number |
44
- | `buildUrl` | string | - | CI pipeline URL |
45
- | `branch` | string | auto-detected | Git branch name |
46
- | `commitSha` | string | auto-detected | Git commit SHA |
47
- | `repositoryUrl` | string | auto-detected | Git repository URL |
48
19
 
49
- ## CI/CD Integration
50
-
51
- The reporter automatically detects CI context from:
52
- - GitHub Actions
53
- - GitLab CI
54
- - Jenkins
55
- - CircleCI
56
- - Azure DevOps
57
- - Bitbucket Pipelines
58
- - And more...
59
-
60
- Git information (branch, commit, repository URL) is auto-detected when running in CI environments.
61
-
62
- ## Example with Full Configuration
63
-
64
- ```typescript
65
- // wdio.conf.ts
66
20
  export const config = {
67
21
  reporters: [
68
22
  'spec',
69
- [
70
- '@testream/webdriverio-reporter',
71
- {
72
- apiKey: process.env.TESTREAM_API_KEY,
73
- uploadEnabled: true,
74
- failOnUploadError: false,
75
- testEnvironment: 'staging',
76
- appName: 'My App',
77
- appVersion: '1.0.0',
78
- testType: 'e2e',
79
- },
80
- ],
23
+ ['@testream/webdriverio-reporter', testreamConfig],
24
+ ],
25
+ services: [
26
+ ['@testream/webdriverio-reporter', testreamConfig],
81
27
  ],
82
28
  };
83
29
  ```
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @testream/webdriverio-reporter
3
+ *
4
+ * WebdriverIO reporter that generates CTRF-format test reports and
5
+ * automatically uploads them to the Testream backend.
6
+ */
7
+ export { TestreamWebdriverIOReporter as default } from './reporter';
8
+ export { TestreamWebdriverIOReporter } from './reporter';
9
+ export { TestreamLauncherService as launcher } from './service';
10
+ export type { WebdriverIOReporterConfig } from './types';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/jira-test-manager/jira-test-manager/packages/webdriverio-reporter/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,2BAA2B,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,uBAAuB,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ (()=>{var t={224:t=>{"use strict";t.exports=balanced;function balanced(t,e,s){if(t instanceof RegExp)t=maybeMatch(t,s);if(e instanceof RegExp)e=maybeMatch(e,s);var i=range(t,e,s);return i&&{start:i[0],end:i[1],pre:s.slice(0,i[0]),body:s.slice(i[0]+t.length,i[1]),post:s.slice(i[1]+e.length)}}function maybeMatch(t,e){var s=e.match(t);return s?s[0]:null}balanced.range=range;function range(t,e,s){var i,r,n,o,a;var h=s.indexOf(t);var l=s.indexOf(e,h+1);var c=h;if(h>=0&&l>0){if(t===e){return[h,l]}i=[];n=s.length;while(c>=0&&!a){if(c==h){i.push(c);h=s.indexOf(t,c+1)}else if(i.length==1){a=[i.pop(),l]}else{r=i.pop();if(r<n){n=r;o=l}l=s.indexOf(e,c+1)}c=h<l&&h>=0?h:l}if(i.length){a=[n,o]}}return a}},503:(t,e,s)=>{var i=s(224);t.exports=expandTop;var r="\0SLASH"+Math.random()+"\0";var n="\0OPEN"+Math.random()+"\0";var o="\0CLOSE"+Math.random()+"\0";var a="\0COMMA"+Math.random()+"\0";var h="\0PERIOD"+Math.random()+"\0";function numeric(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.split("\\\\").join(r).split("\\{").join(n).split("\\}").join(o).split("\\,").join(a).split("\\.").join(h)}function unescapeBraces(t){return t.split(r).join("\\").split(n).join("{").split(o).join("}").split(a).join(",").split(h).join(".")}function parseCommaParts(t){if(!t)return[""];var e=[];var s=i("{","}",t);if(!s)return t.split(",");var r=s.pre;var n=s.body;var o=s.post;var a=r.split(",");a[a.length-1]+="{"+n+"}";var h=parseCommaParts(o);if(o.length){a[a.length-1]+=h.shift();a.push.apply(a,h)}e.push.apply(e,a);return e}function expandTop(t){if(!t)return[];if(t.substr(0,2)==="{}"){t="\\{\\}"+t.substr(2)}return expand(escapeBraces(t),true).map(unescapeBraces)}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,e){return t<=e}function gte(t,e){return t>=e}function expand(t,e){var s=[];var r=i("{","}",t);if(!r)return[t];var n=r.pre;var a=r.post.length?expand(r.post,false):[""];if(/\$$/.test(r.pre)){for(var h=0;h<a.length;h++){var l=n+"{"+r.body+"}"+a[h];s.push(l)}}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body);var f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body);var u=c||f;var d=r.body.indexOf(",")>=0;if(!u&&!d){if(r.post.match(/,(?!,).*\}/)){t=r.pre+"{"+r.body+o+r.post;return expand(t)}return[t]}var p;if(u){p=r.body.split(/\.\./)}else{p=parseCommaParts(r.body);if(p.length===1){p=expand(p[0],false).map(embrace);if(p.length===1){return a.map((function(t){return r.pre+p[0]+t}))}}}var g;if(u){var y=numeric(p[0]);var w=numeric(p[1]);var b=Math.max(p[0].length,p[1].length);var S=p.length==3?Math.abs(numeric(p[2])):1;var v=lte;var k=w<y;if(k){S*=-1;v=gte}var _=p.some(isPadded);g=[];for(var E=y;v(E,w);E+=S){var T;if(f){T=String.fromCharCode(E);if(T==="\\")T=""}else{T=String(E);if(_){var x=b-T.length;if(x>0){var C=new Array(x+1).join("0");if(E<0)T="-"+C+T.slice(1);else T=C+T}}}g.push(T)}}else{g=[];for(var R=0;R<p.length;R++){g.push.apply(g,expand(p[R],false))}}for(var R=0;R<g.length;R++){for(var h=0;h<a.length;h++){var l=n+g[R]+a[h];if(!e||u||l)s.push(l)}}}return s}},406:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});e.detectCIContext=detectCIContext;function detectCIContext(){const t=process.env;if(t.GITHUB_ACTIONS==="true"){return{branch:t.GITHUB_HEAD_REF||t.GITHUB_REF_NAME||t.GITHUB_REF?.replace("refs/heads/",""),commitSha:t.GITHUB_SHA,repositoryUrl:t.GITHUB_SERVER_URL&&t.GITHUB_REPOSITORY?`${t.GITHUB_SERVER_URL}/${t.GITHUB_REPOSITORY}`:undefined,buildNumber:t.GITHUB_RUN_NUMBER,buildUrl:t.GITHUB_SERVER_URL&&t.GITHUB_REPOSITORY&&t.GITHUB_RUN_ID?`${t.GITHUB_SERVER_URL}/${t.GITHUB_REPOSITORY}/actions/runs/${t.GITHUB_RUN_ID}`:undefined}}if(t.GITLAB_CI==="true"){return{branch:t.CI_COMMIT_BRANCH||t.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME,commitSha:t.CI_COMMIT_SHA,repositoryUrl:t.CI_PROJECT_URL,buildNumber:t.CI_PIPELINE_IID,buildUrl:t.CI_PIPELINE_URL}}if(t.TF_BUILD==="True"){return{branch:t.BUILD_SOURCEBRANCH?.replace("refs/heads/",""),commitSha:t.BUILD_SOURCEVERSION,repositoryUrl:t.BUILD_REPOSITORY_URI,buildNumber:t.BUILD_BUILDNUMBER,buildUrl:t.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI&&t.SYSTEM_TEAMPROJECT&&t.BUILD_BUILDID?`${t.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${t.SYSTEM_TEAMPROJECT}/_build/results?buildId=${t.BUILD_BUILDID}`:undefined}}if(t.CIRCLECI==="true"){return{branch:t.CIRCLE_BRANCH,commitSha:t.CIRCLE_SHA1,repositoryUrl:t.CIRCLE_REPOSITORY_URL,buildNumber:t.CIRCLE_BUILD_NUM,buildUrl:t.CIRCLE_BUILD_URL}}if(t.JENKINS_URL){return{branch:t.GIT_BRANCH?.replace("origin/",""),commitSha:t.GIT_COMMIT,repositoryUrl:t.GIT_URL,buildNumber:t.BUILD_NUMBER,buildUrl:t.BUILD_URL}}if(t.BITBUCKET_BUILD_NUMBER){return{branch:t.BITBUCKET_BRANCH,commitSha:t.BITBUCKET_COMMIT,repositoryUrl:t.BITBUCKET_GIT_HTTP_ORIGIN,buildNumber:t.BITBUCKET_BUILD_NUMBER,buildUrl:t.BITBUCKET_REPO_FULL_NAME&&t.BITBUCKET_BUILD_NUMBER?`https://bitbucket.org/${t.BITBUCKET_REPO_FULL_NAME}/pipelines/results/${t.BITBUCKET_BUILD_NUMBER}`:undefined}}return{}}},827:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true})},322:function(t,e,s){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,s,i){if(i===undefined)i=s;var r=Object.getOwnPropertyDescriptor(e,s);if(!r||("get"in r?!e.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return e[s]}}}Object.defineProperty(t,i,r)}:function(t,e,s,i){if(i===undefined)i=s;t[i]=e[s]});var r=this&&this.__exportStar||function(t,e){for(var s in t)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(e,s))i(e,t,s)};Object.defineProperty(e,"__esModule",{value:true});e.uploadArtifacts=e.uploadTestRun=e.detectCIContext=void 0;r(s(827),e);var n=s(406);Object.defineProperty(e,"detectCIContext",{enumerable:true,get:function(){return n.detectCIContext}});var o=s(969);Object.defineProperty(e,"uploadTestRun",{enumerable:true,get:function(){return o.uploadTestRun}});Object.defineProperty(e,"uploadArtifacts",{enumerable:true,get:function(){return o.uploadArtifacts}})},969:(t,e,s)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});e.uploadTestRun=uploadTestRun;e.uploadArtifacts=uploadArtifacts;const i="https://test-manager-backend.fly.dev";async function uploadTestRun(t){const{report:e,apiKey:s,apiUrl:r=i}=t;if(!e.reportId){e.reportId=crypto.randomUUID()}const n={report:e,reportId:e.reportId,commitSha:t.commitSha,branch:t.branch,repositoryUrl:t.repositoryUrl,buildName:t.buildName,buildNumber:t.buildNumber,buildUrl:t.buildUrl,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,testType:t.testType};console.log("Uploading test results...");let o;try{o=await fetch(`${r}/api/v1/ingest`,{method:"POST",headers:{"X-API-KEY":s,"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(t){const s=t instanceof Error?t.message:String(t);return{success:false,reportId:e.reportId,error:`Connection failed: ${s}`}}if(o.status===409){console.warn("Report already exists (workflow may have been re-run)");return{success:true,reportId:e.reportId,summary:{passed:e.results.summary.passed,failed:e.results.summary.failed,skipped:e.results.summary.skipped,total:e.results.summary.tests},alreadyExists:true}}if(!o.ok){const t=await o.text();return{success:false,reportId:e.reportId,error:`Upload failed (HTTP ${o.status}): ${t}`}}const a=await o.json();console.log(`✓ Test results uploaded successfully`);console.log(` Report ID: ${a.reportId}`);console.log(` Test Run ID: ${a.testRunId}`);console.log(` Tests: ${a.summary.passed}/${a.summary.total} passed`);return{success:true,reportId:a.reportId,testRunId:a.testRunId,summary:{passed:a.summary.passed,failed:a.summary.failed,skipped:a.summary.skipped,total:a.summary.total},testResults:a.testResults}}async function uploadArtifacts(t){const{reportId:e,apiKey:s,testResults:r,apiUrl:n=i}=t;let o=0;for(const t of r){for(const i of t.attachments){try{const r=await uploadSingleArtifact({testResultId:t.testResultId,attachment:i,reportId:e,apiKey:s,apiUrl:n});if(r)o++}catch(t){const e=t instanceof Error?t.message:String(t);console.error(`Failed to upload artifact ${i.name}: ${e}`)}}}if(o>0){console.log(`✓ Uploaded ${o} artifact(s)`)}return o}async function uploadSingleArtifact(t){const{testResultId:e,attachment:i,reportId:r,apiKey:n,apiUrl:o}=t;const a=await Promise.resolve().then(s.t.bind(s,943,23));const h=await Promise.resolve().then(s.t.bind(s,928,23));const l=h.resolve(i.path);try{await a.access(l)}catch{console.warn(`Artifact not found: ${h.basename(l)}`);return false}let c;try{c=await a.readFile(l)}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Failed to read file: ${e}`)}const f=new Blob([new Uint8Array(c)],{type:i.contentType});const u=new FormData;u.append("testResultId",e);u.append("ctrfAttachmentName",i.name);u.append("file",f,h.basename(l));const d=`${o}/api/v1/artifacts/${r}`;const p=await fetch(d,{method:"POST",headers:{"X-API-KEY":n},body:u});if(!p.ok){const t=await p.text();throw new Error(`HTTP ${p.status}: ${t}`)}return true}},943:t=>{"use strict";t.exports=require("fs/promises")},928:t=>{"use strict";t.exports=require("path")}};var e={};function __nccwpck_require__(s){var i=e[s];if(i!==undefined){return i.exports}var r=e[s]={exports:{}};var n=true;try{t[s].call(r.exports,r,r.exports,__nccwpck_require__);n=false}finally{if(n)delete e[s]}return r.exports}(()=>{__nccwpck_require__.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(e,{a:e});return e}})();(()=>{var t=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;var e;__nccwpck_require__.t=function(s,i){if(i&1)s=this(s);if(i&8)return s;if(typeof s==="object"&&s){if(i&4&&s.__esModule)return s;if(i&16&&typeof s.then==="function")return s}var r=Object.create(null);__nccwpck_require__.r(r);var n={};e=e||[null,t({}),t([]),t(t)];for(var o=i&2&&s;typeof o=="object"&&!~e.indexOf(o);o=t(o)){Object.getOwnPropertyNames(o).forEach((t=>n[t]=()=>s[t]))}n["default"]=()=>s;__nccwpck_require__.d(r,n);return r}})();(()=>{__nccwpck_require__.d=(t,e)=>{for(var s in e){if(__nccwpck_require__.o(e,s)&&!__nccwpck_require__.o(t,s)){Object.defineProperty(t,s,{enumerable:true,get:e[s]})}}}})();(()=>{__nccwpck_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s={};(()=>{"use strict";__nccwpck_require__.r(s);__nccwpck_require__.d(s,{TestreamWebdriverIOReporter:()=>TestreamWebdriverIOReporter,default:()=>TestreamWebdriverIOReporter,launcher:()=>TestreamLauncherService});var t=__nccwpck_require__(943);var e=__nccwpck_require__(928);var i=__nccwpck_require__(503);const r=1024*64;const assertValidPattern=t=>{if(typeof t!=="string"){throw new TypeError("invalid pattern")}if(t.length>r){throw new TypeError("pattern is too long")}};const n={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=t=>t.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=t=>t.join("");const parseClass=(t,e)=>{const s=e;if(t.charAt(s)!=="["){throw new Error("not in a brace expression")}const i=[];const r=[];let o=s+1;let a=false;let h=false;let l=false;let c=false;let f=s;let u="";t:while(o<t.length){const e=t.charAt(o);if((e==="!"||e==="^")&&o===s+1){c=true;o++;continue}if(e==="]"&&a&&!l){f=o+1;break}a=true;if(e==="\\"){if(!l){l=true;o++;continue}}if(e==="["&&!l){for(const[e,[a,l,c]]of Object.entries(n)){if(t.startsWith(e,o)){if(u){return["$.",false,t.length-s,true]}o+=e.length;if(c)r.push(a);else i.push(a);h=h||l;continue t}}}l=false;if(u){if(e>u){i.push(braceEscape(u)+"-"+braceEscape(e))}else if(e===u){i.push(braceEscape(e))}u="";o++;continue}if(t.startsWith("-]",o+1)){i.push(braceEscape(e+"-"));o+=2;continue}if(t.startsWith("-",o+1)){u=e;o+=2;continue}i.push(braceEscape(e));o++}if(f<o){return["",false,0,false]}if(!i.length&&!r.length){return["$.",false,t.length-s,true]}if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!c){const t=i[0].length===2?i[0].slice(-1):i[0];return[regexpEscape(t),false,f-s,false]}const d="["+(c?"^":"")+rangesToString(i)+"]";const p="["+(c?"":"^")+rangesToString(r)+"]";const g=i.length&&r.length?"("+d+"|"+p+")":i.length?d:p;return[g,h,f-s,true]};const unescape_unescape=(t,{windowsPathsNoEscape:e=false}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");const o=new Set(["!","?","+","*","@"]);const isExtglobType=t=>o.has(t);const a="(?!(?:^|/)\\.\\.?(?:$|/))";const h="(?!\\.)";const l=new Set(["[","."]);const c=new Set(["..","."]);const f=new Set("().*{}+?[]^$\\!");const regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const u="[^/]";const d=u+"*?";const p=u+"+?";class AST{type;#t;#e;#s=false;#i=[];#r;#n;#o;#a=false;#h;#l;#c=false;constructor(t,e,s={}){this.type=t;if(t)this.#e=true;this.#r=e;this.#t=this.#r?this.#r.#t:this;this.#h=this.#t===this?s:this.#t.#h;this.#o=this.#t===this?[]:this.#t.#o;if(t==="!"&&!this.#t.#a)this.#o.push(this);this.#n=this.#r?this.#r.#i.length:0}get hasMagic(){if(this.#e!==undefined)return this.#e;for(const t of this.#i){if(typeof t==="string")continue;if(t.type||t.hasMagic)return this.#e=true}return this.#e}toString(){if(this.#l!==undefined)return this.#l;if(!this.type){return this.#l=this.#i.map((t=>String(t))).join("")}else{return this.#l=this.type+"("+this.#i.map((t=>String(t))).join("|")+")"}}#f(){if(this!==this.#t)throw new Error("should only call on root");if(this.#a)return this;this.toString();this.#a=true;let t;while(t=this.#o.pop()){if(t.type!=="!")continue;let e=t;let s=e.#r;while(s){for(let i=e.#n+1;!s.type&&i<s.#i.length;i++){for(const e of t.#i){if(typeof e==="string"){throw new Error("string part in extglob AST??")}e.copyIn(s.#i[i])}}e=s;s=e.#r}}return this}push(...t){for(const e of t){if(e==="")continue;if(typeof e!=="string"&&!(e instanceof AST&&e.#r===this)){throw new Error("invalid part: "+e)}this.#i.push(e)}}toJSON(){const t=this.type===null?this.#i.slice().map((t=>typeof t==="string"?t:t.toJSON())):[this.type,...this.#i.map((t=>t.toJSON()))];if(this.isStart()&&!this.type)t.unshift([]);if(this.isEnd()&&(this===this.#t||this.#t.#a&&this.#r?.type==="!")){t.push({})}return t}isStart(){if(this.#t===this)return true;if(!this.#r?.isStart())return false;if(this.#n===0)return true;const t=this.#r;for(let e=0;e<this.#n;e++){const s=t.#i[e];if(!(s instanceof AST&&s.type==="!")){return false}}return true}isEnd(){if(this.#t===this)return true;if(this.#r?.type==="!")return true;if(!this.#r?.isEnd())return false;if(!this.type)return this.#r?.isEnd();const t=this.#r?this.#r.#i.length:0;return this.#n===t-1}copyIn(t){if(typeof t==="string")this.push(t);else this.push(t.clone(this))}clone(t){const e=new AST(this.type,t);for(const t of this.#i){e.copyIn(t)}return e}static#u(t,e,s,i){let r=false;let n=false;let o=-1;let a=false;if(e.type===null){let h=s;let l="";while(h<t.length){const s=t.charAt(h++);if(r||s==="\\"){r=!r;l+=s;continue}if(n){if(h===o+1){if(s==="^"||s==="!"){a=true}}else if(s==="]"&&!(h===o+2&&a)){n=false}l+=s;continue}else if(s==="["){n=true;o=h;a=false;l+=s;continue}if(!i.noext&&isExtglobType(s)&&t.charAt(h)==="("){e.push(l);l="";const r=new AST(s,e);h=AST.#u(t,r,h,i);e.push(r);continue}l+=s}e.push(l);return h}let h=s+1;let l=new AST(null,e);const c=[];let f="";while(h<t.length){const s=t.charAt(h++);if(r||s==="\\"){r=!r;f+=s;continue}if(n){if(h===o+1){if(s==="^"||s==="!"){a=true}}else if(s==="]"&&!(h===o+2&&a)){n=false}f+=s;continue}else if(s==="["){n=true;o=h;a=false;f+=s;continue}if(isExtglobType(s)&&t.charAt(h)==="("){l.push(f);f="";const e=new AST(s,l);l.push(e);h=AST.#u(t,e,h,i);continue}if(s==="|"){l.push(f);f="";c.push(l);l=new AST(null,e);continue}if(s===")"){if(f===""&&e.#i.length===0){e.#c=true}l.push(f);f="";e.push(...c,l);return h}f+=s}e.type=null;e.#e=undefined;e.#i=[t.substring(s-1)];return h}static fromGlob(t,e={}){const s=new AST(null,undefined,e);AST.#u(t,s,0,e);return s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString();const[e,s,i,r]=this.toRegExpSource();const n=i||this.#e||this.#h.nocase&&!this.#h.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase();if(!n){return s}const o=(this.#h.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#h}toRegExpSource(t){const e=t??!!this.#h.dot;if(this.#t===this)this.#f();if(!this.type){const s=this.isStart()&&this.isEnd();const i=this.#i.map((e=>{const[i,r,n,o]=typeof e==="string"?AST.#d(e,this.#e,s):e.toRegExpSource(t);this.#e=this.#e||n;this.#s=this.#s||o;return i})).join("");let r="";if(this.isStart()){if(typeof this.#i[0]==="string"){const s=this.#i.length===1&&c.has(this.#i[0]);if(!s){const s=l;const n=e&&s.has(i.charAt(0))||i.startsWith("\\.")&&s.has(i.charAt(2))||i.startsWith("\\.\\.")&&s.has(i.charAt(4));const o=!e&&!t&&s.has(i.charAt(0));r=n?a:o?h:""}}}let n="";if(this.isEnd()&&this.#t.#a&&this.#r?.type==="!"){n="(?:$|\\/)"}const o=r+i+n;return[o,unescape_unescape(i),this.#e=!!this.#e,this.#s]}const s=this.type==="*"||this.type==="+";const i=this.type==="!"?"(?:(?!(?:":"(?:";let r=this.#p(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){const t=this.toString();this.#i=[t];this.type=null;this.#e=undefined;return[t,unescape_unescape(this.toString()),false,false]}let n=!s||t||e||!h?"":this.#p(true);if(n===r){n=""}if(n){r=`(?:${r})(?:${n})*?`}let o="";if(this.type==="!"&&this.#c){o=(this.isStart()&&!e?h:"")+p}else{const s=this.type==="!"?"))"+(this.isStart()&&!e&&!t?h:"")+d+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&n?")":this.type==="*"&&n?`)?`:`)${this.type}`;o=i+r+s}return[o,unescape_unescape(r),this.#e=!!this.#e,this.#s]}#p(t){return this.#i.map((e=>{if(typeof e==="string"){throw new Error("string type in extglob ast??")}const[s,i,r,n]=e.toRegExpSource(t);this.#s=this.#s||n;return s})).filter((t=>!(this.isStart()&&this.isEnd())||!!t)).join("|")}static#d(t,e,s=false){let i=false;let r="";let n=false;for(let o=0;o<t.length;o++){const a=t.charAt(o);if(i){i=false;r+=(f.has(a)?"\\":"")+a;continue}if(a==="\\"){if(o===t.length-1){r+="\\\\"}else{i=true}continue}if(a==="["){const[s,i,a,h]=parseClass(t,o);if(a){r+=s;n=n||i;o+=a-1;e=e||h;continue}}if(a==="*"){if(s&&t==="*")r+=p;else r+=d;e=true;continue}if(a==="?"){r+=u;e=true;continue}r+=regExpEscape(a)}return[r,unescape_unescape(t),!!e,n]}}const escape_escape=(t,{windowsPathsNoEscape:e=false}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");const minimatch=(t,e,s={})=>{assertValidPattern(e);if(!s.nocomment&&e.charAt(0)==="#"){return false}return new Minimatch(e,s).match(t)};const g=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=t=>e=>!e.startsWith(".")&&e.endsWith(t);const starDotExtTestDot=t=>e=>e.endsWith(t);const starDotExtTestNocase=t=>{t=t.toLowerCase();return e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)};const starDotExtTestNocaseDot=t=>{t=t.toLowerCase();return e=>e.toLowerCase().endsWith(t)};const y=/^\*+\.\*+$/;const starDotStarTest=t=>!t.startsWith(".")&&t.includes(".");const starDotStarTestDot=t=>t!=="."&&t!==".."&&t.includes(".");const w=/^\.\*+$/;const dotStarTest=t=>t!=="."&&t!==".."&&t.startsWith(".");const b=/^\*+$/;const starTest=t=>t.length!==0&&!t.startsWith(".");const starTestDot=t=>t.length!==0&&t!=="."&&t!=="..";const S=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([t,e=""])=>{const s=qmarksTestNoExt([t]);if(!e)return s;e=e.toLowerCase();return t=>s(t)&&t.toLowerCase().endsWith(e)};const qmarksTestNocaseDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);if(!e)return s;e=e.toLowerCase();return t=>s(t)&&t.toLowerCase().endsWith(e)};const qmarksTestDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);return!e?s:t=>s(t)&&t.endsWith(e)};const qmarksTest=([t,e=""])=>{const s=qmarksTestNoExt([t]);return!e?s:t=>s(t)&&t.endsWith(e)};const qmarksTestNoExt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")};const qmarksTestNoExtDot=([t])=>{const e=t.length;return t=>t.length===e&&t!=="."&&t!==".."};const v=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const k={win32:{sep:"\\"},posix:{sep:"/"}};const _=v==="win32"?k.win32.sep:k.posix.sep;minimatch.sep=_;const E=Symbol("globstar **");minimatch.GLOBSTAR=E;const T="[^/]";const x=T+"*?";const C="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const R="(?:(?!(?:\\/|^)\\.).)*?";const filter=(t,e={})=>s=>minimatch(s,t,e);minimatch.filter=filter;const ext=(t,e={})=>Object.assign({},t,e);const defaults=t=>{if(!t||typeof t!=="object"||!Object.keys(t).length){return minimatch}const e=minimatch;const m=(s,i,r={})=>e(s,i,ext(t,r));return Object.assign(m,{Minimatch:class Minimatch extends e.Minimatch{constructor(e,s={}){super(e,ext(t,s))}static defaults(s){return e.defaults(ext(t,s)).Minimatch}},AST:class AST extends e.AST{constructor(e,s,i={}){super(e,s,ext(t,i))}static fromGlob(s,i={}){return e.AST.fromGlob(s,ext(t,i))}},unescape:(s,i={})=>e.unescape(s,ext(t,i)),escape:(s,i={})=>e.escape(s,ext(t,i)),filter:(s,i={})=>e.filter(s,ext(t,i)),defaults:s=>e.defaults(ext(t,s)),makeRe:(s,i={})=>e.makeRe(s,ext(t,i)),braceExpand:(s,i={})=>e.braceExpand(s,ext(t,i)),match:(s,i,r={})=>e.match(s,i,ext(t,r)),sep:e.sep,GLOBSTAR:E})};minimatch.defaults=defaults;const braceExpand=(t,e={})=>{assertValidPattern(t);if(e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)){return[t]}return i(t)};minimatch.braceExpand=braceExpand;const makeRe=(t,e={})=>new Minimatch(t,e).makeRe();minimatch.makeRe=makeRe;const match=(t,e,s={})=>{const i=new Minimatch(e,s);t=t.filter((t=>i.match(t)));if(i.options.nonull&&!t.length){t.push(e)}return t};minimatch.match=match;const L=/[?*]|[+@!]\(.*?\)|\[|\]/;const esm_regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){assertValidPattern(t);e=e||{};this.options=e;this.pattern=t;this.platform=e.platform||v;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!e.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!e.nonegate;this.comment=false;this.empty=false;this.partial=!!e.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=e.windowsNoMagicRoot!==undefined?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const t of this.set){for(const e of t){if(typeof e!=="string")return true}}return false}debug(...t){}make(){const t=this.pattern;const e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=true;return}if(!t){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(e.debug){this.debug=(...t)=>console.error(...t)}this.debug(this.pattern,this.globSet);const s=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(s);this.debug(this.pattern,this.globParts);let i=this.globParts.map(((t,e,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=t[0]===""&&t[1]===""&&(t[2]==="?"||!L.test(t[2]))&&!L.test(t[3]);const s=/^[a-z]:/i.test(t[0]);if(e){return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))]}else if(s){return[t[0],...t.slice(1).map((t=>this.parse(t)))]}}return t.map((t=>this.parse(t)))}));this.debug(this.pattern,i);this.set=i.filter((t=>t.indexOf(false)===-1));if(this.isWindows){for(let t=0;t<this.set.length;t++){const e=this.set[t];if(e[0]===""&&e[1]===""&&this.globParts[t][2]==="?"&&typeof e[3]==="string"&&/^[a-z]:$/i.test(e[3])){e[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar){for(let e=0;e<t.length;e++){for(let s=0;s<t[e].length;s++){if(t[e][s]==="**"){t[e][s]="*"}}}}const{optimizationLevel:e=1}=this.options;if(e>=2){t=this.firstPhasePreProcess(t);t=this.secondPhasePreProcess(t)}else if(e>=1){t=this.levelOneOptimize(t)}else{t=this.adjascentGlobstarOptimize(t)}return t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;while(-1!==(e=t.indexOf("**",e+1))){let s=e;while(t[s+1]==="**"){s++}if(s!==e){t.splice(e,s-e)}}return t}))}levelOneOptimize(t){return t.map((t=>{t=t.reduce(((t,e)=>{const s=t[t.length-1];if(e==="**"&&s==="**"){return t}if(e===".."){if(s&&s!==".."&&s!=="."&&s!=="**"){t.pop();return t}}t.push(e);return t}),[]);return t.length===0?[""]:t}))}levelTwoFileOptimize(t){if(!Array.isArray(t)){t=this.slashSplit(t)}let e=false;do{e=false;if(!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const i=t[s];if(s===1&&i===""&&t[0]==="")continue;if(i==="."||i===""){e=true;t.splice(s,1);s--}}if(t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")){e=true;t.pop()}}let s=0;while(-1!==(s=t.indexOf("..",s+1))){const i=t[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){e=true;t.splice(s-1,2);s-=2}}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=false;do{e=false;for(let s of t){let i=-1;while(-1!==(i=s.indexOf("**",i+1))){let r=i;while(s[r+1]==="**"){r++}if(r>i){s.splice(i+1,r-i)}let n=s[i+1];const o=s[i+2];const a=s[i+3];if(n!=="..")continue;if(!o||o==="."||o===".."||!a||a==="."||a===".."){continue}e=true;s.splice(i,1);const h=s.slice(0);h[i]="**";t.push(h);i--}if(!this.preserveMultipleSlashes){for(let t=1;t<s.length-1;t++){const i=s[t];if(t===1&&i===""&&s[0]==="")continue;if(i==="."||i===""){e=true;s.splice(t,1);t--}}if(s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")){e=true;s.pop()}}let r=0;while(-1!==(r=s.indexOf("..",r+1))){const t=s[r-1];if(t&&t!=="."&&t!==".."&&t!=="**"){e=true;const t=r===1&&s[r+1]==="**";const i=t?["."]:[];s.splice(r-1,2,...i);if(s.length===0)s.push("");r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++){for(let s=e+1;s<t.length;s++){const i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[];t[s]=i;break}}}return t.filter((t=>t.length))}partsMatch(t,e,s=false){let i=0;let r=0;let n=[];let o="";while(i<t.length&&r<e.length){if(t[i]===e[r]){n.push(o==="b"?e[r]:t[i]);i++;r++}else if(s&&t[i]==="**"&&e[r]===t[i+1]){n.push(t[i]);i++}else if(s&&e[r]==="**"&&t[i]===e[r+1]){n.push(e[r]);r++}else if(t[i]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(o==="b")return false;o="a";n.push(t[i]);i++;r++}else if(e[r]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(o==="a")return false;o="b";n.push(e[r]);i++;r++}else{return false}}return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=false;let s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++){e=!e;s++}if(s)this.pattern=t.slice(s);this.negate=e}matchOne(t,e,s=false){const i=this.options;if(this.isWindows){const s=typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0]);const i=!s&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]);const r=typeof e[0]==="string"&&/^[a-z]:$/i.test(e[0]);const n=!r&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]==="string"&&/^[a-z]:$/i.test(e[3]);const o=i?3:s?0:undefined;const a=n?3:r?0:undefined;if(typeof o==="number"&&typeof a==="number"){const[s,i]=[t[o],e[a]];if(s.toLowerCase()===i.toLowerCase()){e[a]=s;if(a>o){e=e.slice(a)}else if(o>a){t=t.slice(o)}}}}const{optimizationLevel:r=1}=this.options;if(r>=2){t=this.levelTwoFileOptimize(t)}this.debug("matchOne",this,{file:t,pattern:e});this.debug("matchOne",t.length,e.length);for(var n=0,o=0,a=t.length,h=e.length;n<a&&o<h;n++,o++){this.debug("matchOne loop");var l=e[o];var c=t[n];this.debug(e,l,c);if(l===false){return false}if(l===E){this.debug("GLOBSTAR",[e,l,c]);var f=n;var u=o+1;if(u===h){this.debug("** at the end");for(;n<a;n++){if(t[n]==="."||t[n]===".."||!i.dot&&t[n].charAt(0)===".")return false}return true}while(f<a){var d=t[f];this.debug("\nglobstar while",t,f,e,u,d);if(this.matchOne(t.slice(f),e.slice(u),s)){this.debug("globstar found match!",f,a,d);return true}else{if(d==="."||d===".."||!i.dot&&d.charAt(0)==="."){this.debug("dot detected!",t,f,e,u);break}this.debug("globstar swallow a segment, and continue");f++}}if(s){this.debug("\n>>> no match, partial?",t,f,e,u);if(f===a){return true}}return false}let r;if(typeof l==="string"){r=c===l;this.debug("string match",l,c,r)}else{r=l.test(c);this.debug("pattern match",l,c,r)}if(!r)return false}if(n===a&&o===h){return true}else if(n===a){return s}else if(o===h){return n===a-1&&t[n]===""}else{throw new Error("wtf?")}}braceExpand(){return braceExpand(this.pattern,this.options)}parse(t){assertValidPattern(t);const e=this.options;if(t==="**")return E;if(t==="")return"";let s;let i=null;if(s=t.match(b)){i=e.dot?starTestDot:starTest}else if(s=t.match(g)){i=(e.nocase?e.dot?starDotExtTestNocaseDot:starDotExtTestNocase:e.dot?starDotExtTestDot:starDotExtTest)(s[1])}else if(s=t.match(S)){i=(e.nocase?e.dot?qmarksTestNocaseDot:qmarksTestNocase:e.dot?qmarksTestDot:qmarksTest)(s)}else if(s=t.match(y)){i=e.dot?starDotStarTestDot:starDotStarTest}else if(s=t.match(w)){i=dotStarTest}const r=AST.fromGlob(t,this.options).toMMPattern();if(i&&typeof r==="object"){Reflect.defineProperty(r,"test",{value:i})}return r}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const t=this.set;if(!t.length){this.regexp=false;return this.regexp}const e=this.options;const s=e.noglobstar?x:e.dot?C:R;const i=new Set(e.nocase?["i"]:[]);let r=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp){for(const e of t.flags.split(""))i.add(e)}return typeof t==="string"?esm_regExpEscape(t):t===E?E:t._src}));e.forEach(((t,i)=>{const r=e[i+1];const n=e[i-1];if(t!==E||n===E){return}if(n===undefined){if(r!==undefined&&r!==E){e[i+1]="(?:\\/|"+s+"\\/)?"+r}else{e[i]=s}}else if(r===undefined){e[i-1]=n+"(?:\\/|"+s+")?"}else if(r!==E){e[i-1]=n+"(?:\\/|\\/"+s+"\\/)"+r;e[i+1]=E}}));return e.filter((t=>t!==E)).join("/")})).join("|");const[n,o]=t.length>1?["(?:",")"]:["",""];r="^"+n+r+o+"$";if(this.negate)r="^(?!"+r+").+$";try{this.regexp=new RegExp(r,[...i].join(""))}catch(t){this.regexp=false}return this.regexp}slashSplit(t){if(this.preserveMultipleSlashes){return t.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(t)){return["",...t.split(/\/+/)]}else{return t.split(/\/+/)}}match(t,e=this.partial){this.debug("match",t,this.pattern);if(this.comment){return false}if(this.empty){return t===""}if(t==="/"&&e){return true}const s=this.options;if(this.isWindows){t=t.split("\\").join("/")}const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const r=this.set;this.debug(this.pattern,"set",r);let n=i[i.length-1];if(!n){for(let t=i.length-2;!n&&t>=0;t--){n=i[t]}}for(let t=0;t<r.length;t++){const o=r[t];let a=i;if(s.matchBase&&o.length===1){a=[n]}const h=this.matchOne(a,o,e);if(h){if(s.flipNegate){return true}return!this.negate}}if(s.flipNegate){return false}return this.negate}static defaults(t){return minimatch.defaults(t).Minimatch}}minimatch.AST=AST;minimatch.Minimatch=Minimatch;minimatch.escape=escape_escape;minimatch.unescape=unescape_unescape;const I=require("node:url");const A=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const M=new Set;const O=typeof process==="object"&&!!process?process:{};const emitWarning=(t,e,s,i)=>{typeof O.emitWarning==="function"?O.emitWarning(t,e,s,i):console.error(`[${s}] ${e}: ${t}`)};let P=globalThis.AbortController;let F=globalThis.AbortSignal;if(typeof P==="undefined"){F=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(t,e){this._onabort.push(e)}};P=class AbortController{constructor(){warnACPolyfill()}signal=new F;abort(t){if(this.signal.aborted)return;this.signal.reason=t;this.signal.aborted=true;for(const e of this.signal._onabort){e(t)}this.signal.onabort?.(t)}};let t=O.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!t)return;t=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=t=>!M.has(t);const N=Symbol("type");const isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t);const getUintArray=t=>!isPosInt(t)?null:t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(t){super(t);this.fill(0)}}class Stack{heap;length;static#m=false;static create(t){const e=getUintArray(t);if(!e)return[];Stack.#m=true;const s=new Stack(t,e);Stack.#m=false;return s}constructor(t,e){if(!Stack.#m){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new e(t);this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class LRUCache{#g;#y;#w;#b;#S;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#k;#_;#E;#T;#x;#C;#R;#L;#I;#A;#M;#O;#P;#F;#N;#B;#U;static unsafeExposeInternals(t){return{starts:t.#P,ttls:t.#F,sizes:t.#O,keyMap:t.#E,keyList:t.#T,valList:t.#x,next:t.#C,prev:t.#R,get head(){return t.#L},get tail(){return t.#I},free:t.#A,isBackgroundFetch:e=>t.#D(e),backgroundFetch:(e,s,i,r)=>t.#z(e,s,i,r),moveToTail:e=>t.#j(e),indexes:e=>t.#W(e),rindexes:e=>t.#$(e),isStale:e=>t.#G(e)}}get max(){return this.#g}get maxSize(){return this.#y}get calculatedSize(){return this.#_}get size(){return this.#k}get fetchMethod(){return this.#S}get memoMethod(){return this.#v}get dispose(){return this.#w}get disposeAfter(){return this.#b}constructor(t){const{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:n,updateAgeOnHas:o,allowStale:a,dispose:h,disposeAfter:l,noDisposeOnSet:c,noUpdateTTL:f,maxSize:u=0,maxEntrySize:d=0,sizeCalculation:p,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:v,ignoreFetchAbort:k}=t;if(e!==0&&!isPosInt(e)){throw new TypeError("max option must be a nonnegative integer")}const _=e?getUintArray(e):Array;if(!_){throw new Error("invalid max value: "+e)}this.#g=e;this.#y=u;this.maxEntrySize=d||this.#y;this.sizeCalculation=p;if(this.sizeCalculation){if(!this.#y&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(y!==undefined&&typeof y!=="function"){throw new TypeError("memoMethod must be a function if defined")}this.#v=y;if(g!==undefined&&typeof g!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#S=g;this.#B=!!g;this.#E=new Map;this.#T=new Array(e).fill(undefined);this.#x=new Array(e).fill(undefined);this.#C=new _(e);this.#R=new _(e);this.#L=0;this.#I=0;this.#A=Stack.create(e);this.#k=0;this.#_=0;if(typeof h==="function"){this.#w=h}if(typeof l==="function"){this.#b=l;this.#M=[]}else{this.#b=undefined;this.#M=undefined}this.#N=!!this.#w;this.#U=!!this.#b;this.noDisposeOnSet=!!c;this.noUpdateTTL=!!f;this.noDeleteOnFetchRejection=!!w;this.allowStaleOnFetchRejection=!!S;this.allowStaleOnFetchAbort=!!v;this.ignoreFetchAbort=!!k;if(this.maxEntrySize!==0){if(this.#y!==0){if(!isPosInt(this.#y)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#H()}this.allowStale=!!a;this.noDeleteOnStaleGet=!!b;this.updateAgeOnGet=!!n;this.updateAgeOnHas=!!o;this.ttlResolution=isPosInt(i)||i===0?i:1;this.ttlAutopurge=!!r;this.ttl=s||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#q()}if(this.#g===0&&this.ttl===0&&this.#y===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#g&&!this.#y){const t="LRU_CACHE_UNBOUNDED";if(shouldWarn(t)){M.add(t);const e="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(e,"UnboundedCacheWarning",t,LRUCache)}}}getRemainingTTL(t){return this.#E.has(t)?Infinity:0}#q(){const t=new ZeroArray(this.#g);const e=new ZeroArray(this.#g);this.#F=t;this.#P=e;this.#K=(s,i,r=A.now())=>{e[s]=i!==0?r:0;t[s]=i;if(i!==0&&this.ttlAutopurge){const t=setTimeout((()=>{if(this.#G(s)){this.#V(this.#T[s],"expire")}}),i+1);if(t.unref){t.unref()}}};this.#Y=s=>{e[s]=t[s]!==0?A.now():0};this.#J=(i,r)=>{if(t[r]){const n=t[r];const o=e[r];if(!n||!o)return;i.ttl=n;i.start=o;i.now=s||getNow();const a=i.now-o;i.remainingTTL=n-a}};let s=0;const getNow=()=>{const t=A.now();if(this.ttlResolution>0){s=t;const e=setTimeout((()=>s=0),this.ttlResolution);if(e.unref){e.unref()}}return t};this.getRemainingTTL=i=>{const r=this.#E.get(i);if(r===undefined){return 0}const n=t[r];const o=e[r];if(!n||!o){return Infinity}const a=(s||getNow())-o;return n-a};this.#G=i=>{const r=e[i];const n=t[i];return!!n&&!!r&&(s||getNow())-r>n}}#Y=()=>{};#J=()=>{};#K=()=>{};#G=()=>false;#H(){const t=new ZeroArray(this.#g);this.#_=0;this.#O=t;this.#Z=e=>{this.#_-=t[e];t[e]=0};this.#X=(t,e,s,i)=>{if(this.#D(e)){return 0}if(!isPosInt(s)){if(i){if(typeof i!=="function"){throw new TypeError("sizeCalculation must be a function")}s=i(e,t);if(!isPosInt(s)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return s};this.#Q=(e,s,i)=>{t[e]=s;if(this.#y){const s=this.#y-t[e];while(this.#_>s){this.#tt(true)}}this.#_+=t[e];if(i){i.entrySize=s;i.totalCalculatedSize=this.#_}}}#Z=t=>{};#Q=(t,e,s)=>{};#X=(t,e,s,i)=>{if(s||i){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#W({allowStale:t=this.allowStale}={}){if(this.#k){for(let e=this.#I;true;){if(!this.#et(e)){break}if(t||!this.#G(e)){yield e}if(e===this.#L){break}else{e=this.#R[e]}}}}*#$({allowStale:t=this.allowStale}={}){if(this.#k){for(let e=this.#L;true;){if(!this.#et(e)){break}if(t||!this.#G(e)){yield e}if(e===this.#I){break}else{e=this.#C[e]}}}}#et(t){return t!==undefined&&this.#E.get(this.#T[t])===t}*entries(){for(const t of this.#W()){if(this.#x[t]!==undefined&&this.#T[t]!==undefined&&!this.#D(this.#x[t])){yield[this.#T[t],this.#x[t]]}}}*rentries(){for(const t of this.#$()){if(this.#x[t]!==undefined&&this.#T[t]!==undefined&&!this.#D(this.#x[t])){yield[this.#T[t],this.#x[t]]}}}*keys(){for(const t of this.#W()){const e=this.#T[t];if(e!==undefined&&!this.#D(this.#x[t])){yield e}}}*rkeys(){for(const t of this.#$()){const e=this.#T[t];if(e!==undefined&&!this.#D(this.#x[t])){yield e}}}*values(){for(const t of this.#W()){const e=this.#x[t];if(e!==undefined&&!this.#D(this.#x[t])){yield this.#x[t]}}}*rvalues(){for(const t of this.#$()){const e=this.#x[t];if(e!==undefined&&!this.#D(this.#x[t])){yield this.#x[t]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const s of this.#W()){const i=this.#x[s];const r=this.#D(i)?i.__staleWhileFetching:i;if(r===undefined)continue;if(t(r,this.#T[s],this)){return this.get(this.#T[s],e)}}}forEach(t,e=this){for(const s of this.#W()){const i=this.#x[s];const r=this.#D(i)?i.__staleWhileFetching:i;if(r===undefined)continue;t.call(e,r,this.#T[s],this)}}rforEach(t,e=this){for(const s of this.#$()){const i=this.#x[s];const r=this.#D(i)?i.__staleWhileFetching:i;if(r===undefined)continue;t.call(e,r,this.#T[s],this)}}purgeStale(){let t=false;for(const e of this.#$({allowStale:true})){if(this.#G(e)){this.#V(this.#T[e],"expire");t=true}}return t}info(t){const e=this.#E.get(t);if(e===undefined)return undefined;const s=this.#x[e];const i=this.#D(s)?s.__staleWhileFetching:s;if(i===undefined)return undefined;const r={value:i};if(this.#F&&this.#P){const t=this.#F[e];const s=this.#P[e];if(t&&s){const e=t-(A.now()-s);r.ttl=e;r.start=Date.now()}}if(this.#O){r.size=this.#O[e]}return r}dump(){const t=[];for(const e of this.#W({allowStale:true})){const s=this.#T[e];const i=this.#x[e];const r=this.#D(i)?i.__staleWhileFetching:i;if(r===undefined||s===undefined)continue;const n={value:r};if(this.#F&&this.#P){n.ttl=this.#F[e];const t=A.now()-this.#P[e];n.start=Math.floor(Date.now()-t)}if(this.#O){n.size=this.#O[e]}t.unshift([s,n])}return t}load(t){this.clear();for(const[e,s]of t){if(s.start){const t=Date.now()-s.start;s.start=A.now()-t}this.set(e,s.value,s)}}set(t,e,s={}){if(e===undefined){this.delete(t);return this}const{ttl:i=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=s;let{noUpdateTTL:h=this.noUpdateTTL}=s;const l=this.#X(t,e,s.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize){if(a){a.set="miss";a.maxEntrySizeExceeded=true}this.#V(t,"set");return this}let c=this.#k===0?undefined:this.#E.get(t);if(c===undefined){c=this.#k===0?this.#I:this.#A.length!==0?this.#A.pop():this.#k===this.#g?this.#tt(false):this.#k;this.#T[c]=t;this.#x[c]=e;this.#E.set(t,c);this.#C[this.#I]=c;this.#R[c]=this.#I;this.#I=c;this.#k++;this.#Q(c,l,a);if(a)a.set="add";h=false}else{this.#j(c);const s=this.#x[c];if(e!==s){if(this.#B&&this.#D(s)){s.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=s;if(e!==undefined&&!n){if(this.#N){this.#w?.(e,t,"set")}if(this.#U){this.#M?.push([e,t,"set"])}}}else if(!n){if(this.#N){this.#w?.(s,t,"set")}if(this.#U){this.#M?.push([s,t,"set"])}}this.#Z(c);this.#Q(c,l,a);this.#x[c]=e;if(a){a.set="replace";const t=s&&this.#D(s)?s.__staleWhileFetching:s;if(t!==undefined)a.oldValue=t}}else if(a){a.set="update"}}if(i!==0&&!this.#F){this.#q()}if(this.#F){if(!h){this.#K(c,i,r)}if(a)this.#J(a,c)}if(!n&&this.#U&&this.#M){const t=this.#M;let e;while(e=t?.shift()){this.#b?.(...e)}}return this}pop(){try{while(this.#k){const t=this.#x[this.#L];this.#tt(true);if(this.#D(t)){if(t.__staleWhileFetching){return t.__staleWhileFetching}}else if(t!==undefined){return t}}}finally{if(this.#U&&this.#M){const t=this.#M;let e;while(e=t?.shift()){this.#b?.(...e)}}}}#tt(t){const e=this.#L;const s=this.#T[e];const i=this.#x[e];if(this.#B&&this.#D(i)){i.__abortController.abort(new Error("evicted"))}else if(this.#N||this.#U){if(this.#N){this.#w?.(i,s,"evict")}if(this.#U){this.#M?.push([i,s,"evict"])}}this.#Z(e);if(t){this.#T[e]=undefined;this.#x[e]=undefined;this.#A.push(e)}if(this.#k===1){this.#L=this.#I=0;this.#A.length=0}else{this.#L=this.#C[e]}this.#E.delete(s);this.#k--;return e}has(t,e={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e;const r=this.#E.get(t);if(r!==undefined){const t=this.#x[r];if(this.#D(t)&&t.__staleWhileFetching===undefined){return false}if(!this.#G(r)){if(s){this.#Y(r)}if(i){i.has="hit";this.#J(i,r)}return true}else if(i){i.has="stale";this.#J(i,r)}}else if(i){i.has="miss"}return false}peek(t,e={}){const{allowStale:s=this.allowStale}=e;const i=this.#E.get(t);if(i===undefined||!s&&this.#G(i)){return}const r=this.#x[i];return this.#D(r)?r.__staleWhileFetching:r}#z(t,e,s,i){const r=e===undefined?undefined:this.#x[e];if(this.#D(r)){return r}const n=new P;const{signal:o}=s;o?.addEventListener("abort",(()=>n.abort(o.reason)),{signal:n.signal});const a={signal:n.signal,options:s,context:i};const cb=(i,r=false)=>{const{aborted:o}=n.signal;const l=s.ignoreFetchAbort&&i!==undefined;if(s.status){if(o&&!r){s.status.fetchAborted=true;s.status.fetchError=n.signal.reason;if(l)s.status.fetchAbortIgnored=true}else{s.status.fetchResolved=true}}if(o&&!l&&!r){return fetchFail(n.signal.reason)}const c=h;if(this.#x[e]===h){if(i===undefined){if(c.__staleWhileFetching){this.#x[e]=c.__staleWhileFetching}else{this.#V(t,"fetch")}}else{if(s.status)s.status.fetchUpdated=true;this.set(t,i,a.options)}}return i};const eb=t=>{if(s.status){s.status.fetchRejected=true;s.status.fetchError=t}return fetchFail(t)};const fetchFail=i=>{const{aborted:r}=n.signal;const o=r&&s.allowStaleOnFetchAbort;const a=o||s.allowStaleOnFetchRejection;const l=a||s.noDeleteOnFetchRejection;const c=h;if(this.#x[e]===h){const s=!l||c.__staleWhileFetching===undefined;if(s){this.#V(t,"fetch")}else if(!o){this.#x[e]=c.__staleWhileFetching}}if(a){if(s.status&&c.__staleWhileFetching!==undefined){s.status.returnedStale=true}return c.__staleWhileFetching}else if(c.__returned===c){throw i}};const pcall=(e,i)=>{const o=this.#S?.(t,r,a);if(o&&o instanceof Promise){o.then((t=>e(t===undefined?undefined:t)),i)}n.signal.addEventListener("abort",(()=>{if(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort){e(undefined);if(s.allowStaleOnFetchAbort){e=t=>cb(t,true)}}}))};if(s.status)s.status.fetchDispatched=true;const h=new Promise(pcall).then(cb,eb);const l=Object.assign(h,{__abortController:n,__staleWhileFetching:r,__returned:undefined});if(e===undefined){this.set(t,l,{...a.options,status:undefined});e=this.#E.get(t)}else{this.#x[e]=l}return l}#D(t){if(!this.#B)return false;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof P}async fetch(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=false,status:y,signal:w}=e;if(!this.#B){if(y)y.fetch="get";return this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:y})}const b={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:o,size:a,sizeCalculation:h,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:d,ignoreFetchAbort:u,status:y,signal:w};let S=this.#E.get(t);if(S===undefined){if(y)y.fetch="miss";const e=this.#z(t,S,b,p);return e.__returned=e}else{const e=this.#x[S];if(this.#D(e)){const t=s&&e.__staleWhileFetching!==undefined;if(y){y.fetch="inflight";if(t)y.returnedStale=true}return t?e.__staleWhileFetching:e.__returned=e}const r=this.#G(S);if(!g&&!r){if(y)y.fetch="hit";this.#j(S);if(i){this.#Y(S)}if(y)this.#J(y,S);return e}const n=this.#z(t,S,b,p);const o=n.__staleWhileFetching!==undefined;const a=o&&s;if(y){y.fetch=r?"stale":"refresh";if(a&&r)y.returnedStale=true}return a?n.__staleWhileFetching:n.__returned=n}}async forceFetch(t,e={}){const s=await this.fetch(t,e);if(s===undefined)throw new Error("fetch() returned undefined");return s}memo(t,e={}){const s=this.#v;if(!s){throw new Error("no memoMethod provided to constructor")}const{context:i,forceRefresh:r,...n}=e;const o=this.get(t,n);if(!r&&o!==undefined)return o;const a=s(t,o,{options:n,context:i});this.set(t,a,n);return a}get(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e;const o=this.#E.get(t);if(o!==undefined){const e=this.#x[o];const a=this.#D(e);if(n)this.#J(n,o);if(this.#G(o)){if(n)n.get="stale";if(!a){if(!r){this.#V(t,"expire")}if(n&&s)n.returnedStale=true;return s?e:undefined}else{if(n&&s&&e.__staleWhileFetching!==undefined){n.returnedStale=true}return s?e.__staleWhileFetching:undefined}}else{if(n)n.get="hit";if(a){return e.__staleWhileFetching}this.#j(o);if(i){this.#Y(o)}return e}}else if(n){n.get="miss"}}#st(t,e){this.#R[e]=t;this.#C[t]=e}#j(t){if(t!==this.#I){if(t===this.#L){this.#L=this.#C[t]}else{this.#st(this.#R[t],this.#C[t])}this.#st(this.#I,t);this.#I=t}}delete(t){return this.#V(t,"delete")}#V(t,e){let s=false;if(this.#k!==0){const i=this.#E.get(t);if(i!==undefined){s=true;if(this.#k===1){this.#it(e)}else{this.#Z(i);const s=this.#x[i];if(this.#D(s)){s.__abortController.abort(new Error("deleted"))}else if(this.#N||this.#U){if(this.#N){this.#w?.(s,t,e)}if(this.#U){this.#M?.push([s,t,e])}}this.#E.delete(t);this.#T[i]=undefined;this.#x[i]=undefined;if(i===this.#I){this.#I=this.#R[i]}else if(i===this.#L){this.#L=this.#C[i]}else{const t=this.#R[i];this.#C[t]=this.#C[i];const e=this.#C[i];this.#R[e]=this.#R[i]}this.#k--;this.#A.push(i)}}}if(this.#U&&this.#M?.length){const t=this.#M;let e;while(e=t?.shift()){this.#b?.(...e)}}return s}clear(){return this.#it("delete")}#it(t){for(const e of this.#$({allowStale:true})){const s=this.#x[e];if(this.#D(s)){s.__abortController.abort(new Error("deleted"))}else{const i=this.#T[e];if(this.#N){this.#w?.(s,i,t)}if(this.#U){this.#M?.push([s,i,t])}}}this.#E.clear();this.#x.fill(undefined);this.#T.fill(undefined);if(this.#F&&this.#P){this.#F.fill(0);this.#P.fill(0)}if(this.#O){this.#O.fill(0)}this.#L=0;this.#I=0;this.#A.length=0;this.#_=0;this.#k=0;if(this.#U&&this.#M){const t=this.#M;let e;while(e=t?.shift()){this.#b?.(...e)}}}}const B=require("node:path");const U=require("fs");const D=require("node:fs");var z=__nccwpck_require__.t(D,2);const j=require("node:fs/promises");const W=require("node:events");const $=require("node:stream");const G=require("node:string_decoder");const H=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=t=>!!t&&typeof t==="object"&&(t instanceof Minipass||t instanceof $||isReadable(t)||isWritable(t));const isReadable=t=>!!t&&typeof t==="object"&&t instanceof W.EventEmitter&&typeof t.pipe==="function"&&t.pipe!==$.Writable.prototype.pipe;const isWritable=t=>!!t&&typeof t==="object"&&t instanceof W.EventEmitter&&typeof t.write==="function"&&typeof t.end==="function";const q=Symbol("EOF");const K=Symbol("maybeEmitEnd");const V=Symbol("emittedEnd");const Y=Symbol("emittingEnd");const J=Symbol("emittedError");const Z=Symbol("closed");const X=Symbol("read");const Q=Symbol("flush");const tt=Symbol("flushChunk");const et=Symbol("encoding");const st=Symbol("decoder");const it=Symbol("flowing");const rt=Symbol("paused");const nt=Symbol("resume");const ot=Symbol("buffer");const at=Symbol("pipes");const ht=Symbol("bufferLength");const lt=Symbol("bufferPush");const ct=Symbol("bufferShift");const ft=Symbol("objectMode");const ut=Symbol("destroyed");const dt=Symbol("error");const pt=Symbol("emitData");const mt=Symbol("emitEnd");const gt=Symbol("emitEnd2");const yt=Symbol("async");const wt=Symbol("abort");const bt=Symbol("aborted");const St=Symbol("signal");const vt=Symbol("dataListeners");const kt=Symbol("discarded");const defer=t=>Promise.resolve().then(t);const nodefer=t=>t();const isEndish=t=>t==="end"||t==="finish"||t==="prefinish";const isArrayBufferLike=t=>t instanceof ArrayBuffer||!!t&&typeof t==="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0;const isArrayBufferView=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t);class Pipe{src;dest;opts;ondrain;constructor(t,e,s){this.src=t;this.dest=e;this.opts=s;this.ondrain=()=>t[nt]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(t,e,s){super(t,e,s);this.proxyErrors=t=>e.emit("error",t);t.on("error",this.proxyErrors)}}const isObjectModeOptions=t=>!!t.objectMode;const isEncodingOptions=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer";class Minipass extends W.EventEmitter{[it]=false;[rt]=false;[at]=[];[ot]=[];[ft];[et];[yt];[st];[q]=false;[V]=false;[Y]=false;[Z]=false;[J]=null;[ht]=0;[ut]=false;[St];[bt]=false;[vt]=0;[kt]=false;writable=true;readable=true;constructor(...t){const e=t[0]||{};super();if(e.objectMode&&typeof e.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(e)){this[ft]=true;this[et]=null}else if(isEncodingOptions(e)){this[et]=e.encoding;this[ft]=false}else{this[ft]=false;this[et]=null}this[yt]=!!e.async;this[st]=this[et]?new G.StringDecoder(this[et]):null;if(e&&e.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[ot]})}if(e&&e.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[at]})}const{signal:s}=e;if(s){this[St]=s;if(s.aborted){this[wt]()}else{s.addEventListener("abort",(()=>this[wt]()))}}}get bufferLength(){return this[ht]}get encoding(){return this[et]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ft]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[yt]}set["async"](t){this[yt]=this[yt]||!!t}[wt](){this[bt]=true;this.emit("abort",this[St]?.reason);this.destroy(this[St]?.reason)}get aborted(){return this[bt]}set aborted(t){}write(t,e,s){if(this[bt])return false;if(this[q])throw new Error("write after end");if(this[ut]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof e==="function"){s=e;e="utf8"}if(!e)e="utf8";const i=this[yt]?defer:nodefer;if(!this[ft]&&!Buffer.isBuffer(t)){if(isArrayBufferView(t)){t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(isArrayBufferLike(t)){t=Buffer.from(t)}else if(typeof t!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[ft]){if(this[it]&&this[ht]!==0)this[Q](true);if(this[it])this.emit("data",t);else this[lt](t);if(this[ht]!==0)this.emit("readable");if(s)i(s);return this[it]}if(!t.length){if(this[ht]!==0)this.emit("readable");if(s)i(s);return this[it]}if(typeof t==="string"&&!(e===this[et]&&!this[st]?.lastNeed)){t=Buffer.from(t,e)}if(Buffer.isBuffer(t)&&this[et]){t=this[st].write(t)}if(this[it]&&this[ht]!==0)this[Q](true);if(this[it])this.emit("data",t);else this[lt](t);if(this[ht]!==0)this.emit("readable");if(s)i(s);return this[it]}read(t){if(this[ut])return null;this[kt]=false;if(this[ht]===0||t===0||t&&t>this[ht]){this[K]();return null}if(this[ft])t=null;if(this[ot].length>1&&!this[ft]){this[ot]=[this[et]?this[ot].join(""):Buffer.concat(this[ot],this[ht])]}const e=this[X](t||null,this[ot][0]);this[K]();return e}[X](t,e){if(this[ft])this[ct]();else{const s=e;if(t===s.length||t===null)this[ct]();else if(typeof s==="string"){this[ot][0]=s.slice(t);e=s.slice(0,t);this[ht]-=t}else{this[ot][0]=s.subarray(t);e=s.subarray(0,t);this[ht]-=t}}this.emit("data",e);if(!this[ot].length&&!this[q])this.emit("drain");return e}end(t,e,s){if(typeof t==="function"){s=t;t=undefined}if(typeof e==="function"){s=e;e="utf8"}if(t!==undefined)this.write(t,e);if(s)this.once("end",s);this[q]=true;this.writable=false;if(this[it]||!this[rt])this[K]();return this}[nt](){if(this[ut])return;if(!this[vt]&&!this[at].length){this[kt]=true}this[rt]=false;this[it]=true;this.emit("resume");if(this[ot].length)this[Q]();else if(this[q])this[K]();else this.emit("drain")}resume(){return this[nt]()}pause(){this[it]=false;this[rt]=true;this[kt]=false}get destroyed(){return this[ut]}get flowing(){return this[it]}get paused(){return this[rt]}[lt](t){if(this[ft])this[ht]+=1;else this[ht]+=t.length;this[ot].push(t)}[ct](){if(this[ft])this[ht]-=1;else this[ht]-=this[ot][0].length;return this[ot].shift()}[Q](t=false){do{}while(this[tt](this[ct]())&&this[ot].length);if(!t&&!this[ot].length&&!this[q])this.emit("drain")}[tt](t){this.emit("data",t);return this[it]}pipe(t,e){if(this[ut])return t;this[kt]=false;const s=this[V];e=e||{};if(t===H.stdout||t===H.stderr)e.end=false;else e.end=e.end!==false;e.proxyErrors=!!e.proxyErrors;if(s){if(e.end)t.end()}else{this[at].push(!e.proxyErrors?new Pipe(this,t,e):new PipeProxyErrors(this,t,e));if(this[yt])defer((()=>this[nt]()));else this[nt]()}return t}unpipe(t){const e=this[at].find((e=>e.dest===t));if(e){if(this[at].length===1){if(this[it]&&this[vt]===0){this[it]=false}this[at]=[]}else this[at].splice(this[at].indexOf(e),1);e.unpipe()}}addListener(t,e){return this.on(t,e)}on(t,e){const s=super.on(t,e);if(t==="data"){this[kt]=false;this[vt]++;if(!this[at].length&&!this[it]){this[nt]()}}else if(t==="readable"&&this[ht]!==0){super.emit("readable")}else if(isEndish(t)&&this[V]){super.emit(t);this.removeAllListeners(t)}else if(t==="error"&&this[J]){const t=e;if(this[yt])defer((()=>t.call(this,this[J])));else t.call(this,this[J])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){const s=super.off(t,e);if(t==="data"){this[vt]=this.listeners("data").length;if(this[vt]===0&&!this[kt]&&!this[at].length){this[it]=false}}return s}removeAllListeners(t){const e=super.removeAllListeners(t);if(t==="data"||t===undefined){this[vt]=0;if(!this[kt]&&!this[at].length){this[it]=false}}return e}get emittedEnd(){return this[V]}[K](){if(!this[Y]&&!this[V]&&!this[ut]&&this[ot].length===0&&this[q]){this[Y]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[Z])this.emit("close");this[Y]=false}}emit(t,...e){const s=e[0];if(t!=="error"&&t!=="close"&&t!==ut&&this[ut]){return false}else if(t==="data"){return!this[ft]&&!s?false:this[yt]?(defer((()=>this[pt](s))),true):this[pt](s)}else if(t==="end"){return this[mt]()}else if(t==="close"){this[Z]=true;if(!this[V]&&!this[ut])return false;const t=super.emit("close");this.removeAllListeners("close");return t}else if(t==="error"){this[J]=s;super.emit(dt,s);const t=!this[St]||this.listeners("error").length?super.emit("error",s):false;this[K]();return t}else if(t==="resume"){const t=super.emit("resume");this[K]();return t}else if(t==="finish"||t==="prefinish"){const e=super.emit(t);this.removeAllListeners(t);return e}const i=super.emit(t,...e);this[K]();return i}[pt](t){for(const e of this[at]){if(e.dest.write(t)===false)this.pause()}const e=this[kt]?false:super.emit("data",t);this[K]();return e}[mt](){if(this[V])return false;this[V]=true;this.readable=false;return this[yt]?(defer((()=>this[gt]())),true):this[gt]()}[gt](){if(this[st]){const t=this[st].end();if(t){for(const e of this[at]){e.dest.write(t)}if(!this[kt])super.emit("data",t)}}for(const t of this[at]){t.end()}const t=super.emit("end");this.removeAllListeners("end");return t}async collect(){const t=Object.assign([],{dataLength:0});if(!this[ft])t.dataLength=0;const e=this.promise();this.on("data",(e=>{t.push(e);if(!this[ft])t.dataLength+=e.length}));await e;return t}async concat(){if(this[ft]){throw new Error("cannot concat in objectMode")}const t=await this.collect();return this[et]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,e)=>{this.on(ut,(()=>e(new Error("stream destroyed"))));this.on("error",(t=>e(t)));this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[kt]=false;let t=false;const stop=async()=>{this.pause();t=true;return{value:undefined,done:true}};const next=()=>{if(t)return stop();const e=this.read();if(e!==null)return Promise.resolve({done:false,value:e});if(this[q])return stop();let s;let i;const onerr=t=>{this.off("data",ondata);this.off("end",onend);this.off(ut,ondestroy);stop();i(t)};const ondata=t=>{this.off("error",onerr);this.off("end",onend);this.off(ut,ondestroy);this.pause();s({value:t,done:!!this[q]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(ut,ondestroy);stop();s({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((t,e)=>{i=e;s=t;this.once(ut,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[kt]=false;let t=false;const stop=()=>{this.pause();this.off(dt,stop);this.off(ut,stop);this.off("end",stop);t=true;return{done:true,value:undefined}};const next=()=>{if(t)return stop();const e=this.read();return e===null?stop():{done:false,value:e}};this.once("end",stop);this.once(dt,stop);this.once(ut,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(t){if(this[ut]){if(t)this.emit("error",t);else this.emit(ut);return this}this[ut]=true;this[kt]=true;this[ot].length=0;this[ht]=0;const e=this;if(typeof e.close==="function"&&!this[Z])e.close();if(t)this.emit("error",t);else this.emit(ut);return this}static get isStream(){return isStream}}const _t=U.realpathSync.native;const Et={lstatSync:U.lstatSync,readdir:U.readdir,readdirSync:U.readdirSync,readlinkSync:U.readlinkSync,realpathSync:_t,promises:{lstat:j.lstat,readdir:j.readdir,readlink:j.readlink,realpath:j.realpath}};const fsFromOption=t=>!t||t===Et||t===z?Et:{...Et,...t,promises:{...Et.promises,...t.promises||{}}};const Tt=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=t=>t.replace(/\//g,"\\").replace(Tt,"$1\\");const xt=/[\\\/]/;const Ct=0;const Rt=1;const Lt=2;const It=4;const At=6;const Mt=8;const Ot=10;const Pt=12;const Ft=15;const Nt=~Ft;const Bt=16;const Ut=32;const Dt=64;const zt=128;const jt=256;const Wt=512;const $t=Dt|zt|Wt;const Gt=1023;const entToType=t=>t.isFile()?Mt:t.isDirectory()?It:t.isSymbolicLink()?Ot:t.isCharacterDevice()?Lt:t.isBlockDevice()?At:t.isSocket()?Pt:t.isFIFO()?Rt:Ct;const Ht=new Map;const normalize=t=>{const e=Ht.get(t);if(e)return e;const s=t.normalize("NFKD");Ht.set(t,s);return s};const qt=new Map;const normalizeNocase=t=>{const e=qt.get(t);if(e)return e;const s=normalize(t.toLowerCase());qt.set(t,s);return s};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:t=>t.length+1})}}const Kt=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#rt;#nt;get dev(){return this.#nt}#ot;get mode(){return this.#ot}#at;get nlink(){return this.#at}#ht;get uid(){return this.#ht}#lt;get gid(){return this.#lt}#ct;get rdev(){return this.#ct}#ft;get blksize(){return this.#ft}#ut;get ino(){return this.#ut}#k;get size(){return this.#k}#dt;get blocks(){return this.#dt}#pt;get atimeMs(){return this.#pt}#mt;get mtimeMs(){return this.#mt}#gt;get ctimeMs(){return this.#gt}#yt;get birthtimeMs(){return this.#yt}#wt;get atime(){return this.#wt}#bt;get mtime(){return this.#bt}#St;get ctime(){return this.#St}#vt;get birthtime(){return this.#vt}#kt;#_t;#Et;#Tt;#xt;#Ct;#Rt;#Lt;#It;#At;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=Ct,s,i,r,n,o){this.name=t;this.#kt=r?normalizeNocase(t):normalize(t);this.#Rt=e&Gt;this.nocase=r;this.roots=i;this.root=s||this;this.#Lt=n;this.#Et=o.fullpath;this.#xt=o.relative;this.#Ct=o.relativePosix;this.parent=o.parent;if(this.parent){this.#rt=this.parent.#rt}else{this.#rt=fsFromOption(o.fs)}}depth(){if(this.#_t!==undefined)return this.#_t;if(!this.parent)return this.#_t=0;return this.#_t=this.parent.depth()+1}childrenCache(){return this.#Lt}resolve(t){if(!t){return this}const e=this.getRootString(t);const s=t.substring(e.length);const i=s.split(this.splitSep);const r=e?this.getRoot(e).#Mt(i):this.#Mt(i);return r}#Mt(t){let e=this;for(const s of t){e=e.child(s)}return e}children(){const t=this.#Lt.get(this);if(t){return t}const e=Object.assign([],{provisional:0});this.#Lt.set(this,e);this.#Rt&=~Bt;return e}child(t,e){if(t===""||t==="."){return this}if(t===".."){return this.parent||this}const s=this.children();const i=this.nocase?normalizeNocase(t):normalize(t);for(const t of s){if(t.#kt===i){return t}}const r=this.parent?this.sep:"";const n=this.#Et?this.#Et+r+t:undefined;const o=this.newChild(t,Ct,{...e,parent:this,fullpath:n});if(!this.canReaddir()){o.#Rt|=zt}s.push(o);return o}relative(){if(this.isCWD)return"";if(this.#xt!==undefined){return this.#xt}const t=this.name;const e=this.parent;if(!e){return this.#xt=this.name}const s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#Ct!==undefined)return this.#Ct;const t=this.name;const e=this.parent;if(!e){return this.#Ct=this.fullpathPosix()}const s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#Et!==undefined){return this.#Et}const t=this.name;const e=this.parent;if(!e){return this.#Et=this.name}const s=e.fullpath();const i=s+(!e.parent?"":this.sep)+t;return this.#Et=i}fullpathPosix(){if(this.#Tt!==undefined)return this.#Tt;if(this.sep==="/")return this.#Tt=this.fullpath();if(!this.parent){const t=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(t)){return this.#Tt=`//?/${t}`}else{return this.#Tt=t}}const t=this.parent;const e=t.fullpathPosix();const s=e+(!e||!t.parent?"":"/")+this.name;return this.#Tt=s}isUnknown(){return(this.#Rt&Ft)===Ct}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Rt&Ft)===Mt}isDirectory(){return(this.#Rt&Ft)===It}isCharacterDevice(){return(this.#Rt&Ft)===Lt}isBlockDevice(){return(this.#Rt&Ft)===At}isFIFO(){return(this.#Rt&Ft)===Rt}isSocket(){return(this.#Rt&Ft)===Pt}isSymbolicLink(){return(this.#Rt&Ot)===Ot}lstatCached(){return this.#Rt&Ut?this:undefined}readlinkCached(){return this.#It}realpathCached(){return this.#At}readdirCached(){const t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#It)return true;if(!this.parent)return false;const t=this.#Rt&Ft;return!(t!==Ct&&t!==Ot||this.#Rt&jt||this.#Rt&zt)}calledReaddir(){return!!(this.#Rt&Bt)}isENOENT(){return!!(this.#Rt&zt)}isNamed(t){return!this.nocase?this.#kt===normalize(t):this.#kt===normalizeNocase(t)}async readlink(){const t=this.#It;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=await this.#rt.promises.readlink(this.fullpath());const e=(await this.parent.realpath())?.resolve(t);if(e){return this.#It=e}}catch(t){this.#Ot(t.code);return undefined}}readlinkSync(){const t=this.#It;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=this.#rt.readlinkSync(this.fullpath());const e=this.parent.realpathSync()?.resolve(t);if(e){return this.#It=e}}catch(t){this.#Ot(t.code);return undefined}}#Pt(t){this.#Rt|=Bt;for(let e=t.provisional;e<t.length;e++){const s=t[e];if(s)s.#Ft()}}#Ft(){if(this.#Rt&zt)return;this.#Rt=(this.#Rt|zt)&Nt;this.#Nt()}#Nt(){const t=this.children();t.provisional=0;for(const e of t){e.#Ft()}}#Bt(){this.#Rt|=Wt;this.#Ut()}#Ut(){if(this.#Rt&Dt)return;let t=this.#Rt;if((t&Ft)===It)t&=Nt;this.#Rt=t|Dt;this.#Nt()}#Dt(t=""){if(t==="ENOTDIR"||t==="EPERM"){this.#Ut()}else if(t==="ENOENT"){this.#Ft()}else{this.children().provisional=0}}#zt(t=""){if(t==="ENOTDIR"){const t=this.parent;t.#Ut()}else if(t==="ENOENT"){this.#Ft()}}#Ot(t=""){let e=this.#Rt;e|=jt;if(t==="ENOENT")e|=zt;if(t==="EINVAL"||t==="UNKNOWN"){e&=Nt}this.#Rt=e;if(t==="ENOTDIR"&&this.parent){this.parent.#Ut()}}#jt(t,e){return this.#Wt(t,e)||this.#$t(t,e)}#$t(t,e){const s=entToType(t);const i=this.newChild(t.name,s,{parent:this});const r=i.#Rt&Ft;if(r!==It&&r!==Ot&&r!==Ct){i.#Rt|=Dt}e.unshift(i);e.provisional++;return i}#Wt(t,e){for(let s=e.provisional;s<e.length;s++){const i=e[s];const r=this.nocase?normalizeNocase(t.name):normalize(t.name);if(r!==i.#kt){continue}return this.#Gt(t,i,s,e)}}#Gt(t,e,s,i){const r=e.name;e.#Rt=e.#Rt&Nt|entToType(t);if(r!==t.name)e.name=t.name;if(s!==i.provisional){if(s===i.length-1)i.pop();else i.splice(s,1);i.unshift(e)}i.provisional++;return e}async lstat(){if((this.#Rt&zt)===0){try{this.#Ht(await this.#rt.promises.lstat(this.fullpath()));return this}catch(t){this.#zt(t.code)}}}lstatSync(){if((this.#Rt&zt)===0){try{this.#Ht(this.#rt.lstatSync(this.fullpath()));return this}catch(t){this.#zt(t.code)}}}#Ht(t){const{atime:e,atimeMs:s,birthtime:i,birthtimeMs:r,blksize:n,blocks:o,ctime:a,ctimeMs:h,dev:l,gid:c,ino:f,mode:u,mtime:d,mtimeMs:p,nlink:g,rdev:y,size:w,uid:b}=t;this.#wt=e;this.#pt=s;this.#vt=i;this.#yt=r;this.#ft=n;this.#dt=o;this.#St=a;this.#gt=h;this.#nt=l;this.#lt=c;this.#ut=f;this.#ot=u;this.#bt=d;this.#mt=p;this.#at=g;this.#ct=y;this.#k=w;this.#ht=b;const S=entToType(t);this.#Rt=this.#Rt&Nt|S|Ut;if(S!==Ct&&S!==It&&S!==Ot){this.#Rt|=Dt}}#qt=[];#Kt=false;#Vt(t){this.#Kt=false;const e=this.#qt.slice();this.#qt.length=0;e.forEach((e=>e(null,t)))}readdirCB(t,e=false){if(!this.canReaddir()){if(e)t(null,[]);else queueMicrotask((()=>t(null,[])));return}const s=this.children();if(this.calledReaddir()){const i=s.slice(0,s.provisional);if(e)t(null,i);else queueMicrotask((()=>t(null,i)));return}this.#qt.push(t);if(this.#Kt){return}this.#Kt=true;const i=this.fullpath();this.#rt.readdir(i,{withFileTypes:true},((t,e)=>{if(t){this.#Dt(t.code);s.provisional=0}else{for(const t of e){this.#jt(t,s)}this.#Pt(s)}this.#Vt(s.slice(0,s.provisional));return}))}#Yt;async readdir(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();if(this.#Yt){await this.#Yt}else{let resolve=()=>{};this.#Yt=new Promise((t=>resolve=t));try{for(const s of await this.#rt.promises.readdir(e,{withFileTypes:true})){this.#jt(s,t)}this.#Pt(t)}catch(e){this.#Dt(e.code);t.provisional=0}this.#Yt=undefined;resolve()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();try{for(const s of this.#rt.readdirSync(e,{withFileTypes:true})){this.#jt(s,t)}this.#Pt(t)}catch(e){this.#Dt(e.code);t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#Rt&$t)return false;const t=Ft&this.#Rt;if(!(t===Ct||t===It||t===Ot)){return false}return true}shouldWalk(t,e){return(this.#Rt&It)===It&&!(this.#Rt&$t)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#At)return this.#At;if((Wt|jt|zt)&this.#Rt)return undefined;try{const t=await this.#rt.promises.realpath(this.fullpath());return this.#At=this.resolve(t)}catch(t){this.#Bt()}}realpathSync(){if(this.#At)return this.#At;if((Wt|jt|zt)&this.#Rt)return undefined;try{const t=this.#rt.realpathSync(this.fullpath());return this.#At=this.resolve(t)}catch(t){this.#Bt()}}[Kt](t){if(t===this)return;t.isCWD=false;this.isCWD=true;const e=new Set([]);let s=[];let i=this;while(i&&i.parent){e.add(i);i.#xt=s.join(this.sep);i.#Ct=s.join("/");i=i.parent;s.push("..")}i=t;while(i&&i.parent&&!e.has(i)){i.#xt=undefined;i.#Ct=undefined;i=i.parent}}}class PathWin32 extends PathBase{sep="\\";splitSep=xt;constructor(t,e=Ct,s,i,r,n,o){super(t,e,s,i,r,n,o)}newChild(t,e=Ct,s={}){return new PathWin32(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return B.win32.parse(t).root}getRoot(t){t=uncToDrive(t.toUpperCase());if(t===this.root.name){return this.root}for(const[e,s]of Object.entries(this.roots)){if(this.sameRoot(t,e)){return this.roots[t]=s}}return this.roots[t]=new PathScurryWin32(t,this).root}sameRoot(t,e=this.root.name){t=t.toUpperCase().replace(/\//g,"\\").replace(Tt,"$1\\");return t===e}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(t,e=Ct,s,i,r,n,o){super(t,e,s,i,r,n,o)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=Ct,s={}){return new PathPosix(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}}class PathScurryBase{root;rootPath;roots;cwd;#Jt;#Zt;#Lt;nocase;#rt;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:r=16*1024,fs:n=Et}={}){this.#rt=fsFromOption(n);if(t instanceof URL||t.startsWith("file://")){t=(0,I.fileURLToPath)(t)}const o=e.resolve(t);this.roots=Object.create(null);this.rootPath=this.parseRootPath(o);this.#Jt=new ResolveCache;this.#Zt=new ResolveCache;this.#Lt=new ChildrenCache(r);const a=o.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]){a.pop()}if(i===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=i;this.root=this.newRoot(this.#rt);this.roots[this.rootPath]=this.root;let h=this.root;let l=a.length-1;const c=e.sep;let f=this.rootPath;let u=false;for(const t of a){const e=l--;h=h.child(t,{relative:new Array(e).fill("..").join(c),relativePosix:new Array(e).fill("..").join("/"),fullpath:f+=(u?"":c)+t});u=true}this.cwd=h}depth(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.depth()}childrenCache(){return this.#Lt}resolve(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(!i||i===".")continue;e=e?`${i}/${e}`:i;if(this.isAbsolute(i)){break}}const s=this.#Jt.get(e);if(s!==undefined){return s}const i=this.cwd.resolve(e).fullpath();this.#Jt.set(e,i);return i}resolvePosix(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(!i||i===".")continue;e=e?`${i}/${e}`:i;if(this.isAbsolute(i)){break}}const s=this.#Zt.get(e);if(s!==undefined){return s}const i=this.cwd.resolve(e).fullpathPosix();this.#Zt.set(e,i);return i}relative(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relative()}relativePosix(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relativePosix()}basename(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.name}dirname(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s}=e;if(!t.canReaddir()){return[]}else{const e=await t.readdir();return s?e:e.map((t=>t.name))}}readdirSync(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true}=e;if(!t.canReaddir()){return[]}else if(s){return t.readdirSync()}else{return t.readdirSync().map((t=>t.name))}}async lstat(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstat()}lstatSync(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;const o=[];if(!r||r(t)){o.push(s?t:t.fullpath())}const a=new Set;const walk=(t,e)=>{a.add(t);t.readdirCB(((t,h)=>{if(t){return e(t)}let l=h.length;if(!l)return e();const next=()=>{if(--l===0){e()}};for(const t of h){if(!r||r(t)){o.push(s?t:t.fullpath())}if(i&&t.isSymbolicLink()){t.realpath().then((t=>t?.isUnknown()?t.lstat():t)).then((t=>t?.shouldWalk(a,n)?walk(t,next):next()))}else{if(t.shouldWalk(a,n)){walk(t,next)}else{next()}}}}),true)};const h=t;return new Promise(((t,e)=>{walk(h,(s=>{if(s)return e(s);t(o)}))}))}walkSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;const o=[];if(!r||r(t)){o.push(s?t:t.fullpath())}const a=new Set([t]);for(const t of a){const e=t.readdirSync();for(const t of e){if(!r||r(t)){o.push(s?t:t.fullpath())}let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(a,n)){a.add(e)}}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}return this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;if(!r||r(t)){yield s?t:t.fullpath()}const o=new Set([t]);for(const t of o){const e=t.readdirSync();for(const t of e){if(!r||r(t)){yield s?t:t.fullpath()}let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(o,n)){o.add(e)}}}}stream(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;const o=new Minipass({objectMode:true});if(!r||r(t)){o.write(s?t:t.fullpath())}const a=new Set;const h=[t];let l=0;const process=()=>{let t=false;while(!t){const e=h.shift();if(!e){if(l===0)o.end();return}l++;a.add(e);const onReaddir=(e,f,u=false)=>{if(e)return o.emit("error",e);if(i&&!u){const t=[];for(const e of f){if(e.isSymbolicLink()){t.push(e.realpath().then((t=>t?.isUnknown()?t.lstat():t)))}}if(t.length){Promise.all(t).then((()=>onReaddir(null,f,true)));return}}for(const e of f){if(e&&(!r||r(e))){if(!o.write(s?e:e.fullpath())){t=true}}}l--;for(const t of f){const e=t.realpathCached()||t;if(e.shouldWalk(a,n)){h.push(e)}}if(t&&!o.flowing){o.once("drain",process)}else if(!c){process()}};let c=true;e.readdirCB(onReaddir,true);c=false}};process();return o}streamSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;const o=new Minipass({objectMode:true});const a=new Set;if(!r||r(t)){o.write(s?t:t.fullpath())}const h=[t];let l=0;const process=()=>{let t=false;while(!t){const e=h.shift();if(!e){if(l===0)o.end();return}l++;a.add(e);const c=e.readdirSync();for(const e of c){if(!r||r(e)){if(!o.write(s?e:e.fullpath())){t=true}}}l--;for(const t of c){let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(a,n)){h.push(e)}}}if(t&&!o.flowing)o.once("drain",process)};process();return o}chdir(t=this.cwd){const e=this.cwd;this.cwd=typeof t==="string"?this.cwd.resolve(t):t;this.cwd[Kt](e)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(t=process.cwd(),e={}){const{nocase:s=true}=e;super(t,B.win32,"\\",{...e,nocase:s});this.nocase=s;for(let t=this.cwd;t;t=t.parent){t.nocase=this.nocase}}parseRootPath(t){return B.win32.parse(t).root.toUpperCase()}newRoot(t){return new PathWin32(this.rootPath,It,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(t=process.cwd(),e={}){const{nocase:s=false}=e;super(t,B.posix,"/",{...e,nocase:s});this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new PathPosix(this.rootPath,It,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(t=process.cwd(),e={}){const{nocase:s=true}=e;super(t,{...e,nocase:s})}}const Vt=process.platform==="win32"?PathWin32:PathPosix;const Yt=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix;const isPatternList=t=>t.length>=1;const isGlobList=t=>t.length>=1;class Pattern{#Xt;#Qt;#te;length;#ee;#se;#ie;#re;#ne;#oe;#ae=true;constructor(t,e,s,i){if(!isPatternList(t)){throw new TypeError("empty pattern list")}if(!isGlobList(e)){throw new TypeError("empty glob list")}if(e.length!==t.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=t.length;if(s<0||s>=this.length){throw new TypeError("index out of range")}this.#Xt=t;this.#Qt=e;this.#te=s;this.#ee=i;if(this.#te===0){if(this.isUNC()){const[t,e,s,i,...r]=this.#Xt;const[n,o,a,h,...l]=this.#Qt;if(r[0]===""){r.shift();l.shift()}const c=[t,e,s,i,""].join("/");const f=[n,o,a,h,""].join("/");this.#Xt=[c,...r];this.#Qt=[f,...l];this.length=this.#Xt.length}else if(this.isDrive()||this.isAbsolute()){const[t,...e]=this.#Xt;const[s,...i]=this.#Qt;if(e[0]===""){e.shift();i.shift()}const r=t+"/";const n=s+"/";this.#Xt=[r,...e];this.#Qt=[n,...i];this.length=this.#Xt.length}}}pattern(){return this.#Xt[this.#te]}isString(){return typeof this.#Xt[this.#te]==="string"}isGlobstar(){return this.#Xt[this.#te]===E}isRegExp(){return this.#Xt[this.#te]instanceof RegExp}globString(){return this.#ie=this.#ie||(this.#te===0?this.isAbsolute()?this.#Qt[0]+this.#Qt.slice(1).join("/"):this.#Qt.join("/"):this.#Qt.slice(this.#te).join("/"))}hasMore(){return this.length>this.#te+1}rest(){if(this.#se!==undefined)return this.#se;if(!this.hasMore())return this.#se=null;this.#se=new Pattern(this.#Xt,this.#Qt,this.#te+1,this.#ee);this.#se.#oe=this.#oe;this.#se.#ne=this.#ne;this.#se.#re=this.#re;return this.#se}isUNC(){const t=this.#Xt;return this.#ne!==undefined?this.#ne:this.#ne=this.#ee==="win32"&&this.#te===0&&t[0]===""&&t[1]===""&&typeof t[2]==="string"&&!!t[2]&&typeof t[3]==="string"&&!!t[3]}isDrive(){const t=this.#Xt;return this.#re!==undefined?this.#re:this.#re=this.#ee==="win32"&&this.#te===0&&this.length>1&&typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){const t=this.#Xt;return this.#oe!==undefined?this.#oe:this.#oe=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){const t=this.#Xt[0];return typeof t==="string"&&this.isAbsolute()&&this.#te===0?t:""}checkFollowGlobstar(){return!(this.#te===0||!this.isGlobstar()||!this.#ae)}markFollowGlobstar(){if(this.#te===0||!this.isGlobstar()||!this.#ae)return false;this.#ae=false;return true}}const Jt=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:r,platform:n=Jt}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=n;this.mmopts={dot:true,nobrace:e,nocase:s,noext:i,noglobstar:r,optimizationLevel:2,platform:n,nocomment:true,nonegate:true};for(const e of t)this.add(e)}add(t){const e=new Minimatch(t,this.mmopts);for(let t=0;t<e.set.length;t++){const s=e.set[t];const i=e.globParts[t];if(!s||!i){throw new Error("invalid pattern object")}while(s[0]==="."&&i[0]==="."){s.shift();i.shift()}const r=new Pattern(s,i,0,this.platform);const n=new Minimatch(r.globString(),this.mmopts);const o=i[i.length-1]==="**";const a=r.isAbsolute();if(a)this.absolute.push(n);else this.relative.push(n);if(o){if(a)this.absoluteChildren.push(n);else this.relativeChildren.push(n)}}}ignored(t){const e=t.fullpath();const s=`${e}/`;const i=t.relative()||".";const r=`${i}/`;for(const t of this.relative){if(t.match(i)||t.match(r))return true}for(const t of this.absolute){if(t.match(e)||t.match(s))return true}return false}childrenIgnored(t){const e=t.fullpath()+"/";const s=(t.relative()||".")+"/";for(const t of this.relativeChildren){if(t.match(s))return true}for(const t of this.absoluteChildren){if(t.match(e))return true}return false}}class HasWalkedCache{store;constructor(t=new Map){this.store=t}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){const s=t.fullpath();const i=this.store.get(s);if(i)i.add(e.globString());else this.store.set(s,new Set([e.globString()]))}}class MatchRecord{store=new Map;add(t,e,s){const i=(e?2:0)|(s?1:0);const r=this.store.get(t);this.store.set(t,r===undefined?i:i&r)}entries(){return[...this.store.entries()].map((([t,e])=>[t,!!(e&2),!!(e&1)]))}}class SubWalks{store=new Map;add(t,e){if(!t.canReaddir()){return}const s=this.store.get(t);if(s){if(!s.find((t=>t.globString()===e.globString()))){s.push(e)}}else this.store.set(t,[e])}get(t){const e=this.store.get(t);if(!e){throw new Error("attempting to walk unknown path")}return e}entries(){return this.keys().map((t=>[t,this.store.get(t)]))}keys(){return[...this.store.keys()].filter((t=>t.canReaddir()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(t,e){this.opts=t;this.follow=!!t.follow;this.dot=!!t.dot;this.hasWalkedCache=e?e.copy():new HasWalkedCache}processPatterns(t,e){this.patterns=e;const s=e.map((e=>[t,e]));for(let[t,e]of s){this.hasWalkedCache.storeWalked(t,e);const s=e.root();const i=e.isAbsolute()&&this.opts.absolute!==false;if(s){t=t.resolve(s==="/"&&this.opts.root!==undefined?this.opts.root:s);const i=e.rest();if(!i){this.matches.add(t,true,false);continue}else{e=i}}if(t.isENOENT())continue;let r;let n;let o=false;while(typeof(r=e.pattern())==="string"&&(n=e.rest())){const s=t.resolve(r);t=s;e=n;o=true}r=e.pattern();n=e.rest();if(o){if(this.hasWalkedCache.hasWalked(t,e))continue;this.hasWalkedCache.storeWalked(t,e)}if(typeof r==="string"){const e=r===".."||r===""||r===".";this.matches.add(t.resolve(r),i,e);continue}else if(r===E){if(!t.isSymbolicLink()||this.follow||e.checkFollowGlobstar()){this.subwalks.add(t,e)}const s=n?.pattern();const r=n?.rest();if(!n||(s===""||s===".")&&!r){this.matches.add(t,i,s===""||s===".")}else{if(s===".."){const e=t.parent||t;if(!r)this.matches.add(e,i,true);else if(!this.hasWalkedCache.hasWalked(e,r)){this.subwalks.add(e,r)}}}}else if(r instanceof RegExp){this.subwalks.add(t,e)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(t,e){const s=this.subwalks.get(t);const i=this.child();for(const t of e){for(const e of s){const s=e.isAbsolute();const r=e.pattern();const n=e.rest();if(r===E){i.testGlobstar(t,e,n,s)}else if(r instanceof RegExp){i.testRegExp(t,r,n,s)}else{i.testString(t,r,n,s)}}}return i}testGlobstar(t,e,s,i){if(this.dot||!t.name.startsWith(".")){if(!e.hasMore()){this.matches.add(t,i,false)}if(t.canReaddir()){if(this.follow||!t.isSymbolicLink()){this.subwalks.add(t,e)}else if(t.isSymbolicLink()){if(s&&e.checkFollowGlobstar()){this.subwalks.add(t,s)}else if(e.markFollowGlobstar()){this.subwalks.add(t,e)}}}}if(s){const e=s.pattern();if(typeof e==="string"&&e!==".."&&e!==""&&e!=="."){this.testString(t,e,s.rest(),i)}else if(e===".."){const e=t.parent||t;this.subwalks.add(e,s)}else if(e instanceof RegExp){this.testRegExp(t,e,s.rest(),i)}}}testRegExp(t,e,s,i){if(!e.test(t.name))return;if(!s){this.matches.add(t,i,false)}else{this.subwalks.add(t,s)}}testString(t,e,s,i){if(!t.isNamed(e))return;if(!s){this.matches.add(t,i,false)}else{this.subwalks.add(t,s)}}}const makeIgnore=(t,e)=>typeof t==="string"?new Ignore([t],e):Array.isArray(t)?new Ignore(t,e):t;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#he=[];#le;#ce;signal;maxDepth;includeChildMatches;constructor(t,e,s){this.patterns=t;this.path=e;this.opts=s;this.#ce=!s.posix&&s.platform==="win32"?"\\":"/";this.includeChildMatches=s.includeChildMatches!==false;if(s.ignore||!this.includeChildMatches){this.#le=makeIgnore(s.ignore??[],s);if(!this.includeChildMatches&&typeof this.#le.add!=="function"){const t="cannot ignore child matches, ignore lacks add() method.";throw new Error(t)}}this.maxDepth=s.maxDepth||Infinity;if(s.signal){this.signal=s.signal;this.signal.addEventListener("abort",(()=>{this.#he.length=0}))}}#fe(t){return this.seen.has(t)||!!this.#le?.ignored?.(t)}#ue(t){return!!this.#le?.childrenIgnored?.(t)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let t=undefined;while(!this.paused&&(t=this.#he.shift())){t()}}onResume(t){if(this.signal?.aborted)return;if(!this.paused){t()}else{this.#he.push(t)}}async matchCheck(t,e){if(e&&this.opts.nodir)return undefined;let s;if(this.opts.realpath){s=t.realpathCached()||await t.realpath();if(!s)return undefined;t=s}const i=t.isUnknown()||this.opts.stat;const r=i?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){const t=await r.realpath();if(t&&(t.isUnknown()||this.opts.stat)){await t.lstat()}}return this.matchCheckTest(r,e)}matchCheckTest(t,e){return t&&(this.maxDepth===Infinity||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#fe(t)?t:undefined}matchCheckSync(t,e){if(e&&this.opts.nodir)return undefined;let s;if(this.opts.realpath){s=t.realpathCached()||t.realpathSync();if(!s)return undefined;t=s}const i=t.isUnknown()||this.opts.stat;const r=i?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){const t=r.realpathSync();if(t&&(t?.isUnknown()||this.opts.stat)){t.lstatSync()}}return this.matchCheckTest(r,e)}matchFinish(t,e){if(this.#fe(t))return;if(!this.includeChildMatches&&this.#le?.add){const e=`${t.relativePosix()}/**`;this.#le.add(e)}const s=this.opts.absolute===undefined?e:this.opts.absolute;this.seen.add(t);const i=this.opts.mark&&t.isDirectory()?this.#ce:"";if(this.opts.withFileTypes){this.matchEmit(t)}else if(s){const e=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(e+i)}else{const e=this.opts.posix?t.relativePosix():t.relative();const s=this.opts.dotRelative&&!e.startsWith(".."+this.#ce)?"."+this.#ce:"";this.matchEmit(!e?"."+i:s+e+i)}}async match(t,e,s){const i=await this.matchCheck(t,s);if(i)this.matchFinish(i,e)}matchSync(t,e,s){const i=this.matchCheckSync(t,s);if(i)this.matchFinish(i,e)}walkCB(t,e,s){if(this.signal?.aborted)s();this.walkCB2(t,e,new Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#ue(t))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2(t,e,s,i)));return}s.processPatterns(t,e);let r=1;const next=()=>{if(--r===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#fe(t))continue;r++;this.match(t,e,i).then((()=>next()))}for(const t of s.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}r++;const e=t.readdirCached();if(t.calledReaddir())this.walkCB3(t,e,s,next);else{t.readdirCB(((e,i)=>this.walkCB3(t,i,s,next)),true)}}next()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let r=1;const next=()=>{if(--r===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#fe(t))continue;r++;this.match(t,e,i).then((()=>next()))}for(const[t,e]of s.subwalks.entries()){r++;this.walkCB2(t,e,s.child(),next)}next()}walkCBSync(t,e,s){if(this.signal?.aborted)s();this.walkCB2Sync(t,e,new Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#ue(t))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2Sync(t,e,s,i)));return}s.processPatterns(t,e);let r=1;const next=()=>{if(--r===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#fe(t))continue;this.matchSync(t,e,i)}for(const t of s.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}r++;const e=t.readdirSync();this.walkCB3Sync(t,e,s,next)}next()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let r=1;const next=()=>{if(--r===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#fe(t))continue;this.matchSync(t,e,i)}for(const[t,e]of s.subwalks.entries()){r++;this.walkCB2Sync(t,e,s.child(),next)}next()}}class GlobWalker extends GlobUtil{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((t,e)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){e(this.signal.reason)}else{t(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}class GlobStream extends GlobUtil{results;constructor(t,e,s){super(t,e,s);this.results=new Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(t){this.results.write(t);if(!this.results.flowing)this.pause()}stream(){const t=this.path;if(t.isUnknown()){t.lstat().then((()=>{this.walkCB(t,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(t,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}const Zt=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");this.withFileTypes=!!e.withFileTypes;this.signal=e.signal;this.follow=!!e.follow;this.dot=!!e.dot;this.dotRelative=!!e.dotRelative;this.nodir=!!e.nodir;this.mark=!!e.mark;if(!e.cwd){this.cwd=""}else if(e.cwd instanceof URL||e.cwd.startsWith("file://")){e.cwd=(0,I.fileURLToPath)(e.cwd)}this.cwd=e.cwd||"";this.root=e.root;this.magicalBraces=!!e.magicalBraces;this.nobrace=!!e.nobrace;this.noext=!!e.noext;this.realpath=!!e.realpath;this.absolute=e.absolute;this.includeChildMatches=e.includeChildMatches!==false;this.noglobstar=!!e.noglobstar;this.matchBase=!!e.matchBase;this.maxDepth=typeof e.maxDepth==="number"?e.maxDepth:Infinity;this.stat=!!e.stat;this.ignore=e.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof t==="string"){t=[t]}this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false;if(this.windowsPathsNoEscape){t=t.map((t=>t.replace(/\\/g,"/")))}if(this.matchBase){if(e.noglobstar){throw new TypeError("base matching requires globstar")}t=t.map((t=>t.includes("/")?t:`./**/${t}`))}this.pattern=t;this.platform=e.platform||Zt;this.opts={...e,platform:this.platform};if(e.scurry){this.scurry=e.scurry;if(e.nocase!==undefined&&e.nocase!==e.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const t=e.platform==="win32"?PathScurryWin32:e.platform==="darwin"?PathScurryDarwin:e.platform?PathScurryPosix:Yt;this.scurry=new t(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;const s=this.platform==="darwin"||this.platform==="win32";const i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const r=this.pattern.map((t=>new Minimatch(t,i)));const[n,o]=r.reduce(((t,e)=>{t[0].push(...e.set);t[1].push(...e.globParts);return t}),[[],[]]);this.patterns=n.map(((t,e)=>{const s=o[e];if(!s)throw new Error("invalid pattern object");return new Pattern(t,s,0,this.platform)}))}async walk(){return[...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}const hasMagic=(t,e={})=>{if(!Array.isArray(t)){t=[t]}for(const s of t){if(new Minimatch(s,e).hasMagic())return true}return false};function globStreamSync(t,e={}){return new Glob(t,e).streamSync()}function globStream(t,e={}){return new Glob(t,e).stream()}function globSync(t,e={}){return new Glob(t,e).walkSync()}async function glob_(t,e={}){return new Glob(t,e).walk()}function globIterateSync(t,e={}){return new Glob(t,e).iterateSync()}function globIterate(t,e={}){return new Glob(t,e).iterate()}const Xt=globStreamSync;const Qt=Object.assign(globStream,{sync:globStreamSync});const te=globIterateSync;const ee=Object.assign(globIterate,{sync:globIterateSync});const se=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});const ie=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:se,globStream:globStream,stream:Qt,globStreamSync:globStreamSync,streamSync:Xt,globIterate:globIterate,iterate:ee,globIterateSync:globIterateSync,iterateSync:te,Glob:Glob,hasMagic:hasMagic,escape:escape_escape,unescape:unescape_unescape});ie.glob=ie;const re=require("wdio-ctrf-json-reporter");var ne=__nccwpck_require__.n(re);var oe=__nccwpck_require__(322);async function uploadToApi(t){return(0,oe.uploadTestRun)({report:t.report,apiKey:t.apiKey,commitSha:t.commitSha,branch:t.branch,repositoryUrl:t.repositoryUrl,buildName:t.buildName,buildNumber:t.buildNumber,buildUrl:t.buildUrl,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,testType:t.testType})}class TestreamWebdriverIOReporter extends(ne()){constructor(t){const e={...t,outputDir:t.outputDir||"ctrf",testType:t.testType||"e2e",stdout:false,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,buildName:t.buildName,buildNumber:t.buildNumber,branchName:t.branch,commit:t.commitSha};super(e);this.config={apiKey:t.apiKey||"",branch:t.branch,commitSha:t.commitSha,repositoryUrl:t.repositoryUrl,uploadEnabled:t.uploadEnabled!==false,failOnUploadError:t.failOnUploadError||false,outputDir:t.outputDir||"ctrf",outputFile:t.outputFile||"ctrf-report.json",buildName:t.buildName,buildNumber:t.buildNumber,buildUrl:t.buildUrl,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,testType:t.testType||"e2e"};this._outputDir=this.config.outputDir||"ctrf";this._outputFile=this.config.outputFile||"ctrf-report.json"}onRunnerEnd(t){super.onRunnerEnd(t)}static async aggregateAndUpload(s,i){const r=s||"ctrf";const n=e.join(r,"ctrf-*.json");const o=await ie(n);if(o.length===0){console.warn("[testream] No CTRF reports found to merge");return}const a=[];for(const e of o){try{const s=await t.readFile(e,"utf-8");const i=JSON.parse(s);a.push(i)}catch(t){console.error(`[testream] Failed to read ${e}: ${t instanceof Error?t.message:String(t)}`)}}if(a.length===0){console.error("[testream] No valid CTRF reports found");return}const h=TestreamWebdriverIOReporter.mergeReports(a);const l=h.results.summary.tests;console.info(`[testream] Merged ${a.length} reports (${l} tests)`);const c=e.join(r,"ctrf-report.json");await t.writeFile(c,JSON.stringify(h,null,2));console.info(`[testream] Merged report written to: ${c}`);const f=i.uploadEnabled!==false;const u=i.apiKey||"";if(f&&u){await TestreamWebdriverIOReporter.uploadMergedReport(h,i)}else if(!u){console.warn("[testream] No API key provided, skipping upload")}else if(!f){console.info("[testream] Upload disabled, skipping upload")}for(const e of o){if(e!==c){try{await t.unlink(e)}catch{}}}}static mergeReports(t){const e=t.map((t=>t.results.summary));const s=t[0];const i=new Set;for(const e of t){for(const t of e.results.tests){if(t.suite){i.add(t.suite)}}}const r={reportFormat:s.reportFormat,specVersion:s.specVersion,reportId:s.reportId,timestamp:(new Date).toISOString(),generatedBy:s.generatedBy,extra:s.extra,results:{tool:{name:"webdriverio"},summary:{tests:e.reduce(((t,e)=>t+e.tests),0),passed:e.reduce(((t,e)=>t+e.passed),0),failed:e.reduce(((t,e)=>t+e.failed),0),skipped:e.reduce(((t,e)=>t+e.skipped),0),pending:e.reduce(((t,e)=>t+e.pending),0),other:e.reduce(((t,e)=>t+e.other),0),suites:i.size,start:Math.min(...e.map((t=>t.start))),stop:Math.max(...e.map((t=>t.stop)))},tests:t.flatMap((t=>t.results.tests)),environment:s.results.environment}};return r}static async uploadMergedReport(t,e){const s=(0,oe.detectCIContext)();const i=e.branch||s.branch;const r=e.commitSha||s.commitSha;const n=e.repositoryUrl||s.repositoryUrl;const o=e.buildNumber||s.buildNumber;const a=e.buildUrl||s.buildUrl;console.info("[testream] Uploading test results...");const h=await uploadToApi({report:t,apiKey:e.apiKey||"",branch:i,commitSha:r,repositoryUrl:n,buildName:e.buildName,buildNumber:o,buildUrl:a,testEnvironment:e.testEnvironment,appName:e.appName,appVersion:e.appVersion,testType:e.testType});if(h.success){console.info("[testream] Upload successful!");if(h.testRunId){console.info(`[testream] Test run ID: ${h.testRunId}`)}}else{console.error(`[testream] Upload failed: ${h.error}`);if(e.failOnUploadError){throw new Error(`Testream upload failed: ${h.error}`)}}}}const ae=null&&TestreamWebdriverIOReporter;class TestreamLauncherService{constructor(t,e,s){this.options=t}async onPrepare(){const s=this.options.outputDir||"ctrf";const i=e.join(s,"ctrf-*.json");const r=await ie(i);if(r.length>0){console.info(`[testream] Cleaning ${r.length} stale report(s) from ${s}`);for(const e of r){try{await t.unlink(e)}catch{}}}}async onComplete(){const t=this.options.outputDir||"ctrf";await TestreamWebdriverIOReporter.aggregateAndUpload(t,this.options)}}})();module.exports=s})();
@@ -0,0 +1,57 @@
1
+ import type { RunnerStats } from '@wdio/reporter';
2
+ import type { Reporters } from '@wdio/types';
3
+ import WdioCtrfJsonReporter from 'wdio-ctrf-json-reporter';
4
+ /**
5
+ * Merged options type combining WDIO reporter options with our custom config
6
+ */
7
+ export interface ReporterOptions extends Partial<Reporters.Options> {
8
+ apiKey?: string;
9
+ branch?: string;
10
+ commitSha?: string;
11
+ repositoryUrl?: string;
12
+ uploadEnabled?: boolean;
13
+ failOnUploadError?: boolean;
14
+ outputDir?: string;
15
+ outputFile?: string;
16
+ buildName?: string;
17
+ buildNumber?: string;
18
+ buildUrl?: string;
19
+ testEnvironment?: string;
20
+ appName?: string;
21
+ appVersion?: string;
22
+ testType?: string;
23
+ }
24
+ /**
25
+ * Testream WebdriverIO Reporter
26
+ *
27
+ * Extends wdio-ctrf-json-reporter to generate CTRF reports and upload them to Testream.
28
+ * Uses inheritance to properly integrate with WebdriverIO's reporter system.
29
+ */
30
+ export declare class TestreamWebdriverIOReporter extends WdioCtrfJsonReporter {
31
+ private config;
32
+ private readonly _outputDir;
33
+ private readonly _outputFile;
34
+ constructor(options: ReporterOptions);
35
+ /**
36
+ * Called when the test runner ends
37
+ * Note: Upload is NOT done here - use aggregateAndUpload() in wdio onComplete hook
38
+ */
39
+ onRunnerEnd(runner: RunnerStats): void;
40
+ /**
41
+ * Aggregate all per-spec CTRF reports into a single merged report and upload once.
42
+ * Call this from wdio.conf.ts onComplete hook.
43
+ *
44
+ * @param outputDir - Directory containing per-spec CTRF JSON files (default: 'ctrf')
45
+ * @param config - Reporter configuration options
46
+ */
47
+ static aggregateAndUpload(outputDir: string, config: Partial<ReporterOptions>): Promise<void>;
48
+ /**
49
+ * Merge multiple CTRF reports into one
50
+ */
51
+ private static mergeReports;
52
+ /**
53
+ * Upload the merged report to Testream API
54
+ */
55
+ private static uploadMergedReport;
56
+ }
57
+ export default TestreamWebdriverIOReporter;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/jira-test-manager/jira-test-manager/packages/webdriverio-reporter/src/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAK3D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,qBAAa,2BAA4B,SAAQ,oBAAoB;IACnE,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,OAAO,EAAE,eAAe;IA2CpC;;;OAGG;IACH,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAMtC;;;;;;OAMG;WACU,kBAAkB,CAC7B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC;IAmEhB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IA2C3B;;OAEG;mBACkB,kBAAkB;CA6CxC;AAED,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { ReporterOptions } from './reporter';
2
+ /**
3
+ * Testream Launcher Service
4
+ *
5
+ * WDIO launcher service that runs in the main process.
6
+ * Handles cleanup of stale reports (onPrepare) and
7
+ * aggregation + upload (onComplete) automatically.
8
+ *
9
+ * Usage in wdio.conf.ts:
10
+ * services: [['@testream/webdriverio-reporter', testreamConfig]]
11
+ */
12
+ export declare class TestreamLauncherService {
13
+ private options;
14
+ constructor(options: Partial<ReporterOptions>, _caps: unknown, _config: unknown);
15
+ /**
16
+ * Runs before test execution begins.
17
+ * Cleans up stale per-spec CTRF reports from previous runs.
18
+ */
19
+ onPrepare(): Promise<void>;
20
+ /**
21
+ * Runs after all workers have completed.
22
+ * Aggregates per-spec CTRF reports and uploads to Testream.
23
+ */
24
+ onComplete(): Promise<void>;
25
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/jira-test-manager/jira-test-manager/packages/webdriverio-reporter/src/service.ts"],"names":[],"mappings":"AAGA,OAAO,EAA+B,eAAe,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;;;;;GASG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,OAAO,CAA2B;gBAGxC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,EACjC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO;IAKlB;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBhC;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAOlC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Re-export CTRF types from shared-types package
3
+ */
4
+ export type { CTRFReport, CTRFTest, CTRFSummary, CTRFResults, CTRFAttachment, CTRFStep, } from '@jira-test-manager/shared-types';
5
+ /**
6
+ * Re-export API types from shared-types package
7
+ */
8
+ export type { IngestResponse, ApiErrorResponse, UploadResult, CIContext, } from '@jira-test-manager/shared-types';
9
+ /**
10
+ * WebdriverIO Reporter Configuration Options
11
+ */
12
+ export interface WebdriverIOReporterConfig {
13
+ /**
14
+ * API key for authentication with Testream
15
+ * @required
16
+ */
17
+ apiKey: string;
18
+ /**
19
+ * Git branch name (auto-detected from CI environment if not provided)
20
+ */
21
+ branch?: string;
22
+ /**
23
+ * Git commit SHA (auto-detected from CI environment if not provided)
24
+ */
25
+ commitSha?: string;
26
+ /**
27
+ * Git repository URL (auto-detected from CI environment if not provided)
28
+ */
29
+ repositoryUrl?: string;
30
+ /**
31
+ * Enable/disable automatic upload to Testream backend
32
+ * @default true
33
+ */
34
+ uploadEnabled?: boolean;
35
+ /**
36
+ * Fail the test run if upload fails
37
+ * @default false
38
+ */
39
+ failOnUploadError?: boolean;
40
+ /**
41
+ * Directory where CTRF report will be written
42
+ * @default 'ctrf'
43
+ */
44
+ outputDir?: string;
45
+ /**
46
+ * Filename for the CTRF report
47
+ * @default 'ctrf-report.json'
48
+ */
49
+ outputFile?: string;
50
+ /**
51
+ * Build name/identifier
52
+ */
53
+ buildName?: string;
54
+ /**
55
+ * Build number
56
+ */
57
+ buildNumber?: string;
58
+ /**
59
+ * Build URL (CI pipeline URL)
60
+ */
61
+ buildUrl?: string;
62
+ /**
63
+ * Test environment (e.g., 'staging', 'production', 'ci')
64
+ */
65
+ testEnvironment?: string;
66
+ /**
67
+ * Application name under test
68
+ */
69
+ appName?: string;
70
+ /**
71
+ * Application version under test
72
+ */
73
+ appVersion?: string;
74
+ /**
75
+ * Test type identifier
76
+ * @default 'e2e'
77
+ */
78
+ testType?: string;
79
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/jira-test-manager/jira-test-manager/packages/webdriverio-reporter/src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,cAAc,EACd,QAAQ,GACT,MAAM,iCAAiC,CAAC;AAEzC;;GAEG;AACH,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,SAAS,GACV,MAAM,iCAAiC,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,7 @@
1
+ import { UploadResult } from './types';
2
+ import { detectCIContext, UploadTestRunOptions } from '@jira-test-manager/shared-types';
3
+ /**
4
+ * Upload CTRF report to Testream API
5
+ */
6
+ export declare function uploadToApi(options: UploadTestRunOptions): Promise<UploadResult>;
7
+ export { detectCIContext };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/jira-test-manager/jira-test-manager/packages/webdriverio-reporter/src/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,eAAe,EAEf,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAEzC;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,CAetF;AAGD,OAAO,EAAE,eAAe,EAAE,CAAC"}