@lisa.ai/agent 2.5.4 → 2.5.5

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var qe=Object.create;var de=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var Ze=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ve=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ze(e))!Ke.call(t,n)&&n!==s&&de(t,n,{get:()=>e[n],enumerable:!(o=We(e,n))||o.enumerable});return t};var L=(t,e,s)=>(s=t!=null?qe(Je(t)):{},Ve(e||!t||!t.__esModule?de(s,"default",{value:t,enumerable:!0}):s,t));var Ne=Ze((Ht,et)=>{et.exports={name:"@lisa.ai/agent",version:"2.5.4",description:"Lisa.ai Autonomous CI/CD Worker Agent",main:"dist/index.js",bin:{"lisa-agent":"dist/index.js"},files:["dist/"],scripts:{build:"tsup",typecheck:"tsc --noEmit",start:"node dist/index.js",dev:"ts-node src/index.ts",prepublishOnly:"npm run typecheck && npm run build"},keywords:["lisa","ci","cd","agent"],author:"Lisa.ai",license:"ISC",dependencies:{"@ai-sdk/anthropic":"^3.0.46","@ai-sdk/google":"^3.0.30","@ai-sdk/openai":"^3.0.30","@octokit/rest":"^22.0.1",ai:"^6.0.94",commander:"^11.1.0",dotenv:"^17.3.1","simple-git":"^3.31.1"},devDependencies:{"@types/jest":"^30.0.0","@types/node":"^20.0.0","ts-node":"^10.9.1",tsup:"^8.5.1",typescript:"^5.0.0"}}});var Ue=require("commander"),se=L(require("fs")),He=L(require("path")),Ge=L(require("readline"));var pe=L(require("dotenv"));pe.config({quiet:!0});async function z(t){let e=process.env.LISA_CONTROL_PLANE_URL||"http://localhost:3000";try{let s=`${e}/api/config/${t}`;console.log(`[Lisa.ai Agent] Fetching dynamic configuration from ${s}...`);let o=await fetch(s);if(!o.ok){let i=o.status===404?"not_found":"unreachable";return console.warn(i==="not_found"?`[Lisa.ai Agent Warning] Control Plane returned 404. Project '${t}' not found.`:`[Lisa.ai Agent Warning] Control Plane returned ${o.status}. Falling back to local defaults.`),{ok:!1,reason:i}}return{ok:!0,config:await o.json()}}catch{return console.warn(`[Lisa.ai Agent Warning] Failed to reach Control Plane (${e}). Using local fallback configuration.`),{ok:!1,reason:"unreachable"}}}var Re=require("child_process"),j=L(require("fs")),_=L(require("path"));var C=L(require("path")),b=L(require("fs"));function J(t,e=[],s=process.cwd()){let o=t.replace(/\x1B\[[0-9;]*[a-zA-Z]/g,""),n=e.map(a=>C.resolve(a)),i=/([a-zA-Z]:[a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue)|[a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue))(?:\s*[:(])/g,r;for(;(r=i.exec(o))!==null;){let a=r[1];if(a){if(/(?:^|[/\\])(node_modules|dist|build)[/\\]/.test(a))continue;let h=C.isAbsolute(a)?a:C.resolve(s,a);if(!n.includes(h)&&b.existsSync(h))return a}}let l=/FAIL\s+([a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue))/gi,d;for(;(d=l.exec(o))!==null;){let a=d[1],h=C.isAbsolute(a)?a:C.resolve(s,a);if(!n.includes(h)&&b.existsSync(h))return a}let g=/([a-zA-Z]:[a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue)|[a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue))/g,m;for(;(m=g.exec(o))!==null;){let a=m[1];if(a){if(/(?:^|[/\\])(node_modules|dist|build)[/\\]/.test(a))continue;let h=C.isAbsolute(a)?a:C.resolve(s,a);if(!n.includes(h)&&b.existsSync(h))return a}}let p=/\b([A-Z][a-zA-Z0-9]{3,})\b/g,c,f=new Set,u=["Error","TypeError","SyntaxError","ReferenceError","RangeError","NullInjectorError","Object","Boolean","String","Number","Array","Chrome","Windows","Linux","Macintosh","UserContext","TestBed","Module","Unexpected","Expected","ChromeHeadless","Users","AppData","Local","Temp","Process","Component","Validation","Directory","Configuration","Documentation"];for(;(c=p.exec(o))!==null;){let a=c[1];if(a&&!u.includes(a)&&!f.has(a)){f.add(a),console.log(`[Lisa.ai Parser] Discovered abstract symbol failure: ${a}. Scanning project tree...`);let h=ge(a,s,n);if(h)return C.relative(s,h)}}return null}function ge(t,e,s){if(!b.existsSync(e))return null;let o=b.readdirSync(e);for(let n of o){let i=C.join(e,n);if(n==="node_modules"||n==="dist"||n==="build"||n===".git"||n===".angular")continue;let r;try{r=b.statSync(i)}catch{continue}if(r.isDirectory()){let l=ge(t,i,s);if(l)return l}else if(n.match(/\.(ts|tsx|js|jsx|vue)$/)){let l=b.readFileSync(i,"utf8");if(l.includes(`class ${t}`)||l.includes(`function ${t}`)||l.includes(`const ${t}`)||l.includes(`let ${t}`)||l.includes(`exports.${t}`)||l.includes(`module.exports.${t}`)){let d=i,g=C.extname(i),m=i.slice(0,-g.length);if(!n.includes(".spec.")&&!n.includes(".test.")){let p=[`${m}.spec${g}`,`${m}.test${g}`,`${m}.spec.js`,`${m}.test.js`];for(let c of p)if(b.existsSync(c)){d=c;break}}if(!s.includes(C.resolve(d)))return d}}}return null}var Y=require("ai"),me=require("@ai-sdk/openai"),fe=require("@ai-sdk/anthropic"),he=require("@ai-sdk/google"),ye=L(require("dotenv"));ye.config({quiet:!0});var ie=15e3;function ve(t,e){return t.length<=ie?t:(console.warn(`[Lisa.ai LLM] ${e} is ${t.length} chars \u2014 truncating to ${ie} to stay within context window.`),t.slice(0,ie)+`
2
+ "use strict";var ze=Object.create;var de=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ze=Object.getPrototypeOf,Ve=Object.prototype.hasOwnProperty;var Xe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Qe=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ke(e))!Ve.call(t,n)&&n!==s&&de(t,n,{get:()=>e[n],enumerable:!(o=Je(e,n))||o.enumerable});return t};var L=(t,e,s)=>(s=t!=null?ze(Ze(t)):{},Qe(e||!t||!t.__esModule?de(s,"default",{value:t,enumerable:!0}):s,t));var Ne=Xe((Bt,st)=>{st.exports={name:"@lisa.ai/agent",version:"2.5.5",description:"Lisa.ai Autonomous CI/CD Worker Agent",main:"dist/index.js",bin:{"lisa-agent":"dist/index.js"},files:["dist/"],scripts:{build:"tsup",typecheck:"tsc --noEmit",start:"node dist/index.js",dev:"ts-node src/index.ts",prepublishOnly:"npm run typecheck && npm run build"},keywords:["lisa","ci","cd","agent"],author:"Lisa.ai",license:"ISC",dependencies:{"@ai-sdk/anthropic":"^3.0.46","@ai-sdk/google":"^3.0.30","@ai-sdk/openai":"^3.0.30","@octokit/rest":"^22.0.1",ai:"^6.0.94",commander:"^11.1.0",dotenv:"^17.3.1","simple-git":"^3.31.1"},devDependencies:{"@types/jest":"^30.0.0","@types/node":"^20.0.0","ts-node":"^10.9.1",tsup:"^8.5.1",typescript:"^5.0.0"}}});var Ue=require("commander"),se=L(require("fs")),He=L(require("path")),Ge=L(require("readline"));var pe=L(require("dotenv"));pe.config({quiet:!0});async function z(t){let e=process.env.LISA_CONTROL_PLANE_URL||"http://localhost:3000";try{let s=`${e}/api/config/${t}`;console.log(`[Lisa.ai Agent] Fetching dynamic configuration from ${s}...`);let o=await fetch(s);if(!o.ok){let i=o.status===404?"not_found":"unreachable";return console.warn(i==="not_found"?`[Lisa.ai Agent Warning] Control Plane returned 404. Project '${t}' not found.`:`[Lisa.ai Agent Warning] Control Plane returned ${o.status}. Falling back to local defaults.`),{ok:!1,reason:i}}return{ok:!0,config:await o.json()}}catch{return console.warn(`[Lisa.ai Agent Warning] Failed to reach Control Plane (${e}). Using local fallback configuration.`),{ok:!1,reason:"unreachable"}}}var Re=require("child_process"),j=L(require("fs")),_=L(require("path"));var C=L(require("path")),b=L(require("fs"));function J(t,e=[],s=process.cwd()){let o=t.replace(/\x1B\[[0-9;]*[a-zA-Z]/g,""),n=e.map(a=>C.resolve(a)),i=/([a-zA-Z]:[a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue)|[a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue))(?:\s*[:(])/g,r;for(;(r=i.exec(o))!==null;){let a=r[1];if(a){if(/(?:^|[/\\])(node_modules|dist|build)[/\\]/.test(a))continue;let h=C.isAbsolute(a)?a:C.resolve(s,a);if(!n.includes(h)&&b.existsSync(h))return a}}let l=/FAIL\s+([a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue))/gi,d;for(;(d=l.exec(o))!==null;){let a=d[1],h=C.isAbsolute(a)?a:C.resolve(s,a);if(!n.includes(h)&&b.existsSync(h))return a}let g=/([a-zA-Z]:[a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue)|[a-zA-Z0-9_.\-\/\\]+\.(?:ts|tsx|js|jsx|vue))/g,m;for(;(m=g.exec(o))!==null;){let a=m[1];if(a){if(/(?:^|[/\\])(node_modules|dist|build)[/\\]/.test(a))continue;let h=C.isAbsolute(a)?a:C.resolve(s,a);if(!n.includes(h)&&b.existsSync(h))return a}}let p=/\b([A-Z][a-zA-Z0-9]{3,})\b/g,c,f=new Set,u=["Error","TypeError","SyntaxError","ReferenceError","RangeError","NullInjectorError","Object","Boolean","String","Number","Array","Chrome","Windows","Linux","Macintosh","UserContext","TestBed","Module","Unexpected","Expected","ChromeHeadless","Users","AppData","Local","Temp","Process","Component","Validation","Directory","Configuration","Documentation"];for(;(c=p.exec(o))!==null;){let a=c[1];if(a&&!u.includes(a)&&!f.has(a)){f.add(a),console.log(`[Lisa.ai Parser] Discovered abstract symbol failure: ${a}. Scanning project tree...`);let h=ge(a,s,n);if(h)return C.relative(s,h)}}return null}function ge(t,e,s){if(!b.existsSync(e))return null;let o=b.readdirSync(e);for(let n of o){let i=C.join(e,n);if(n==="node_modules"||n==="dist"||n==="build"||n===".git"||n===".angular")continue;let r;try{r=b.statSync(i)}catch{continue}if(r.isDirectory()){let l=ge(t,i,s);if(l)return l}else if(n.match(/\.(ts|tsx|js|jsx|vue)$/)){let l=b.readFileSync(i,"utf8");if(l.includes(`class ${t}`)||l.includes(`function ${t}`)||l.includes(`const ${t}`)||l.includes(`let ${t}`)||l.includes(`exports.${t}`)||l.includes(`module.exports.${t}`)){let d=i,g=C.extname(i),m=i.slice(0,-g.length);if(!n.includes(".spec.")&&!n.includes(".test.")){let p=[`${m}.spec${g}`,`${m}.test${g}`,`${m}.spec.js`,`${m}.test.js`];for(let c of p)if(b.existsSync(c)){d=c;break}}if(!s.includes(C.resolve(d)))return d}}}return null}var Y=require("ai"),me=require("@ai-sdk/openai"),fe=require("@ai-sdk/anthropic"),he=require("@ai-sdk/google"),ye=L(require("dotenv"));ye.config({quiet:!0});var ie=15e3;function ve(t,e){return t.length<=ie?t:(console.warn(`[Lisa.ai LLM] ${e} is ${t.length} chars \u2014 truncating to ${ie} to stay within context window.`),t.slice(0,ie)+`
3
3
 
4
4
  // ... (truncated)`)}function Le(t,e){if(!/\b(describe|it\(|test\(|expect\(|beforeEach|afterEach|suite|assert\.|cy\.)\b/.test(t))throw new Error(`LLM returned a non-code response for ${e} (possible context overflow). Skipping to prevent file corruption.`)}function we(t){if(!t||t.length===0)return"";let e={unit:"unit tests \u2014 test every function/method in complete isolation, mocking ALL external dependencies, services, and I/O",integration:"integration tests \u2014 test how modules work together using real service/repository layers; for HTTP routes use supertest or equivalent",e2e:"end-to-end tests \u2014 simulate complete user flows using the configured e2e framework (Playwright/Cypress); cover the full path from HTTP request to response or UI action to assertion"};return`5. Test scope \u2014 generate ALL of the following test types for this file:
5
5
  ${t.map(o=>` \u2022 ${e[o]??o}`).join(`
@@ -62,7 +62,7 @@ A source file lacks 100% test coverage. You must update its existing test suite
62
62
 
63
63
  --- Existing Test Suite (`+s+`) ---
64
64
  `+o+"\n\n--- Constraints ---\n1. Return the updated complete test code wrapped in a markdown code block (```typescript ... ```).\n2. Do not include any explanation or intro text.\n"+g+`4. Aim for 100% logic coverage across branches, lines, and functions.
65
- `+m,{text:c}=await(0,Y.generateText)({model:d,prompt:p}),f=c.match(/```(?:typescript|ts|javascript|js)?\n([\s\S]*?)```/),u=f?f[1].trim():c.trim();return Le(u,t),u}async function Z(t,e,s){let o=K(e,s),{text:n}=await(0,Y.generateText)({model:o,prompt:t}),i=n.match(/```(?:typescript|ts|javascript|js)?\n([\s\S]*?)```/);return i?i[1].trim():n.trim()}var $e=L(require("simple-git")),Ae=require("@octokit/rest"),ct=require("dotenv/config");async function je(t){console.log(`
65
+ `+m,{text:c}=await(0,Y.generateText)({model:d,prompt:p}),f=c.match(/```(?:typescript|ts|javascript|js)?\n([\s\S]*?)```/),u=f?f[1].trim():c.trim();return Le(u,t),u}async function Z(t,e,s){let o=K(e,s),{text:n}=await(0,Y.generateText)({model:o,prompt:t}),i=n.match(/```(?:typescript|ts|javascript|js)?\n([\s\S]*?)```/);return i?i[1].trim():n.trim()}var $e=L(require("simple-git")),Ae=require("@octokit/rest"),ut=require("dotenv/config");async function je(t){console.log(`
66
66
  [Lisa.ai PR Engine] Initializing Pull Request for ${t}...`);let e=(0,$e.default)(),o=`lisa-fix/build-error-${new Date().getTime()}`,n=`fix: automated auto-heal by Lisa.ai for ${t}`,i="main";try{i=(await e.revparse(["--abbrev-ref","HEAD"])).trim()}catch{}try{await e.addConfig("user.name","Lisa.ai"),await e.addConfig("user.email","lisa@lisa.ai"),await e.checkoutLocalBranch(o),await e.add(t),await e.commit(n),console.log(`[Lisa.ai PR Engine] Committed changes to branch ${o}`),console.log("[Lisa.ai PR Engine] Pushing branch to remote origin..."),await e.push("origin",o,{"--set-upstream":null});let r=new Ae.Octokit({auth:process.env.GITHUB_TOKEN}),l=process.env.GITHUB_REPOSITORY;if(l&&process.env.GITHUB_TOKEN){let[d,g]=l.split("/");console.log(`[Lisa.ai PR Engine] Opening Pull Request against ${d}/${g}...`);let m=await r.rest.pulls.create({owner:d,repo:g,title:n,body:`### Lisa.ai Auto-Healed Pull Request
67
67
  This PR was automatically generated by Lisa.ai to resolve a failing compilation/build step.
68
68
 
@@ -81,7 +81,7 @@ Requirements:
81
81
  2. Ensure standard transpilation (ts-jest for jest, or standard karma-webpack/karma-typescript implementations).
82
82
  3. Do NOT wrap your response in markdown formatting (no \`\`\`javascript).
83
83
  4. Return ONLY the raw code string block.`;try{let d=await Z(l,s,o),g="";e.testingFramework==="jest"&&(g="jest.config.js"),e.testingFramework==="karma"&&(g="karma.conf.js"),e.testingFramework==="vitest"&&(g="vitest.config.ts");let m=re.join(n,g);X.writeFileSync(m,d,"utf-8"),console.log(`\u2705 [Lisa.ai Auto-Generator] Natively wrote ${g} to repository root.`)}catch(d){console.error(`
84
- \u274C [Lisa.ai Auto-Generator] Failed to author configuration file: ${d.message}`),process.exit(1)}}};var Ee=L(require("dotenv"));Ee.config({quiet:!0});function Te(t){let e=t.toLowerCase();return e.includes("karma")||e.includes("ng test")?"karma":e.includes("jest")?"jest":e.includes("vitest")?"vitest":e.includes("playwright")?"playwright":e.includes("cypress")?"cypress":e.includes("mocha")?"mocha":"unknown"}async function Ie(t,e,s){if(s==="local")return[];let o=process.env.LISA_CONTROL_PLANE_URL||"http://localhost:3000";try{let n=new URLSearchParams({projectId:s,errorLog:t.slice(0,1e3),framework:e}),i=await fetch(`${o}/api/memory/lookup?${n}`);return i.ok?await i.json():[]}catch{return[]}}async function Fe(t,e,s,o){if(o==="local")return;let n=process.env.LISA_CONTROL_PLANE_URL||"http://localhost:3000";try{await fetch(`${n}/api/memory/record`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:o,errorLog:t.slice(0,1e3),fixHint:e.slice(0,2e3),framework:s})}),console.log("[Lisa.ai Memory] Fix pattern recorded to Control Plane.")}catch(i){console.debug(`[Lisa.ai Agent Debug] Failed to record memory pattern: ${i.message}`)}}var Q=3;function Xe(t){let e=t.replace(/\.(spec|test)\.(ts|js|jsx|tsx)$/,".$2");if(e!==t&&j.existsSync(e))try{return console.log(`[Lisa.ai Context Engine] \u{1F9E0} Located sibling logic structure at ${e}`),j.readFileSync(e,"utf-8")}catch{return}}function Qe(t,e){let s=t.toLowerCase(),o=_.parse(e);if(s.includes("ng test")||s.includes("karma"))return`${t} --include **/${o.base}`;if(s.includes("jest")||s.includes("vitest")||s.includes("playwright"))return`${t} ${e}`;if(s.includes("cypress"))return`${t} --spec ${e}`;if(s.includes("npm")||s.includes("yarn")||s.includes("pnpm")){try{let i=_.resolve(process.cwd(),"package.json");if(j.existsSync(i)){let r=JSON.parse(j.readFileSync(i,"utf8")),l="test";s.includes("npm run ")?l=s.split("npm run ")[1].split(" ")[0]:s.includes("yarn ")?l=s.split("yarn ")[1].split(" ")[0]:s.includes("pnpm ")&&(l=s.split("pnpm ")[1].split(" ")[0]);let d=r.scripts?.[l]?.toLowerCase()||"",g=s.includes("npm")?" --":"";if(d.includes("ng test")||d.includes("karma"))return`${t}${g} --include **/${o.base}`;if(d.includes("jest")||d.includes("vitest")||d.includes("playwright"))return`${t}${g} ${e}`}}catch{}let n=s.includes("npm")?" --":"";return`${t}${n} ${e}`}return t}async function G(t,e,s=1,o=null,n=3,i="local",r,l,d=[],g=0,m={}){if(!t){console.log(`
84
+ \u274C [Lisa.ai Auto-Generator] Failed to author configuration file: ${d.message}`),process.exit(1)}}};var Ee=L(require("dotenv"));Ee.config({quiet:!0});function Te(t){let e=t.toLowerCase();return e.includes("karma")||e.includes("ng test")?"karma":e.includes("jest")?"jest":e.includes("vitest")?"vitest":e.includes("playwright")?"playwright":e.includes("cypress")?"cypress":e.includes("mocha")?"mocha":"unknown"}async function Ie(t,e,s){if(s==="local")return[];let o=process.env.LISA_CONTROL_PLANE_URL||"http://localhost:3000";try{let n=new URLSearchParams({projectId:s,errorLog:t.slice(0,1e3),framework:e}),i=await fetch(`${o}/api/memory/lookup?${n}`);return i.ok?await i.json():[]}catch{return[]}}async function Fe(t,e,s,o){if(o==="local")return;let n=process.env.LISA_CONTROL_PLANE_URL||"http://localhost:3000";try{await fetch(`${n}/api/memory/record`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:o,errorLog:t.slice(0,1e3),fixHint:e.slice(0,2e3),framework:s})}),console.log("[Lisa.ai Memory] Fix pattern recorded to Control Plane.")}catch(i){console.debug(`[Lisa.ai Agent Debug] Failed to record memory pattern: ${i.message}`)}}var Q=3;function et(t){let e=t.replace(/\.(spec|test)\.(ts|js|jsx|tsx)$/,".$2");if(e!==t&&j.existsSync(e))try{return console.log(`[Lisa.ai Context Engine] \u{1F9E0} Located sibling logic structure at ${e}`),j.readFileSync(e,"utf-8")}catch{return}}function tt(t,e){let s=t.toLowerCase(),o=_.parse(e);if(s.includes("ng test")||s.includes("karma"))return`${t} --include **/${o.base}`;if(s.includes("jest")||s.includes("vitest")||s.includes("playwright"))return`${t} ${e}`;if(s.includes("cypress"))return`${t} --spec ${e}`;if(s.includes("npm")||s.includes("yarn")||s.includes("pnpm")){try{let i=_.resolve(process.cwd(),"package.json");if(j.existsSync(i)){let r=JSON.parse(j.readFileSync(i,"utf8")),l="test";s.includes("npm run ")?l=s.split("npm run ")[1].split(" ")[0]:s.includes("yarn ")?l=s.split("yarn ")[1].split(" ")[0]:s.includes("pnpm ")&&(l=s.split("pnpm ")[1].split(" ")[0]);let d=r.scripts?.[l]?.toLowerCase()||"",g=s.includes("npm")?" --":"";if(d.includes("ng test")||d.includes("karma"))return`${t}${g} --include **/${o.base}`;if(d.includes("jest")||d.includes("vitest")||d.includes("playwright"))return`${t}${g} ${e}`}}catch{}let n=s.includes("npm")?" --":"";return`${t}${n} ${e}`}return t}async function G(t,e,s=1,o=null,n=3,i="local",r,l,d=[],g=0,m={}){if(!t){console.log(`
85
85
  [Lisa.ai Auto-Discovery] No explicit --command provided. Initiating Autonomous Framework Fingerprinting...`);let c=O.scanRepository();c.testingFramework==="none"&&(c=await U.installMissingFramework(c),await H.provisionConfigurationFiles(c,e,l)),c.suggestedTestCommand?(t=c.suggestedTestCommand,console.log(`[Lisa.ai Auto-Discovery] Bootstrapping execution with natively discovered command: ${t}`)):(console.error(`
86
86
  \u{1F6A8} [Lisa.ai Fatal Error] Agent could not dynamically extrapolate a testing command for a Generic Node Environment. Please pass --command explicitly.`),process.exit(1))}console.log(`
87
87
  [Lisa.ai Executing] ${t} (Global Engine) Using Model: ${e}`);let p=(c,f=!1)=>new Promise((u,a)=>{let h=(0,Re.spawn)(c,{shell:!0,stdio:["ignore","pipe","pipe"]}),w="",v="";h.stdout?.on("data",y=>{let S=y.toString();w+=S}),h.stderr?.on("data",y=>{v+=y.toString()}),h.on("close",y=>{y===0?u({stdout:w,stderr:v}):a({message:`Process exited with code ${y}`,stdout:w,stderr:v})})});try{console.log("\u23F3 [Lisa.ai Testing] Booting Headless Test Suite in background..."),await p(t,!1),console.log(`
@@ -91,8 +91,9 @@ Requirements:
91
91
  `+(c.message||"");console.log(`
92
92
  [Lisa.ai Auto-Heal] Analyzing errors...`);let u=J(f,d,process.cwd());u||(console.error(`
93
93
  \u{1F6A8} [Lisa.ai Error] Could not parse a valid failing file path from the logs (or all were explicitly skipped).`),process.exit(1));let a=_.resolve(process.cwd(),u);j.existsSync(a)||(console.error(`
94
- \u{1F6A8} [Lisa.ai Error] Extracted file path does not exist: ${a}`),process.exit(1));let h=m[u]||0;if(h>=Q){console.warn(`
95
- [Lisa.ai Auto-Heal] \u26A0\uFE0F ${u} has failed globally ${h} time(s) \u2014 exceeds threshold of ${Q}. Permanently skipping.`),d.push(u),await G(t,e,1,null,n,i,void 0,l,d,0,m);return}console.log(`[Lisa.ai Auto-Heal] Identified bleeding file: ${u} (global fail count: ${h}/${Q})`);let w=1,v=!1,y=f,S,E="",x="",T=Qe(t,u),oe=Xe(a),W=Te(t),ne=(await Ie(f,W,i)).filter(I=>I.confidence>=.5).map(I=>I.fixHint);for(ne.length>0&&console.log(`[Lisa.ai Memory] Found ${ne.length} proven fix pattern(s) from Control Plane \u2014 injecting as LLM hint.`),await R({projectId:i,type:"heal",filePath:u,modelUsed:e,status:"running",details:"Agent is currently analyzing and applying patches..."});w<=n&&!v;){console.log(`
94
+ \u{1F6A8} [Lisa.ai Error] Extracted file path does not exist: ${a}`),process.exit(1)),/[\\/](node_modules|dist|build)[\\/]/.test(a)&&(console.error(`
95
+ \u{1F6A8} [Lisa.ai Error] Refusing to modify a library file outside the project source: ${a}`),process.exit(1));let h=m[u]||0;if(h>=Q){console.warn(`
96
+ [Lisa.ai Auto-Heal] \u26A0\uFE0F ${u} has failed globally ${h} time(s) \u2014 exceeds threshold of ${Q}. Permanently skipping.`),d.push(u),await G(t,e,1,null,n,i,void 0,l,d,0,m);return}console.log(`[Lisa.ai Auto-Heal] Identified bleeding file: ${u} (global fail count: ${h}/${Q})`);let w=1,v=!1,y=f,S,E="",x="",T=tt(t,u),oe=et(a),W=Te(t),ne=(await Ie(f,W,i)).filter(I=>I.confidence>=.5).map(I=>I.fixHint);for(ne.length>0&&console.log(`[Lisa.ai Memory] Found ${ne.length} proven fix pattern(s) from Control Plane \u2014 injecting as LLM hint.`),await R({projectId:i,type:"heal",filePath:u,modelUsed:e,status:"running",details:"Agent is currently analyzing and applying patches..."});w<=n&&!v;){console.log(`
96
97
  [Lisa.ai Micro-Heal] Isolating ${u} (Attempt ${w}/${n})`);let I=j.readFileSync(a,"utf-8"),N=await xe(u,I,y,e,l,S,oe,ne);j.writeFileSync(a,N,"utf-8"),console.log(`[Lisa.ai Micro-Heal] Applied isolated patch to ${u}`),E=`### Auto-Heal Analysis Triggered
97
98
  **Caught Error:**
98
99
  \`\`\`bash
@@ -104,7 +105,7 @@ ${y}
104
105
  ${N}
105
106
  \`\`\``;try{console.log(`[Lisa.ai Micro-Heal] Verifying fix with isolated command: ${T}`),await p(T,!1),console.log(`\u2705 [Lisa.ai Micro-Heal] Isolated verification passed for ${u}!`),v=!0,x=N}catch(F){console.log("\u274C [Lisa.ai Micro-Heal] Isolated verification failed.");let le=F.stdout?F.stdout.toString():"";y=(F.stderr?F.stderr.toString():"")+`
106
107
  `+le+`
107
- `+(F.message||"");let ue=(t||"").toLowerCase();if(ue.includes("ng test")||ue.includes("karma")){let Ye=_.basename(u);if(!y.includes(Ye+":")){console.log(`\u2705 [Lisa.ai Micro-Heal] Fix verified for ${u} \u2014 isolated error is from other spec files, not this one.`),v=!0,x=N;continue}}S=`### Attempt ${w} Failed
108
+ `+(F.message||"");let ue=(t||"").toLowerCase();if(ue.includes("ng test")||ue.includes("karma")){let Ye=_.basename(u),qe=y.includes(Ye+":"),We=/ FAILED/.test(y);if(!qe&&!We){console.log(`\u2705 [Lisa.ai Micro-Heal] Fix verified for ${u} \u2014 isolated error is from other spec files, not this one.`),v=!0,x=N;continue}}S=`### Attempt ${w} Failed
108
109
  \`\`\`typescript
109
110
  ${N}
110
111
  \`\`\`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lisa.ai/agent",
3
- "version": "2.5.4",
3
+ "version": "2.5.5",
4
4
  "description": "Lisa.ai Autonomous CI/CD Worker Agent",
5
5
  "main": "dist/index.js",
6
6
  "bin": {