browser-debugging-daemon 1.0.0
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/daemon.js +931 -0
- package/dashboard/app.js +1139 -0
- package/dashboard/index.html +277 -0
- package/dashboard/styles.css +774 -0
- package/index.js +223 -0
- package/mcp_server.js +999 -0
- package/orchestrator/RunTemplateStore.js +30 -0
- package/orchestrator/TaskRunStore.js +33 -0
- package/orchestrator/TaskRunner.js +803 -0
- package/package.json +66 -0
- package/runtime/ArtifactStore.js +202 -0
- package/runtime/BrowserRuntime.js +1706 -0
- package/shared.js +358 -0
- package/subagent/BrowserSubagent.js +689 -0
- package/subagent/OpenAIPlanner.js +382 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
export class RunTemplateStore {
|
|
5
|
+
constructor(baseDir) {
|
|
6
|
+
this.baseDir = baseDir;
|
|
7
|
+
this.templatesDir = path.join(baseDir, "task-runs");
|
|
8
|
+
this.templatesPath = path.join(this.templatesDir, "templates.json");
|
|
9
|
+
fs.mkdirSync(this.templatesDir, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
load() {
|
|
13
|
+
if (!fs.existsSync(this.templatesPath)) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const parsed = JSON.parse(fs.readFileSync(this.templatesPath, "utf8"));
|
|
19
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error(`Failed to load run templates: ${error.message}`);
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
persist(templates) {
|
|
27
|
+
const serializable = (templates || []).map((template) => ({ ...template }));
|
|
28
|
+
fs.writeFileSync(this.templatesPath, JSON.stringify(serializable, null, 2), "utf8");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
export class TaskRunStore {
|
|
5
|
+
constructor(baseDir) {
|
|
6
|
+
this.baseDir = baseDir;
|
|
7
|
+
this.runsDir = path.join(baseDir, "task-runs");
|
|
8
|
+
this.indexPath = path.join(this.runsDir, "index.json");
|
|
9
|
+
fs.mkdirSync(this.runsDir, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
persist(runs) {
|
|
13
|
+
const serializable = runs.map((run) => ({
|
|
14
|
+
...run,
|
|
15
|
+
promise: undefined,
|
|
16
|
+
}));
|
|
17
|
+
fs.writeFileSync(this.indexPath, JSON.stringify(serializable, null, 2), "utf8");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
load() {
|
|
21
|
+
if (!fs.existsSync(this.indexPath)) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const parsed = JSON.parse(fs.readFileSync(this.indexPath, "utf8"));
|
|
27
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error(`Failed to load task runs: ${error.message}`);
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|