@thecolonylab/hivemind 0.2.0 → 0.2.1
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/commands/run.js +1 -0
- package/dist/commands/runLocal.js +1 -0
- package/dist/report/html.js +19 -0
- package/package.json +1 -1
package/dist/commands/run.js
CHANGED
|
@@ -116,6 +116,7 @@ export async function runCommand(target, opts) {
|
|
|
116
116
|
credential,
|
|
117
117
|
headed: opts.headed,
|
|
118
118
|
projectId: config.projectId,
|
|
119
|
+
projectName: config.projectName,
|
|
119
120
|
});
|
|
120
121
|
await writeFile(join(cwd, 'hive', 'last-run.json'), JSON.stringify({ reportUrl: reportPath, name: test.name }, null, 2)).catch(() => { });
|
|
121
122
|
results[index] = { name: test.name, result, reportUrl: reportPath };
|
package/dist/report/html.js
CHANGED
|
@@ -35,6 +35,17 @@ function renderTraceRow(l) {
|
|
|
35
35
|
</span>
|
|
36
36
|
</li>`;
|
|
37
37
|
}
|
|
38
|
+
function renderBrowserLogRow(b) {
|
|
39
|
+
const isBad = b.level === 'error' || b.level === 'failed' || Number(b.level) >= 400;
|
|
40
|
+
return `
|
|
41
|
+
<li class="trace-row ${isBad ? 'fail' : 'ok'}">
|
|
42
|
+
<span class="trace-status">${b.type === 'network' ? '⇄' : '»'}</span>
|
|
43
|
+
<span class="trace-body">
|
|
44
|
+
<span class="trace-tool">${escapeHtml(b.type)} · ${escapeHtml(b.level)}</span>
|
|
45
|
+
<span class="trace-reasoning">${escapeHtml(b.text)}</span>
|
|
46
|
+
</span>
|
|
47
|
+
</li>`;
|
|
48
|
+
}
|
|
38
49
|
export function renderHtmlReport(testName, result) {
|
|
39
50
|
const passed = result.status === 'passed';
|
|
40
51
|
const statusWord = passed ? 'PASS' : result.status === 'error' ? 'ERROR' : 'FAIL';
|
|
@@ -48,6 +59,7 @@ export function renderHtmlReport(testName, result) {
|
|
|
48
59
|
const firstLabel = result.steps.find((s) => s.screenshot != null)?.text || result.screenshots[0]?.label || '';
|
|
49
60
|
const stepsHtml = result.steps.map((s, i) => renderStepRow(s, i === 0)).join('\n');
|
|
50
61
|
const traceHtml = result.toolLog.map(renderTraceRow).join('\n');
|
|
62
|
+
const browserLogHtml = result.browserLogs.map(renderBrowserLogRow).join('\n');
|
|
51
63
|
const galleryHtml = result.screenshots
|
|
52
64
|
.map((sc, i) => `<button class="thumb" data-shot="${i}" data-label="${escapeHtml(sc.label || '')}"><img src="${dataUris[i]}" loading="lazy" /></button>`)
|
|
53
65
|
.join('\n');
|
|
@@ -226,6 +238,13 @@ export function renderHtmlReport(testName, result) {
|
|
|
226
238
|
</details>`
|
|
227
239
|
: ''}
|
|
228
240
|
|
|
241
|
+
${result.browserLogs.length
|
|
242
|
+
? `<details class="trace">
|
|
243
|
+
<summary>Console & network (${result.browserLogs.length}) — errors and failed requests seen on the page during this run</summary>
|
|
244
|
+
<ul class="trace-list">${browserLogHtml}</ul>
|
|
245
|
+
</details>`
|
|
246
|
+
: ''}
|
|
247
|
+
|
|
229
248
|
<script>
|
|
230
249
|
const SHOTS = ${JSON.stringify(dataUris)};
|
|
231
250
|
const LABELS = ${JSON.stringify(result.screenshots.map((s) => s.label || ''))};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecolonylab/hivemind",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Forager — the CLI that runs on your machine and executes for the Hivemind brain. Describe a flow in plain English, an AI agent drives a real browser and reports pass/fail. No LLM key needed on this machine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|