zeitzeuge 0.6.3-beta.2 → 0.6.3
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/analysis/agent.d.ts.map +1 -1
- package/dist/cli.js +3 -11
- package/dist/vitest/index.js +4 -14
- package/dist/vitest/reporter.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/analysis/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAM/B,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/analysis/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAM/B,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAwC/D,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AA6DD;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,GAAG,EACZ,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CAwBpB;AAED,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAkDD;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,GAAG,EACZ,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,OAAO,EAAE,CAAC,CAwBpB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD"}
|
package/dist/cli.js
CHANGED
|
@@ -782,7 +782,7 @@ function parseSnapshot(rawSnapshot) {
|
|
|
782
782
|
import {
|
|
783
783
|
createDeepAgent
|
|
784
784
|
} from "deepagents";
|
|
785
|
-
import {
|
|
785
|
+
import { toolStrategy } from "langchain";
|
|
786
786
|
|
|
787
787
|
// src/analysis/prompts.ts
|
|
788
788
|
var SYSTEM_PROMPT = `You are an expert web performance engineer. You have access to a virtual filesystem workspace containing captured data from a real page load: heap snapshot, network trace, and Chrome runtime trace.
|
|
@@ -1271,27 +1271,19 @@ function extractTodosFromStreamChunk(chunk) {
|
|
|
1271
1271
|
// src/analysis/agent.ts
|
|
1272
1272
|
async function invokeWithTodoStreaming(agent, userMessage, spinner) {
|
|
1273
1273
|
const renderer = new TodoProgressRenderer(spinner);
|
|
1274
|
-
console.log("USER MESSAGE", userMessage);
|
|
1275
1274
|
const stream = await agent.stream({ messages: [{ role: "user", content: userMessage }] }, { streamMode: ["updates", "values"] });
|
|
1276
1275
|
let lastValues;
|
|
1277
|
-
console.log("STREAM", stream);
|
|
1278
1276
|
for await (const item of stream) {
|
|
1279
|
-
console.log("ITEM", item);
|
|
1280
1277
|
if (Array.isArray(item) && item.length === 2) {
|
|
1281
1278
|
const mode = item[0];
|
|
1282
1279
|
const chunk = item[1];
|
|
1283
|
-
console.log("CHUNK", chunk);
|
|
1284
1280
|
renderer.handleChunk(chunk);
|
|
1285
|
-
console.log("DONE");
|
|
1286
1281
|
if (mode === "values")
|
|
1287
1282
|
lastValues = chunk;
|
|
1288
|
-
console.log("CONTINUE");
|
|
1289
1283
|
continue;
|
|
1290
1284
|
}
|
|
1291
|
-
console.log("ITEM", item);
|
|
1292
1285
|
renderer.handleChunk(item);
|
|
1293
1286
|
lastValues = item;
|
|
1294
|
-
console.log("LAST VALUES", lastValues);
|
|
1295
1287
|
}
|
|
1296
1288
|
return lastValues;
|
|
1297
1289
|
}
|
|
@@ -1328,7 +1320,7 @@ async function analyze(model, backend, spinner, context) {
|
|
|
1328
1320
|
model,
|
|
1329
1321
|
systemPrompt: SYSTEM_PROMPT,
|
|
1330
1322
|
backend,
|
|
1331
|
-
responseFormat:
|
|
1323
|
+
responseFormat: toolStrategy(FindingsSchema)
|
|
1332
1324
|
});
|
|
1333
1325
|
const userMessage = context ? buildPageLoadUserMessage(context) : [
|
|
1334
1326
|
"Analyze the frontend performance data in this workspace.",
|
|
@@ -1375,7 +1367,7 @@ async function analyzeTestPerformance(model, backend, spinner, context) {
|
|
|
1375
1367
|
model,
|
|
1376
1368
|
systemPrompt: VITEST_SYSTEM_PROMPT,
|
|
1377
1369
|
backend,
|
|
1378
|
-
responseFormat:
|
|
1370
|
+
responseFormat: toolStrategy(FindingsSchema)
|
|
1379
1371
|
});
|
|
1380
1372
|
const userMessage = context ? buildVitestUserMessage(context) : [
|
|
1381
1373
|
"Analyze the performance of the APPLICATION CODE being tested in this Vitest workspace.",
|
package/dist/vitest/index.js
CHANGED
|
@@ -1087,7 +1087,7 @@ function formatBytes(bytes) {
|
|
|
1087
1087
|
import {
|
|
1088
1088
|
createDeepAgent
|
|
1089
1089
|
} from "deepagents";
|
|
1090
|
-
import {
|
|
1090
|
+
import { toolStrategy } from "langchain";
|
|
1091
1091
|
|
|
1092
1092
|
// src/analysis/prompts.ts
|
|
1093
1093
|
var SYSTEM_PROMPT = `You are an expert web performance engineer. You have access to a virtual filesystem workspace containing captured data from a real page load: heap snapshot, network trace, and Chrome runtime trace.
|
|
@@ -1576,27 +1576,19 @@ function extractTodosFromStreamChunk(chunk) {
|
|
|
1576
1576
|
// src/analysis/agent.ts
|
|
1577
1577
|
async function invokeWithTodoStreaming(agent, userMessage, spinner) {
|
|
1578
1578
|
const renderer = new TodoProgressRenderer(spinner);
|
|
1579
|
-
console.log("USER MESSAGE", userMessage);
|
|
1580
1579
|
const stream = await agent.stream({ messages: [{ role: "user", content: userMessage }] }, { streamMode: ["updates", "values"] });
|
|
1581
1580
|
let lastValues;
|
|
1582
|
-
console.log("STREAM", stream);
|
|
1583
1581
|
for await (const item of stream) {
|
|
1584
|
-
console.log("ITEM", item);
|
|
1585
1582
|
if (Array.isArray(item) && item.length === 2) {
|
|
1586
1583
|
const mode = item[0];
|
|
1587
1584
|
const chunk = item[1];
|
|
1588
|
-
console.log("CHUNK", chunk);
|
|
1589
1585
|
renderer.handleChunk(chunk);
|
|
1590
|
-
console.log("DONE");
|
|
1591
1586
|
if (mode === "values")
|
|
1592
1587
|
lastValues = chunk;
|
|
1593
|
-
console.log("CONTINUE");
|
|
1594
1588
|
continue;
|
|
1595
1589
|
}
|
|
1596
|
-
console.log("ITEM", item);
|
|
1597
1590
|
renderer.handleChunk(item);
|
|
1598
1591
|
lastValues = item;
|
|
1599
|
-
console.log("LAST VALUES", lastValues);
|
|
1600
1592
|
}
|
|
1601
1593
|
return lastValues;
|
|
1602
1594
|
}
|
|
@@ -1633,7 +1625,7 @@ async function analyze(model, backend, spinner, context) {
|
|
|
1633
1625
|
model,
|
|
1634
1626
|
systemPrompt: SYSTEM_PROMPT,
|
|
1635
1627
|
backend,
|
|
1636
|
-
responseFormat:
|
|
1628
|
+
responseFormat: toolStrategy(FindingsSchema)
|
|
1637
1629
|
});
|
|
1638
1630
|
const userMessage = context ? buildPageLoadUserMessage(context) : [
|
|
1639
1631
|
"Analyze the frontend performance data in this workspace.",
|
|
@@ -1680,7 +1672,7 @@ async function analyzeTestPerformance(model, backend, spinner, context) {
|
|
|
1680
1672
|
model,
|
|
1681
1673
|
systemPrompt: VITEST_SYSTEM_PROMPT,
|
|
1682
1674
|
backend,
|
|
1683
|
-
responseFormat:
|
|
1675
|
+
responseFormat: toolStrategy(FindingsSchema)
|
|
1684
1676
|
});
|
|
1685
1677
|
const userMessage = context ? buildVitestUserMessage(context) : [
|
|
1686
1678
|
"Analyze the performance of the APPLICATION CODE being tested in this Vitest workspace.",
|
|
@@ -2227,7 +2219,7 @@ function relativize(filePath, projectRoot) {
|
|
|
2227
2219
|
// package.json
|
|
2228
2220
|
var package_default = {
|
|
2229
2221
|
name: "zeitzeuge",
|
|
2230
|
-
version: "0.6.3-beta.
|
|
2222
|
+
version: "0.6.3-beta.3",
|
|
2231
2223
|
description: "A deepagent to witnessing slowdowns in your test runs.",
|
|
2232
2224
|
keywords: [
|
|
2233
2225
|
"analysis",
|
|
@@ -2458,12 +2450,10 @@ zeitzeuge: Performance Metrics
|
|
|
2458
2450
|
});
|
|
2459
2451
|
wsSpinner?.succeed("zeitzeuge: Workspace ready");
|
|
2460
2452
|
if (this.options.analyzeOnFinish) {
|
|
2461
|
-
console.log("GOOO!");
|
|
2462
2453
|
const agentSpinner = this.isCI ? null : createSafeSpinner({ text: "zeitzeuge: Analyzing test performance...", color: "cyan" });
|
|
2463
2454
|
const spinnerForAgent = agentSpinner ?? ora2({ text: "zeitzeuge: Analyzing test performance...", isEnabled: false }).start();
|
|
2464
2455
|
try {
|
|
2465
2456
|
const model = initModel();
|
|
2466
|
-
console.log("MODEL", model);
|
|
2467
2457
|
const findings = await analyzeTestPerformance(model, workspace.backend, spinnerForAgent, {
|
|
2468
2458
|
metrics,
|
|
2469
2459
|
hasHeapProfiles: heapProfiles.length > 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../src/vitest/reporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoED;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAkB;IAEjC,iEAAiE;IACjE,OAAO,CAAC,cAAc,CAAgB;IAEtC,uDAAuD;IACvD,OAAO,CAAC,IAAI,CAAoB;gBAEpB,OAAO,EAAE,eAAe;IAIpC,OAAO,CAAC,sBAAsB;IAU9B;;;OAGG;IACH,iBAAiB,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI;IAQxC;;OAEG;IACG,YAAY,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YA0BpD,WAAW;
|
|
1
|
+
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../src/vitest/reporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoED;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAkB;IAEjC,iEAAiE;IACjE,OAAO,CAAC,cAAc,CAAgB;IAEtC,uDAAuD;IACvD,OAAO,CAAC,IAAI,CAAoB;gBAEpB,OAAO,EAAE,eAAe;IAIpC,OAAO,CAAC,sBAAsB;IAU9B;;;OAGG;IACH,iBAAiB,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI;IAQxC;;OAEG;IACG,YAAY,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YA0BpD,WAAW;IA6IzB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAwCzB;;OAEG;IACH,OAAO,CAAC,aAAa;IAsBrB;;;;;;OAMG;IACH,OAAO,CAAC,uBAAuB;IAiH/B;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAgFnC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,uBAAuB;IAuE/B;;OAEG;IACH,OAAO,CAAC,eAAe;IAiBvB;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IAoC9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;OAEG;IACH,OAAO,CAAC,UAAU;CAGnB"}
|
package/package.json
CHANGED