@skyramp/testbot-core 0.13.1-v3.458 → 0.13.1-v3.459

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/VERSION.json CHANGED
@@ -1 +1 @@
1
- {"version":"0.13.1-v3.458","commit":"1836e6e913aa24ae4d07e847bc5cb538a46c1075"}
1
+ {"version":"0.13.1-v3.459","commit":"a77d6e4adf3271a96074a2c976bdab3a56354546"}
package/dist/main.js CHANGED
@@ -826,7 +826,7 @@ ${n.body??""}`);return r.some(i=>s.includes(i))})}requirement(t){let r=()=>Uke(t
826
826
  ${String(r??"")}`.trim()};function EVr(e){return U_t(e).split(`
827
827
  `).pop()||e.message.split(`
828
828
  `)[0]}var vVr=e=>/does not support chromium on ubuntu[\d.]+-(\S+)/.exec(U_t(e))?.[1];function SVr(e,t,r=RTe.execFileSync){let n=s=>{let i=Co([process.execPath,Ss.join(e,"playwright","cli.js"),"install","chromium"],e,Le(process.env,{PLAYWRIGHT_BROWSERS_PATH:t,...s?{PLAYWRIGHT_HOST_PLATFORM_OVERRIDE:s}:{}}));return r(i.argv[0],i.argv.slice(1),{cwd:e,stdio:["ignore","pipe","pipe"],timeout:3e5,env:i.env})};try{n()}catch(s){let i=vVr(s);if(!i)throw s;let o=`ubuntu24.04-${i}`;return n(o),o}}function xVr(e){Pd.mkdirSync(e,{recursive:!0});let t=Co(["npm","install","--prefix",e,"--no-save","--no-audit","--no-fund","--loglevel=error",`${oi}@${gL}`],e,Le());(0,RTe.execFileSync)(t.argv[0],t.argv.slice(1),{cwd:e,env:t.env,stdio:["ignore","ignore","pipe"],timeout:18e4})}var Bd=H(require("fs")),Qs=H(require("path"));var CVr="@skyramp/mcp",IVr=["build/tools/generate-tests/generateContractRestTool.js","build/tools/generate-tests/generateIntegrationRestTool.js","build/tools/generate-tests/generateFuzzRestTool.js","build/services/TestGenerationService.js","build/services/ScenarioGenerationService.js"],RVr="TESTBOT_SKYRAMP_HELPERS";function j_t(e,t=process.env){let r=(e?.trim()||t[RVr]?.trim()||"on").toLowerCase();if(r==="on"||r==="true")return!0;if(r==="off"||r==="false")return!1;throw new Error(`skyramp helpers must be on or off (got "${r}")`)}function kVr(){return[Qs.resolve(__dirname,"../assets/skyramp-api/gen.cjs"),Qs.resolve(__dirname,"../../../assets/skyramp-api/gen.cjs")].find(e=>Bd.existsSync(e))}var q_t=e=>{try{return Bd.statSync(e).isFile()}catch{return!1}};function TVr(e){for(let t of[e?.command,...e?.args??[]]){if(!t||!q_t(Qs.resolve(t)))continue;let r=Qs.dirname(Qs.resolve(t));for(let n=0;n<6;n++){try{if(JSON.parse(Bd.readFileSync(Qs.join(r,"package.json"),"utf-8")).name===CVr)return r}catch{}let s=Qs.dirname(r);if(s===r)break;r=s}}}function _Vr(e){let t=e;for(let r=0;r<6;r++){let n=Qs.basename(t)==="node_modules"?t:Qs.join(t,"node_modules");if(Bd.existsSync(Qs.join(n,oi,"package.json")))return n;let s=Qs.dirname(t);if(s===t)break;t=s}}function z_t(e,t,r={}){let n=kVr();if(!n)return{note:"the Skyramp API helper is not bundled with this build"};let s=TVr(t);if(!s)return{note:"the Skyramp API helper needs the Skyramp MCP package, which was not found"};let i=IVr.filter(d=>!q_t(Qs.join(s,d)));if(i.length)return{note:`the Skyramp MCP package at ${s} lacks ${i.join(", ")}, which the Skyramp API helper reuses`};let o=r.sdk??_Vr(s);if(!o)return{note:`the Skyramp API helper needs ${oi}, which is not installed beside the Skyramp MCP package`};let a=Qs.join(e,"skyramp-api"),c=Qs.join(a,"drafts");Bd.mkdirSync(c,{recursive:!0});let u=Qs.join(a,"generated.jsonl"),l={SKYRAMP_API:n,SKYRAMP_API_MCP:s,SKYRAMP_API_SDK:o,SKYRAMP_API_DRAFTS:c,SKYRAMP_API_LOG:u,NODE_PATH:[o,process.env.NODE_PATH].filter(Boolean).join(Qs.delimiter)};if(t?.runToken){let d=Qs.join(a,"run-token");Bd.writeFileSync(d,t.runToken,{mode:384}),l.SKYRAMP_API_TOKEN_FILE=d}else t?.licensePath&&(l.SKYRAMP_API_LICENSE_FILE=t.licensePath);return{api:{helper:n,drafts:c,log:u,env:l}}}function G_t(e){let t;try{t=Bd.readFileSync(e,"utf-8")}catch{return[]}return t.split(`
829
- `).flatMap(r=>{try{let n=JSON.parse(r);return n&&typeof n=="object"?[n]:[]}catch{return[]}})}function J8(...e){let t=e.filter(n=>!!n);if(!t.length)return;let r=[...new Set(t.flatMap(n=>(n.NODE_PATH??"").split(Qs.delimiter)).filter(Boolean))].join(Qs.delimiter);return Object.assign({},...t,r?{NODE_PATH:r}:{})}var Y8=H(require("fs")),va=H(require("path"));var TTe="write-skyramp-page",NVr=/\bnewSkyrampPlaywrightPage\b|\bSkyrampPlaywrightPage\b|\bnew_skyramp_playwright_page\b/,PVr=/@playwright\/test|from\s+['"]playwright|@skyramp\/skyramp|\bpage\.(?:goto|locator|getBy\w+)\s*\(|playwright\.(?:sync|async)_api/,BVr=/@testing-library\/|from ["']enzyme["']|from ["']vitest["']|from ["']@jest\/globals["']/,$Vr=/(?:\bfrom|\bimport|\brequire\()\s*\(?\s*['"]([^'"]+)['"]/g,OVr=/^\s*(?:from\s+(\.*[\w.]*)\s+import|import\s+([\w.]+))/gm,DVr=e=>Yu.test(e)||/\.e2e\.[cm]?[jt]sx?$/.test(e),MVr=["",".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts","/index.ts","/index.js"],FVr={js:{files:["package.json"],spec:e=>{try{let t=JSON.parse(e),r=["dependencies","devDependencies","peerDependencies","optionalDependencies"].map(n=>t[n]?.["@skyramp/skyramp"]).find(n=>n!==void 0);return r===void 0?void 0:String(r).trim()}catch{return}}},py:{files:["requirements.txt","requirements-dev.txt","requirements-test.txt","pyproject.toml","setup.cfg","setup.py"],spec:e=>{if(!/(^|["'\s])skyramp(\s*[=<>~!;\[]|["',]|\s*$)/im.test(e))return;let t=/(?:^|["'\s])skyramp(?:\[[^\]]*\])?\s*(?:=\s*["']([^"']*)["']|((?:===?|[<>~!]=?)\s*[^"'\s,;#\]]+))?/im.exec(e);return(t?.[1]??t?.[2]??"").replace(/\s+/g,"")}}};function _Te(e,t){let r=FVr[Ho(e)??""];if(r)for(let n=va.dirname(e);;n=va.dirname(n)){let s=r.files.map(i=>va.join(n,i)).filter(kTe);if(s.length){for(let i of s){let o=r.spec(NTe(i)??"");if(o!==void 0)return{file:i,spec:o}}if(Ho(e)==="js")return}if(n===t||!n.startsWith(t)||va.dirname(n)===n)return}}function QVr(e,t){return _Te(e,t)!==void 0}var LVr=2,NTe=e=>{try{return Y8.readFileSync(e,"utf-8")}catch{return}},kTe=e=>{try{return Y8.statSync(e).isFile()}catch{return!1}};function UVr(e,t,r){let n=va.dirname(e),s=[];if(Ho(e)==="py"){for(let i of t.matchAll(OVr)){let o=i[1]??i[2];if(!o)continue;let a=/^\.*/.exec(o)[0].length,c=o.slice(a).split(".").filter(Boolean).join("/"),u=a?[va.resolve(n,...Array(a-1).fill(".."))]:[n,...r];for(let l of u){let d=[`${va.join(l,c)}.py`,va.join(l,c,"__init__.py")].find(kTe);d&&s.push(d)}}return s}for(let i of t.matchAll($Vr)){let o=i[1],a=o.startsWith(".")?[n]:r;for(let c of a){let u=va.resolve(c,o),l=MVr.map(d=>u+d).find(kTe);if(l){s.push(l);break}}if(!o.startsWith("."))try{s.push(require.resolve(o,{paths:[n]}))}catch{}}return s}function H_t(e,t,r=LVr,n=new Set){if(n.has(e))return!1;n.add(e);let s=NTe(e);return s===void 0?!1:NVr.test(s)?!0:r>0&&UVr(e,s,t).some(i=>!i.includes(`${va.sep}node_modules${va.sep}`)&&H_t(i,t,r-1,n))}function jVr(e,t,r){let n=Ho(e);return n!=="js"&&n!=="py"||BVr.test(t)?!1:PVr.test(t)||n==="js"&&I_(e,r)!==void 0}function V_t(e,t,r,n=[]){let s=[];for(let i of e.tests){if(i.kind!=="ui"||i.change!=="added"||!DVr(i.file))continue;let o=t(i.file),a=o&&NTe(o);if(!o||a===void 0)continue;let c=r(o);if(!jVr(o,a,c)||!n.some(p=>o.startsWith(p+va.sep))&&!QVr(o,c))continue;let l=I_(o,c),d=[...new Set([l?va.dirname(l):void 0,c].filter(p=>!!p))];H_t(o,d)||s.push(`${i.file}: a new browser test without the Skyramp page wrapper (newSkyrampPlaywrightPage), in it or in a fixture or page object it imports`)}return s}var W_t=H(require("fs")),J_t=H(require("path"));var Y_t="write-skyramp-sdk-pin";function qVr(e){let t=e.replace(/^(===?|=)/,"").trim();return/^\d+(\.\d+)*([-+.][\w.-]+)?$/.test(t)?t:void 0}function K_t(e,t,r,n){let s=new Map;for(let i of e.tests){if(i.change!=="added"&&i.change!=="updated")continue;let o=t(i.file);if(!o)continue;let a;try{a=W_t.readFileSync(o,"utf-8")}catch{continue}if(!iRe(a))continue;let c=n(o),u=c?_Te(o,r(o)):void 0;if(!c||!u||qVr(u.spec)===c||s.has(u.file))continue;let l=Ho(o)==="py"?"skyramp":oi,d=J_t.relative(r(o),u.file),p=Ho(o)==="py"?`==${c}`:c;s.set(u.file,`${d} declares ${l} ${u.spec||"with no version"}, but ${i.file} runs with ${c}: declare exactly ${p} there, as an application dependency change (its lockfile and dependenciesAdded entry included)`)}return[...s.values()]}var Uh=H(require("fs")),ps=H(require("path"));wr();function zVr(e,t,r){try{return yt([...Er,"grep","-q","-I","-w","-F","-f","-",t,"--"],{env:{...Le(),GIT_NO_LAZY_FETCH:"1"},cwd:e,input:`${r}
829
+ `).flatMap(r=>{try{let n=JSON.parse(r);return n&&typeof n=="object"?[n]:[]}catch{return[]}})}function J8(...e){let t=e.filter(n=>!!n);if(!t.length)return;let r=[...new Set(t.flatMap(n=>(n.NODE_PATH??"").split(Qs.delimiter)).filter(Boolean))].join(Qs.delimiter);return Object.assign({},...t,r?{NODE_PATH:r}:{})}var Y8=H(require("fs")),va=H(require("path"));var TTe="write-skyramp-page",NVr=/\bnewSkyrampPlaywrightPage\b|\bSkyrampPlaywrightPage\b|\bnew_skyramp_playwright_page\b/,PVr=/@playwright\/test|from\s+['"]playwright|@skyramp\/skyramp|\bpage\.(?:goto|locator|getBy\w+)\s*\(|playwright\.(?:sync|async)_api/,BVr=/@testing-library\/|from ["']enzyme["']|from ["']vitest["']|from ["']@jest\/globals["']/,$Vr=/(?:\bfrom|\bimport|\brequire\()\s*\(?\s*['"]([^'"]+)['"]/g,OVr=/^\s*(?:from\s+(\.*[\w.]*)\s+import|import\s+([\w.]+))/gm,DVr=e=>Yu.test(e)||/\.e2e\.[cm]?[jt]sx?$/.test(e),MVr=["",".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts","/index.ts","/index.js"],FVr={js:{files:["package.json"],spec:e=>{try{let t=JSON.parse(e),r=["dependencies","devDependencies","peerDependencies","optionalDependencies"].map(n=>t[n]?.["@skyramp/skyramp"]).find(n=>n!==void 0);return r===void 0?void 0:String(r).trim()}catch{return}}},py:{files:["requirements.txt","requirements-dev.txt","requirements-test.txt","pyproject.toml","setup.cfg","setup.py"],spec:e=>{if(!/(^|["'\s])skyramp(\s*[=<>~!;\[]|["',]|\s*$)/im.test(e))return;let t=/(?:^|["'\s])skyramp(?:\[[^\]]*\])?\s*(?:=\s*["']([^"']*)["']|((?:===?|[<>~!]=?)\s*[^"'\s,;#\]]+))?/im.exec(e);return(t?.[1]??t?.[2]??"").replace(/\s+/g,"")}}};function _Te(e,t){let r=FVr[Ho(e)??""];if(r)for(let n=va.dirname(e);;n=va.dirname(n)){let s=r.files.map(i=>va.join(n,i)).filter(kTe);if(s.length){for(let i of s){let o=r.spec(NTe(i)??"");if(o!==void 0)return{file:i,spec:o}}if(Ho(e)==="js")return}if(n===t||!n.startsWith(t)||va.dirname(n)===n)return}}function QVr(e,t){return _Te(e,t)!==void 0}var LVr=2,NTe=e=>{try{return Y8.readFileSync(e,"utf-8")}catch{return}},kTe=e=>{try{return Y8.statSync(e).isFile()}catch{return!1}};function UVr(e,t,r){let n=va.dirname(e),s=[];if(Ho(e)==="py"){for(let i of t.matchAll(OVr)){let o=i[1]??i[2];if(!o)continue;let a=/^\.*/.exec(o)[0].length,c=o.slice(a).split(".").filter(Boolean).join("/"),u=a?[va.resolve(n,...Array(a-1).fill(".."))]:[n,...r];for(let l of u){let d=[`${va.join(l,c)}.py`,va.join(l,c,"__init__.py")].find(kTe);d&&s.push(d)}}return s}for(let i of t.matchAll($Vr)){let o=i[1],a=o.startsWith(".")?[n]:r;for(let c of a){let u=va.resolve(c,o),l=MVr.map(d=>u+d).find(kTe);if(l){s.push(l);break}}if(!o.startsWith("."))try{s.push(require.resolve(o,{paths:[n]}))}catch{}}return s}function H_t(e,t,r=LVr,n=new Set){if(n.has(e))return!1;n.add(e);let s=NTe(e);return s===void 0?!1:NVr.test(s)?!0:r>0&&UVr(e,s,t).some(i=>!i.includes(`${va.sep}node_modules${va.sep}`)&&H_t(i,t,r-1,n))}function jVr(e,t,r){let n=Ho(e);return n!=="js"&&n!=="py"||BVr.test(t)?!1:PVr.test(t)||n==="js"&&I_(e,r)!==void 0}function V_t(e,t,r,n=[]){let s=[];for(let i of e.tests){if(i.kind!=="ui"||i.change!=="added"||!DVr(i.file))continue;let o=t(i.file),a=o&&NTe(o);if(!o||a===void 0)continue;let c=r(o);if(!jVr(o,a,c)||!n.some(p=>o.startsWith(p+va.sep))&&!QVr(o,c))continue;let l=I_(o,c),d=[...new Set([l?va.dirname(l):void 0,c].filter(p=>!!p))];H_t(o,d)||s.push(`${i.file}: a new browser test without the Skyramp page wrapper (newSkyrampPlaywrightPage), in it or in a fixture or page object it imports`)}return s}var W_t=H(require("fs")),J_t=H(require("path"));var Y_t="write-skyramp-sdk-pin";function qVr(e){let t=e.replace(/^(===?|=)/,"").trim();return/^\d+(\.\d+)*([-+.][\w.-]+)?$/.test(t)?t:void 0}function K_t(e,t,r,n){let s=new Map;for(let i of e.tests){if(i.change!=="added"&&i.change!=="updated")continue;let o=t(i.file);if(!o)continue;let a;try{a=W_t.readFileSync(o,"utf-8")}catch{continue}if(!iRe(a))continue;let c=n(o),u=c?_Te(o,r(o)):void 0;if(!c||!u||qVr(u.spec)===c||s.has(u.file))continue;let l=Ho(o)==="py"?"skyramp":oi,d=J_t.relative(r(o),u.file),p=Ho(o)==="py"?`==${c}`:c;s.set(u.file,`${d} declares ${l} ${u.spec||"with no version"}, but ${i.file} runs with ${c}: declare exactly ${p} there, as an application dependency change, with its lockfile and a dependenciesAdded entry whose manifest is ${d}`)}return[...s.values()]}var Uh=H(require("fs")),ps=H(require("path"));wr();function zVr(e,t,r){try{return yt([...Er,"grep","-q","-I","-w","-F","-f","-",t,"--"],{env:{...Le(),GIT_NO_LAZY_FETCH:"1"},cwd:e,input:`${r}
830
830
  `,encoding:"utf8",stdio:["pipe","ignore","ignore"]}),!0}catch(n){return n.status!==1&&Ut(`Credentials stay masked: git could not read ${t} in ${e}`),!1}}var Z_t=new Map;function GVr(e,t,r){let n=JSON.stringify([e,t,r]),s=Z_t.get(n);if(s!==void 0)return s;let i=Mm(e,t);i===void 0&&Ut(`Credentials stay masked: no base for ${e} (asked for ${t??"the default branch"})`);let o=i!==void 0&&zVr(e,i,r);return Z_t.set(n,o),o}function Op(e,t){let r=[{path:t.repositoryPath,base:t.baseBranch},...t.relatedRepos??[]];return e.filter(n=>{let s=n.trim();return!s||s.includes(`
831
831
  `)||!r.some(i=>GVr(i.path,i.base,s))})}var HVr=/(^|\/)(package-lock\.json|yarn\.lock|pnpm-lock\.yaml|poetry\.lock|Pipfile\.lock|Cargo\.lock|go\.sum|composer\.lock|Gemfile\.lock)$/;function X_t(e,t){if(!e||!t?.nonApplicationOnly)return[];if((t.nonApplicationFiles??[]).some(s=>HVr.test(s)))return[];if(e.decision==="existing_evidence_sufficient"||e.decision==="blocked_preflight")return[];let r=(t.nonApplicationFiles??[]).slice(0,5).join(", "),n=[];return n.push(`the change touches no application file (only docs, configuration or CI${r?`: ${r}`:""}), and the plan decided ${e.decision}: a change that touches no application file is existing_evidence_sufficient \u2014 the diff, and a check that its configuration parses, establish what those files say \u2014 and plans no new test, since a test that pins a file's contents checks nothing a user does`),n}async function eNt(e){let t=await oJe(e),r=pt(e.inputs).flatMap(i=>{try{return Sd(i.path).map(o=>({...o,repository:i.slug}))}catch{return[]}}),n=nn(e),s=n&&{files:Ku(n,Un(e.inputs).slug),unread:(n.relatedChanges??[]).filter(i=>i.note).map(i=>`${i.repository} (${i.note})`),count:o$(n,Un(e.inputs).slug)};return{ci:t,recipes:r,...s?{change:s}:{}}}var BTe=(e,t=" (none)")=>e.length?e.map(r=>` - ${r}`).join(`
832
832
  `):t,PTe=100;function tNt(e,t){if(!t)return[];let r=t.unread.length?[`Preflight could not read the change of ${t.unread.join(", ")}.`]:[],n=e.inputs.scheduledValidation,s=t.count,i=n?bJe(n,s,vv(e.inputs)):[];if(n)switch(zz(n,s)){case"first_qualification":case"unchanged":return[...i,...r];case"chosen_comparison":if(s===0)return i;break;case"delta":break}if(t.files.length===0&&r.length===0)return["Change under validation: none. Preflight found no changed file in any checkout, so every revision sits at its baseline. Say the run has no change to validate; never describe a revision's own commit (what git show or git log prints for it) as the change."];let o=t.files.length-PTe,a=yRe(t.files),c=u=>{let l=`${u.files} file${u.files===1?"":"s"}`;return u.deleted===u.files?`${l}, all deleted`:u.added===u.files?`${l}, all new`:[l,...u.added?[`${u.added} new`]:[],...u.deleted?[`${u.deleted} deleted`]:[]].join(", ")};return[...i,`Changed components, every one (the files below are the first ${PTe} only when there are more):`,BTe(a.map(u=>`${N_(u,l=>Qt(e.inputs,l))} \u2014 ${c(u)}`)," (none in the checkouts it could read)"),"Changed files, from preflight:",BTe(t.files.slice(0,PTe).map(u=>`${Qt(e.inputs,u.repository)}${u.path}`)," (none in the checkouts it could read)"),...o>0?[` \u2026 and ${o} more`]:[],...r]}function rNt(e,{ci:t,recipes:r}){let n=pt(e.inputs).length>1,s=BTe(r.map(a=>`${Qt(e.inputs,a.repository)}${a.runner} in ${a.workingDirectory} (${a.workflow} \u2192 ${a.job}): one file runs as \`${a.runOne}\``)," (no CI workflow runs tests)"),i=t.unavailable?.length&&t.note?`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyramp/testbot-core",
3
- "version": "0.13.1-v3.458",
3
+ "version": "0.13.1-v3.459",
4
4
  "description": "Skyramp Testbot engine: AI-powered deterministic test generation, execution and maintenance",
5
5
  "main": "dist/main.js",
6
6
  "//files": "An explicit allowlist, never a glob. `dist/` is gitignored, so without this key npm's .gitignore fallback would publish a package with no engine in it; with a glob it would publish the sourcemaps, whose sourcesContent embeds every src/*.ts verbatim. dist/VERSION.json exists only in a release-engine.yml build.",