@yasserkhanorg/e2e-agents 0.5.0 → 0.5.2
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/agent/pipeline.d.ts.map +1 -1
- package/dist/agent/pipeline.js +9 -0
- package/dist/agent/plan.d.ts.map +1 -1
- package/dist/agent/plan.js +12 -78
- package/dist/agent/runner.js +2 -2
- package/dist/esm/agent/pipeline.js +9 -0
- package/dist/esm/agent/plan.js +12 -78
- package/dist/esm/agent/runner.js +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/agent/pipeline.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAG9C,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,QAAQ,GAAG,aAAa,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;IAC7H,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE,mBAAmB,GAAG,cAAc,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAC5E,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,GAAG,CAAC,EAAE;QACF,SAAS,EAAE,OAAO,CAAC;QACnB,MAAM,EA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WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAgiCD,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,cAAc,EAAE,EACzB,QAAQ,EAAE,cAAc,GACzB,eAAe,CA4FjB;AAifD,wBAAgB,qBAAqB,CACjC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EAAE,EACnB,QAAQ,EAAE,cAAc,GACzB,eAAe,CAmLjB"}
|
package/dist/agent/pipeline.js
CHANGED
|
@@ -614,11 +614,20 @@ function summarizeCommandOutput(stdout, stderr) {
|
|
|
614
614
|
return lines.join('\n').slice(0, 2000);
|
|
615
615
|
}
|
|
616
616
|
function runCommand(command, args, cwd, timeoutMs = 60 * 60 * 1000) {
|
|
617
|
+
// When spawning `claude`, unset CLAUDECODE so nested invocations are allowed.
|
|
618
|
+
// Claude Code sets this variable to block nested sessions; child processes
|
|
619
|
+
// that spawn their own claude instance must run without it.
|
|
620
|
+
let env;
|
|
621
|
+
if (command === 'claude') {
|
|
622
|
+
const { CLAUDECODE: _, ...rest } = process.env;
|
|
623
|
+
env = rest;
|
|
624
|
+
}
|
|
617
625
|
const result = (0, child_process_1.spawnSync)(command, args, {
|
|
618
626
|
cwd,
|
|
619
627
|
encoding: 'utf-8',
|
|
620
628
|
timeout: timeoutMs,
|
|
621
629
|
stdio: 'pipe',
|
|
630
|
+
...(env ? { env } : {}),
|
|
622
631
|
});
|
|
623
632
|
return {
|
|
624
633
|
status: result.status ?? 1,
|
package/dist/agent/plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/agent/plan.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,KA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Aa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAC5C,uBAAuB,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;CACxB;AAqBD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,CAkE9G;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,SAAiC,GAAG,MAAM,CAMvH"}
|
package/dist/agent/plan.js
CHANGED
|
@@ -311,91 +311,25 @@ function writePlanReport(appRoot, plan) {
|
|
|
311
311
|
}
|
|
312
312
|
function renderCiSummaryMarkdown(plan) {
|
|
313
313
|
const lines = [];
|
|
314
|
-
|
|
314
|
+
const { p0Flows, p1Flows, uncoveredP0P1Flows, changedFiles, impactedFlows } = plan.metrics;
|
|
315
|
+
const mustAddTests = plan.decision.action === 'must-add-tests';
|
|
316
|
+
const statusEmoji = mustAddTests ? '🔴' : plan.decision.action === 'safe-to-merge' ? '🟢' : '🟡';
|
|
317
|
+
lines.push(`## ${statusEmoji} E2E Coverage: ${plan.decision.title}`);
|
|
315
318
|
lines.push('');
|
|
316
|
-
lines.push(
|
|
317
|
-
lines.push(
|
|
318
|
-
lines.push(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
lines.push(`- Enforcement detail: ${plan.enforcement.summary}`);
|
|
322
|
-
if (plan.policy.triggeredRules.length > 0) {
|
|
323
|
-
lines.push(`- Policy triggers: ${plan.policy.triggeredRules.join(', ')}`);
|
|
324
|
-
}
|
|
325
|
-
if (plan.policy.riskyFiles.length > 0) {
|
|
326
|
-
lines.push(`- Risky files: ${plan.policy.riskyFiles.join(', ')}`);
|
|
327
|
-
}
|
|
328
|
-
if (plan.recommendedTests.length > 0) {
|
|
319
|
+
lines.push(`${plan.decision.summary}`);
|
|
320
|
+
lines.push('');
|
|
321
|
+
lines.push(`**${changedFiles}** files changed → **${impactedFlows}** flows impacted` +
|
|
322
|
+
(p0Flows > 0 || p1Flows > 0 ? ` (P0: ${p0Flows}, P1: ${p1Flows})` : ''));
|
|
323
|
+
if (mustAddTests && plan.requiredNewTests.length > 0) {
|
|
329
324
|
lines.push('');
|
|
330
|
-
lines.push('###
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
if (plan.requiredNewTests.length > 0) {
|
|
325
|
+
lines.push('### ⚠️ Add E2E tests for these uncovered P0/P1 flows');
|
|
326
|
+
lines.push('');
|
|
327
|
+
lines.push(`The following ${uncoveredP0P1Flows} flow(s) have no test coverage and must be covered before merge:`);
|
|
336
328
|
lines.push('');
|
|
337
|
-
lines.push('### Required New Tests');
|
|
338
329
|
for (const gap of plan.requiredNewTests) {
|
|
339
330
|
lines.push(`- ${gap}`);
|
|
340
331
|
}
|
|
341
332
|
}
|
|
342
|
-
if (plan.nextActions) {
|
|
343
|
-
lines.push('');
|
|
344
|
-
lines.push('### PR Actions');
|
|
345
|
-
if (plan.nextActions.runRecommendedTests) {
|
|
346
|
-
lines.push(`- Run recommended tests: \`${plan.nextActions.runRecommendedTests}\``);
|
|
347
|
-
}
|
|
348
|
-
else if (plan.nextActions.runSmokeSuite) {
|
|
349
|
-
lines.push(`- Run smoke fallback: \`${plan.nextActions.runSmokeSuite}\``);
|
|
350
|
-
}
|
|
351
|
-
if (plan.nextActions.approveAndGenerate || plan.nextActions.generateMissingTests) {
|
|
352
|
-
lines.push(`- Approve and generate missing tests: \`${plan.nextActions.approveAndGenerate || plan.nextActions.generateMissingTests}\``);
|
|
353
|
-
}
|
|
354
|
-
if (plan.nextActions.healGeneratedTests) {
|
|
355
|
-
lines.push(`- Heal generated tests: \`${plan.nextActions.healGeneratedTests}\``);
|
|
356
|
-
}
|
|
357
|
-
if (plan.nextActions.commitGeneratedTests) {
|
|
358
|
-
lines.push(`- Commit generated artifacts: \`${plan.nextActions.commitGeneratedTests}\``);
|
|
359
|
-
}
|
|
360
|
-
if (plan.nextActions.openPullRequest) {
|
|
361
|
-
lines.push(`- Open PR with generated updates: \`${plan.nextActions.openPullRequest}\``);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
if (plan.insights?.qualityGates) {
|
|
365
|
-
if (plan.insights.qualityGates.failed.length > 0) {
|
|
366
|
-
lines.push('');
|
|
367
|
-
lines.push('### Quality Gates Failed');
|
|
368
|
-
for (const gate of plan.insights.qualityGates.failed) {
|
|
369
|
-
lines.push(`- ${gate.name}${gate.details ? `: ${gate.details}` : ''}`);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
if (plan.insights.qualityGates.warnings.length > 0) {
|
|
373
|
-
lines.push('');
|
|
374
|
-
lines.push('### Quality Gate Warnings');
|
|
375
|
-
for (const gate of plan.insights.qualityGates.warnings) {
|
|
376
|
-
lines.push(`- ${gate.name}${gate.details ? `: ${gate.details}` : ''}`);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
if (plan.insights?.flaky && plan.insights.flaky.highRiskRecommendedTests.length > 0) {
|
|
381
|
-
lines.push('');
|
|
382
|
-
lines.push('### Flaky Risk Alerts');
|
|
383
|
-
for (const item of plan.insights.flaky.highRiskRecommendedTests) {
|
|
384
|
-
const rate = item.flakeRate30d !== undefined ? item.flakeRate30d : item.flakeRate;
|
|
385
|
-
const trend = item.trend ? `, trend=${item.trend}` : '';
|
|
386
|
-
const subsystem = item.subsystem ? `, subsystem=${item.subsystem}` : '';
|
|
387
|
-
const qstate = item.quarantineState && item.quarantineState !== 'none' ? `, quarantine=${item.quarantineState}` : '';
|
|
388
|
-
lines.push(`- ${item.test} (flakeRate=${rate}${trend}${subsystem}${qstate})`);
|
|
389
|
-
}
|
|
390
|
-
if (plan.insights.flaky.ownerMentions && plan.insights.flaky.ownerMentions.length > 0) {
|
|
391
|
-
lines.push(`- Notify owners: ${plan.insights.flaky.ownerMentions.join(', ')}`);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
if (plan.insights?.calibration) {
|
|
395
|
-
lines.push('');
|
|
396
|
-
lines.push('### Historical Calibration');
|
|
397
|
-
lines.push(`- precision=${plan.insights.calibration.precision}, recall=${plan.insights.calibration.recall}, falseNegativeRate=${plan.insights.calibration.falseNegativeRate}`);
|
|
398
|
-
}
|
|
399
333
|
return lines.join('\n');
|
|
400
334
|
}
|
|
401
335
|
const PLAN_METRICS_EVENTS_PATH = '.e2e-ai-agents/metrics.jsonl';
|
package/dist/agent/runner.js
CHANGED
|
@@ -181,8 +181,8 @@ function applyMattermostEvidencePolicy(config, state) {
|
|
|
181
181
|
testMappingSource: state.testMappingSource,
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
if (state.testMappingSource !== 'catalog' && !state.traceabilityStats?.manifestFound) {
|
|
185
|
-
throw new Error('Mattermost profile requires traceability evidence. Generate or refresh traceability manifest
|
|
184
|
+
if (state.testMappingSource !== 'catalog' && state.testMappingSource !== 'ai' && !state.traceabilityStats?.manifestFound) {
|
|
185
|
+
throw new Error('Mattermost profile requires traceability evidence or AI mapping. Generate or refresh traceability manifest, or enable impact.aiMapping in config.');
|
|
186
186
|
}
|
|
187
187
|
const traceabilityCoverageRatio = state.traceabilityStats?.coverageRatio ?? 0;
|
|
188
188
|
if (state.testMappingSource === 'traceability' && traceabilityCoverageRatio < 0.6) {
|
|
@@ -610,11 +610,20 @@ function summarizeCommandOutput(stdout, stderr) {
|
|
|
610
610
|
return lines.join('\n').slice(0, 2000);
|
|
611
611
|
}
|
|
612
612
|
function runCommand(command, args, cwd, timeoutMs = 60 * 60 * 1000) {
|
|
613
|
+
// When spawning `claude`, unset CLAUDECODE so nested invocations are allowed.
|
|
614
|
+
// Claude Code sets this variable to block nested sessions; child processes
|
|
615
|
+
// that spawn their own claude instance must run without it.
|
|
616
|
+
let env;
|
|
617
|
+
if (command === 'claude') {
|
|
618
|
+
const { CLAUDECODE: _, ...rest } = process.env;
|
|
619
|
+
env = rest;
|
|
620
|
+
}
|
|
613
621
|
const result = spawnSync(command, args, {
|
|
614
622
|
cwd,
|
|
615
623
|
encoding: 'utf-8',
|
|
616
624
|
timeout: timeoutMs,
|
|
617
625
|
stdio: 'pipe',
|
|
626
|
+
...(env ? { env } : {}),
|
|
618
627
|
});
|
|
619
628
|
return {
|
|
620
629
|
status: result.status ?? 1,
|
package/dist/esm/agent/plan.js
CHANGED
|
@@ -302,91 +302,25 @@ export function writePlanReport(appRoot, plan) {
|
|
|
302
302
|
}
|
|
303
303
|
export function renderCiSummaryMarkdown(plan) {
|
|
304
304
|
const lines = [];
|
|
305
|
-
|
|
305
|
+
const { p0Flows, p1Flows, uncoveredP0P1Flows, changedFiles, impactedFlows } = plan.metrics;
|
|
306
|
+
const mustAddTests = plan.decision.action === 'must-add-tests';
|
|
307
|
+
const statusEmoji = mustAddTests ? '🔴' : plan.decision.action === 'safe-to-merge' ? '🟢' : '🟡';
|
|
308
|
+
lines.push(`## ${statusEmoji} E2E Coverage: ${plan.decision.title}`);
|
|
306
309
|
lines.push('');
|
|
307
|
-
lines.push(
|
|
308
|
-
lines.push(
|
|
309
|
-
lines.push(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
lines.push(`- Enforcement detail: ${plan.enforcement.summary}`);
|
|
313
|
-
if (plan.policy.triggeredRules.length > 0) {
|
|
314
|
-
lines.push(`- Policy triggers: ${plan.policy.triggeredRules.join(', ')}`);
|
|
315
|
-
}
|
|
316
|
-
if (plan.policy.riskyFiles.length > 0) {
|
|
317
|
-
lines.push(`- Risky files: ${plan.policy.riskyFiles.join(', ')}`);
|
|
318
|
-
}
|
|
319
|
-
if (plan.recommendedTests.length > 0) {
|
|
310
|
+
lines.push(`${plan.decision.summary}`);
|
|
311
|
+
lines.push('');
|
|
312
|
+
lines.push(`**${changedFiles}** files changed → **${impactedFlows}** flows impacted` +
|
|
313
|
+
(p0Flows > 0 || p1Flows > 0 ? ` (P0: ${p0Flows}, P1: ${p1Flows})` : ''));
|
|
314
|
+
if (mustAddTests && plan.requiredNewTests.length > 0) {
|
|
320
315
|
lines.push('');
|
|
321
|
-
lines.push('###
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
if (plan.requiredNewTests.length > 0) {
|
|
316
|
+
lines.push('### ⚠️ Add E2E tests for these uncovered P0/P1 flows');
|
|
317
|
+
lines.push('');
|
|
318
|
+
lines.push(`The following ${uncoveredP0P1Flows} flow(s) have no test coverage and must be covered before merge:`);
|
|
327
319
|
lines.push('');
|
|
328
|
-
lines.push('### Required New Tests');
|
|
329
320
|
for (const gap of plan.requiredNewTests) {
|
|
330
321
|
lines.push(`- ${gap}`);
|
|
331
322
|
}
|
|
332
323
|
}
|
|
333
|
-
if (plan.nextActions) {
|
|
334
|
-
lines.push('');
|
|
335
|
-
lines.push('### PR Actions');
|
|
336
|
-
if (plan.nextActions.runRecommendedTests) {
|
|
337
|
-
lines.push(`- Run recommended tests: \`${plan.nextActions.runRecommendedTests}\``);
|
|
338
|
-
}
|
|
339
|
-
else if (plan.nextActions.runSmokeSuite) {
|
|
340
|
-
lines.push(`- Run smoke fallback: \`${plan.nextActions.runSmokeSuite}\``);
|
|
341
|
-
}
|
|
342
|
-
if (plan.nextActions.approveAndGenerate || plan.nextActions.generateMissingTests) {
|
|
343
|
-
lines.push(`- Approve and generate missing tests: \`${plan.nextActions.approveAndGenerate || plan.nextActions.generateMissingTests}\``);
|
|
344
|
-
}
|
|
345
|
-
if (plan.nextActions.healGeneratedTests) {
|
|
346
|
-
lines.push(`- Heal generated tests: \`${plan.nextActions.healGeneratedTests}\``);
|
|
347
|
-
}
|
|
348
|
-
if (plan.nextActions.commitGeneratedTests) {
|
|
349
|
-
lines.push(`- Commit generated artifacts: \`${plan.nextActions.commitGeneratedTests}\``);
|
|
350
|
-
}
|
|
351
|
-
if (plan.nextActions.openPullRequest) {
|
|
352
|
-
lines.push(`- Open PR with generated updates: \`${plan.nextActions.openPullRequest}\``);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
if (plan.insights?.qualityGates) {
|
|
356
|
-
if (plan.insights.qualityGates.failed.length > 0) {
|
|
357
|
-
lines.push('');
|
|
358
|
-
lines.push('### Quality Gates Failed');
|
|
359
|
-
for (const gate of plan.insights.qualityGates.failed) {
|
|
360
|
-
lines.push(`- ${gate.name}${gate.details ? `: ${gate.details}` : ''}`);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
if (plan.insights.qualityGates.warnings.length > 0) {
|
|
364
|
-
lines.push('');
|
|
365
|
-
lines.push('### Quality Gate Warnings');
|
|
366
|
-
for (const gate of plan.insights.qualityGates.warnings) {
|
|
367
|
-
lines.push(`- ${gate.name}${gate.details ? `: ${gate.details}` : ''}`);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
if (plan.insights?.flaky && plan.insights.flaky.highRiskRecommendedTests.length > 0) {
|
|
372
|
-
lines.push('');
|
|
373
|
-
lines.push('### Flaky Risk Alerts');
|
|
374
|
-
for (const item of plan.insights.flaky.highRiskRecommendedTests) {
|
|
375
|
-
const rate = item.flakeRate30d !== undefined ? item.flakeRate30d : item.flakeRate;
|
|
376
|
-
const trend = item.trend ? `, trend=${item.trend}` : '';
|
|
377
|
-
const subsystem = item.subsystem ? `, subsystem=${item.subsystem}` : '';
|
|
378
|
-
const qstate = item.quarantineState && item.quarantineState !== 'none' ? `, quarantine=${item.quarantineState}` : '';
|
|
379
|
-
lines.push(`- ${item.test} (flakeRate=${rate}${trend}${subsystem}${qstate})`);
|
|
380
|
-
}
|
|
381
|
-
if (plan.insights.flaky.ownerMentions && plan.insights.flaky.ownerMentions.length > 0) {
|
|
382
|
-
lines.push(`- Notify owners: ${plan.insights.flaky.ownerMentions.join(', ')}`);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
if (plan.insights?.calibration) {
|
|
386
|
-
lines.push('');
|
|
387
|
-
lines.push('### Historical Calibration');
|
|
388
|
-
lines.push(`- precision=${plan.insights.calibration.precision}, recall=${plan.insights.calibration.recall}, falseNegativeRate=${plan.insights.calibration.falseNegativeRate}`);
|
|
389
|
-
}
|
|
390
324
|
return lines.join('\n');
|
|
391
325
|
}
|
|
392
326
|
const PLAN_METRICS_EVENTS_PATH = '.e2e-ai-agents/metrics.jsonl';
|
package/dist/esm/agent/runner.js
CHANGED
|
@@ -177,8 +177,8 @@ function applyMattermostEvidencePolicy(config, state) {
|
|
|
177
177
|
testMappingSource: state.testMappingSource,
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
if (state.testMappingSource !== 'catalog' && !state.traceabilityStats?.manifestFound) {
|
|
181
|
-
throw new Error('Mattermost profile requires traceability evidence. Generate or refresh traceability manifest
|
|
180
|
+
if (state.testMappingSource !== 'catalog' && state.testMappingSource !== 'ai' && !state.traceabilityStats?.manifestFound) {
|
|
181
|
+
throw new Error('Mattermost profile requires traceability evidence or AI mapping. Generate or refresh traceability manifest, or enable impact.aiMapping in config.');
|
|
182
182
|
}
|
|
183
183
|
const traceabilityCoverageRatio = state.traceabilityStats?.coverageRatio ?? 0;
|
|
184
184
|
if (state.testMappingSource === 'traceability' && traceabilityCoverageRatio < 0.6) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yasserkhanorg/e2e-agents",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Pluggable LLM provider library for AI-powered test automation. Use Claude, Ollama, or your own LLM. Integrate with Playwright, Jest, or any test framework. MCP server for test agents, cost tracking, and hybrid provider mode.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|