site-agent-pro 1.0.4 → 1.0.6
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/cli/run.js +14 -0
- package/dist/dashboard/server.js +4 -1
- package/package.json +1 -1
package/dist/cli/run.js
CHANGED
|
@@ -63,6 +63,20 @@ function openUrl(url) {
|
|
|
63
63
|
program
|
|
64
64
|
.name("site-agent-pro")
|
|
65
65
|
.description("AI-powered browser agent for website auditing and side-by-side development");
|
|
66
|
+
program
|
|
67
|
+
.command("install-browsers")
|
|
68
|
+
.description("Download the necessary browser binaries (Playwright Chromium)")
|
|
69
|
+
.action(async () => {
|
|
70
|
+
const { execSync } = await import("node:child_process");
|
|
71
|
+
console.log("Downloading browsers... this may take a minute.");
|
|
72
|
+
try {
|
|
73
|
+
execSync("npx playwright install chromium", { stdio: "inherit" });
|
|
74
|
+
console.log("✅ Browsers installed successfully!");
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
console.error(`❌ Failed to install browsers: ${err.message}`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
66
80
|
program
|
|
67
81
|
.command("init")
|
|
68
82
|
.description("Initialize global configuration at ~/.site-agent-pro/.env")
|
package/dist/dashboard/server.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import http from "node:http";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
4
5
|
import dotenv from "dotenv";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
5
8
|
import { buildRunDetail, buildStandaloneReportHtml, listVisibleRunSummaries } from "../backend/dashboardData.js";
|
|
6
9
|
import { artifactContentType, isAllowedDashboardArtifact, isImageArtifact, isVideoArtifact } from "../backend/runArtifacts.js";
|
|
7
10
|
import { createLocalRunRepository } from "../backend/runRepository.js";
|
|
@@ -195,7 +198,7 @@ async function handleRequest(req, res, args) {
|
|
|
195
198
|
if (dashboardScripts.includes(pathParts[0] || "")) {
|
|
196
199
|
const requestedName = pathParts[0];
|
|
197
200
|
const diskName = requestedName === "app.js" ? "client.js" : requestedName;
|
|
198
|
-
const distPath = path.join(
|
|
201
|
+
const distPath = path.join(__dirname, diskName);
|
|
199
202
|
if (fs.existsSync(distPath)) {
|
|
200
203
|
sendText(res, 200, fs.readFileSync(distPath, "utf8"), "application/javascript");
|
|
201
204
|
return;
|