dev3000 0.0.186 → 0.0.188
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/README.md +101 -13
- package/bin/dev3000 +1 -2
- package/dist/cdp-monitor.d.ts +7 -12
- package/dist/cdp-monitor.d.ts.map +1 -1
- package/dist/cdp-monitor.js +86 -170
- package/dist/cdp-monitor.js.map +1 -1
- package/dist/cli.d.ts +1 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1369
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/portless.d.ts +3 -0
- package/dist/portless.d.ts.map +1 -1
- package/dist/portless.js +10 -0
- package/dist/portless.js.map +1 -1
- package/dist/runtime/bridge.d.ts +26 -0
- package/dist/runtime/bridge.d.ts.map +1 -0
- package/dist/runtime/bridge.js +340 -0
- package/dist/runtime/bridge.js.map +1 -0
- package/dist/runtime/chrome-isolation.d.ts +16 -0
- package/dist/runtime/chrome-isolation.d.ts.map +1 -0
- package/dist/runtime/chrome-isolation.js +119 -0
- package/dist/runtime/chrome-isolation.js.map +1 -0
- package/dist/runtime/cli.js +116 -26
- package/dist/runtime/cli.js.map +1 -1
- package/dist/runtime/event-views.d.ts +21 -0
- package/dist/runtime/event-views.d.ts.map +1 -0
- package/dist/runtime/event-views.js +53 -0
- package/dist/runtime/event-views.js.map +1 -0
- package/dist/runtime/harness.d.ts +16 -0
- package/dist/runtime/harness.d.ts.map +1 -0
- package/dist/runtime/harness.js +68 -0
- package/dist/runtime/harness.js.map +1 -0
- package/dist/runtime/local-proxy.d.ts +12 -0
- package/dist/runtime/local-proxy.d.ts.map +1 -0
- package/dist/runtime/local-proxy.js +114 -0
- package/dist/runtime/local-proxy.js.map +1 -0
- package/dist/runtime/runtime.d.ts +14 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +80 -19
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/sandbox-agent.d.ts +6 -0
- package/dist/runtime/sandbox-agent.d.ts.map +1 -0
- package/dist/runtime/sandbox-agent.js +35 -0
- package/dist/runtime/sandbox-agent.js.map +1 -0
- package/dist/runtime/sandbox-command.d.ts +9 -0
- package/dist/runtime/sandbox-command.d.ts.map +1 -0
- package/dist/runtime/sandbox-command.js +101 -0
- package/dist/runtime/sandbox-command.js.map +1 -0
- package/dist/runtime/sandbox-proxy.d.ts +11 -0
- package/dist/runtime/sandbox-proxy.d.ts.map +1 -0
- package/dist/runtime/sandbox-proxy.js +123 -0
- package/dist/runtime/sandbox-proxy.js.map +1 -0
- package/dist/runtime/sandbox-sessions.d.ts +31 -0
- package/dist/runtime/sandbox-sessions.d.ts.map +1 -0
- package/dist/runtime/sandbox-sessions.js +102 -0
- package/dist/runtime/sandbox-sessions.js.map +1 -0
- package/dist/runtime/sandbox.d.ts +21 -0
- package/dist/runtime/sandbox.d.ts.map +1 -0
- package/dist/runtime/sandbox.js +481 -0
- package/dist/runtime/sandbox.js.map +1 -0
- package/dist/utils/agent-browser.d.ts +2 -120
- package/dist/utils/agent-browser.d.ts.map +1 -1
- package/dist/utils/agent-browser.js +13 -376
- package/dist/utils/agent-browser.js.map +1 -1
- package/dist/utils/project-name.d.ts +2 -2
- package/dist/utils/project-name.js +2 -2
- package/package.json +13 -22
- package/skills/d3k/SKILL.md +23 -1
- package/dist/commands/crawl.d.ts +0 -12
- package/dist/commands/crawl.d.ts.map +0 -1
- package/dist/commands/crawl.js +0 -101
- package/dist/commands/crawl.js.map +0 -1
- package/dist/commands/errors.d.ts +0 -14
- package/dist/commands/errors.d.ts.map +0 -1
- package/dist/commands/errors.js +0 -246
- package/dist/commands/errors.js.map +0 -1
- package/dist/commands/fix.d.ts +0 -13
- package/dist/commands/fix.d.ts.map +0 -1
- package/dist/commands/fix.js +0 -219
- package/dist/commands/fix.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -13
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -146
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/resume.d.ts +0 -11
- package/dist/commands/resume.d.ts.map +0 -1
- package/dist/commands/resume.js +0 -75
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/status.d.ts +0 -21
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -44
- package/dist/commands/status.js.map +0 -1
- package/dist/components/AgentSelector.d.ts +0 -12
- package/dist/components/AgentSelector.d.ts.map +0 -1
- package/dist/components/AgentSelector.js +0 -99
- package/dist/components/AgentSelector.js.map +0 -1
- package/dist/components/PackageSelector.d.ts +0 -13
- package/dist/components/PackageSelector.d.ts.map +0 -1
- package/dist/components/PackageSelector.js +0 -79
- package/dist/components/PackageSelector.js.map +0 -1
- package/dist/constants/log-colors.d.ts +0 -43
- package/dist/constants/log-colors.d.ts.map +0 -1
- package/dist/constants/log-colors.js +0 -59
- package/dist/constants/log-colors.js.map +0 -1
- package/dist/dev-environment.d.ts +0 -187
- package/dist/dev-environment.d.ts.map +0 -1
- package/dist/dev-environment.js +0 -2248
- package/dist/dev-environment.js.map +0 -1
- package/dist/screencast-manager.d.ts +0 -78
- package/dist/screencast-manager.d.ts.map +0 -1
- package/dist/screencast-manager.js +0 -529
- package/dist/screencast-manager.js.map +0 -1
- package/dist/services/parsers/error-detectors/base.d.ts +0 -24
- package/dist/services/parsers/error-detectors/base.d.ts.map +0 -1
- package/dist/services/parsers/error-detectors/base.js +0 -44
- package/dist/services/parsers/error-detectors/base.js.map +0 -1
- package/dist/services/parsers/error-detectors/index.d.ts +0 -6
- package/dist/services/parsers/error-detectors/index.d.ts.map +0 -1
- package/dist/services/parsers/error-detectors/index.js +0 -6
- package/dist/services/parsers/error-detectors/index.js.map +0 -1
- package/dist/services/parsers/error-detectors/nextjs.d.ts +0 -9
- package/dist/services/parsers/error-detectors/nextjs.d.ts.map +0 -1
- package/dist/services/parsers/error-detectors/nextjs.js +0 -52
- package/dist/services/parsers/error-detectors/nextjs.js.map +0 -1
- package/dist/services/parsers/index.d.ts +0 -9
- package/dist/services/parsers/index.d.ts.map +0 -1
- package/dist/services/parsers/index.js +0 -10
- package/dist/services/parsers/index.js.map +0 -1
- package/dist/services/parsers/log-parsers/base.d.ts +0 -26
- package/dist/services/parsers/log-parsers/base.d.ts.map +0 -1
- package/dist/services/parsers/log-parsers/base.js +0 -6
- package/dist/services/parsers/log-parsers/base.js.map +0 -1
- package/dist/services/parsers/log-parsers/index.d.ts +0 -6
- package/dist/services/parsers/log-parsers/index.d.ts.map +0 -1
- package/dist/services/parsers/log-parsers/index.js +0 -5
- package/dist/services/parsers/log-parsers/index.js.map +0 -1
- package/dist/services/parsers/log-parsers/standard.d.ts +0 -9
- package/dist/services/parsers/log-parsers/standard.d.ts.map +0 -1
- package/dist/services/parsers/log-parsers/standard.js +0 -17
- package/dist/services/parsers/log-parsers/standard.js.map +0 -1
- package/dist/services/parsers/output-processor.d.ts +0 -39
- package/dist/services/parsers/output-processor.d.ts.map +0 -1
- package/dist/services/parsers/output-processor.js +0 -54
- package/dist/services/parsers/output-processor.js.map +0 -1
- package/dist/skills/d3k/internal-skill.md +0 -32
- package/dist/skills/index.d.ts +0 -54
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -214
- package/dist/skills/index.js.map +0 -1
- package/dist/src/tui-interface-impl.tsx +0 -644
- package/dist/tui-interface-impl.d.ts +0 -30
- package/dist/tui-interface-impl.d.ts.map +0 -1
- package/dist/tui-interface-impl.js +0 -403
- package/dist/tui-interface-impl.js.map +0 -1
- package/dist/tui-interface-opentui.d.ts +0 -33
- package/dist/tui-interface-opentui.d.ts.map +0 -1
- package/dist/tui-interface-opentui.js +0 -1128
- package/dist/tui-interface-opentui.js.map +0 -1
- package/dist/tui-interface.d.ts +0 -38
- package/dist/tui-interface.d.ts.map +0 -1
- package/dist/tui-interface.js +0 -84
- package/dist/tui-interface.js.map +0 -1
- package/dist/utils/agent-detection.d.ts +0 -17
- package/dist/utils/agent-detection.d.ts.map +0 -1
- package/dist/utils/agent-detection.js +0 -81
- package/dist/utils/agent-detection.js.map +0 -1
- package/dist/utils/agent-selection.d.ts +0 -25
- package/dist/utils/agent-selection.d.ts.map +0 -1
- package/dist/utils/agent-selection.js +0 -73
- package/dist/utils/agent-selection.js.map +0 -1
- package/dist/utils/browser-command-argv.d.ts +0 -19
- package/dist/utils/browser-command-argv.d.ts.map +0 -1
- package/dist/utils/browser-command-argv.js +0 -149
- package/dist/utils/browser-command-argv.js.map +0 -1
- package/dist/utils/build-version.d.ts +0 -2
- package/dist/utils/build-version.d.ts.map +0 -1
- package/dist/utils/build-version.js +0 -8
- package/dist/utils/build-version.js.map +0 -1
- package/dist/utils/cli-options.d.ts +0 -5
- package/dist/utils/cli-options.d.ts.map +0 -1
- package/dist/utils/cli-options.js +0 -36
- package/dist/utils/cli-options.js.map +0 -1
- package/dist/utils/d3k-dir.d.ts +0 -3
- package/dist/utils/d3k-dir.d.ts.map +0 -1
- package/dist/utils/d3k-dir.js +0 -12
- package/dist/utils/d3k-dir.js.map +0 -1
- package/dist/utils/d3k-skill-installer.d.ts +0 -4
- package/dist/utils/d3k-skill-installer.d.ts.map +0 -1
- package/dist/utils/d3k-skill-installer.js +0 -30
- package/dist/utils/d3k-skill-installer.js.map +0 -1
- package/dist/utils/log-filename.d.ts +0 -30
- package/dist/utils/log-filename.d.ts.map +0 -1
- package/dist/utils/log-filename.js +0 -60
- package/dist/utils/log-filename.js.map +0 -1
- package/dist/utils/project-detector.d.ts +0 -25
- package/dist/utils/project-detector.d.ts.map +0 -1
- package/dist/utils/project-detector.js +0 -153
- package/dist/utils/project-detector.js.map +0 -1
- package/dist/utils/project-metadata.d.ts +0 -4
- package/dist/utils/project-metadata.d.ts.map +0 -1
- package/dist/utils/project-metadata.js +0 -48
- package/dist/utils/project-metadata.js.map +0 -1
- package/dist/utils/repo-validate.d.ts +0 -2
- package/dist/utils/repo-validate.d.ts.map +0 -1
- package/dist/utils/repo-validate.js +0 -10
- package/dist/utils/repo-validate.js.map +0 -1
- package/dist/utils/session.d.ts +0 -19
- package/dist/utils/session.d.ts.map +0 -1
- package/dist/utils/session.js +0 -65
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/skill-installer.d.ts +0 -65
- package/dist/utils/skill-installer.d.ts.map +0 -1
- package/dist/utils/skill-installer.js +0 -265
- package/dist/utils/skill-installer.js.map +0 -1
- package/dist/utils/timestamp.d.ts +0 -20
- package/dist/utils/timestamp.d.ts.map +0 -1
- package/dist/utils/timestamp.js +0 -57
- package/dist/utils/timestamp.js.map +0 -1
- package/dist/utils/tmux-helpers.d.ts +0 -36
- package/dist/utils/tmux-helpers.d.ts.map +0 -1
- package/dist/utils/tmux-helpers.js +0 -118
- package/dist/utils/tmux-helpers.js.map +0 -1
- package/dist/utils/user-config.d.ts +0 -12
- package/dist/utils/user-config.d.ts.map +0 -1
- package/dist/utils/user-config.js +0 -46
- package/dist/utils/user-config.js.map +0 -1
- package/dist/utils/version-check.d.ts +0 -52
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js +0 -304
- package/dist/utils/version-check.js.map +0 -1
- package/src/tui-interface-impl.tsx +0 -644
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Provides a TypeScript interface to agent-browser commands for browser automation.
|
|
5
|
-
* Uses the CLI approach for reliability and to leverage agent-browser's daemon architecture.
|
|
6
|
-
*/
|
|
7
|
-
import { spawn, spawnSync } from "child_process";
|
|
8
|
-
import { accessSync, chmodSync, constants, existsSync, mkdirSync } from "fs";
|
|
1
|
+
/** Resolve the installed agent-browser helper without launching a separate browser. */
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { accessSync, chmodSync, constants, existsSync } from "fs";
|
|
9
4
|
import { homedir } from "os";
|
|
10
5
|
import { dirname, join } from "path";
|
|
11
6
|
import { fileURLToPath } from "url";
|
|
@@ -33,7 +28,7 @@ function getRunnablePath(searchPath) {
|
|
|
33
28
|
}
|
|
34
29
|
// Find the agent-browser binary in node_modules
|
|
35
30
|
function getAgentBrowserPath() {
|
|
36
|
-
// 1. Check environment variable first
|
|
31
|
+
// 1. Check environment variable first
|
|
37
32
|
if (process.env.AGENT_BROWSER_PATH) {
|
|
38
33
|
const runnablePath = getRunnablePath(process.env.AGENT_BROWSER_PATH);
|
|
39
34
|
if (runnablePath) {
|
|
@@ -42,6 +37,14 @@ function getAgentBrowserPath() {
|
|
|
42
37
|
}
|
|
43
38
|
// Build search paths from multiple starting points
|
|
44
39
|
const searchPaths = [];
|
|
40
|
+
// Package managers may hoist the dependency beside d3k (including sandbox installs).
|
|
41
|
+
try {
|
|
42
|
+
const dependency = createRequire(import.meta.url).resolve("agent-browser/package.json");
|
|
43
|
+
searchPaths.push(join(dirname(dependency), "bin", "agent-browser.js"));
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// Bundled installations can fall back to the filesystem/global probes below.
|
|
47
|
+
}
|
|
45
48
|
// 2. Try import.meta.url-based paths (works in dev, may not work in Next.js bundle)
|
|
46
49
|
try {
|
|
47
50
|
const currentFile = fileURLToPath(import.meta.url);
|
|
@@ -85,373 +88,7 @@ function getAgentBrowserPath() {
|
|
|
85
88
|
// Fallback to global command (may work if installed globally)
|
|
86
89
|
return "agent-browser";
|
|
87
90
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Build CLI args from options
|
|
90
|
-
*/
|
|
91
|
-
function buildArgs(options) {
|
|
92
|
-
const args = [];
|
|
93
|
-
if (options.headed) {
|
|
94
|
-
args.push("--headed");
|
|
95
|
-
}
|
|
96
|
-
if (options.cdpPort) {
|
|
97
|
-
args.push("--cdp", String(options.cdpPort));
|
|
98
|
-
}
|
|
99
|
-
if (options.session) {
|
|
100
|
-
args.push("--session", options.session);
|
|
101
|
-
}
|
|
102
|
-
if (options.profile) {
|
|
103
|
-
args.push("--profile", options.profile);
|
|
104
|
-
}
|
|
105
|
-
// Always use JSON output for parsing
|
|
106
|
-
args.push("--json");
|
|
107
|
-
return args;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Execute an agent-browser command
|
|
111
|
-
*/
|
|
112
|
-
async function execAgentBrowser(command, options = {}) {
|
|
113
|
-
const args = [...buildArgs(options), ...command];
|
|
114
|
-
const timeout = options.timeout || 30000;
|
|
115
|
-
const agentBrowserPath = getAgentBrowserPath();
|
|
116
|
-
return new Promise((resolve, reject) => {
|
|
117
|
-
const proc = spawn(agentBrowserPath, args, {
|
|
118
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
119
|
-
timeout
|
|
120
|
-
});
|
|
121
|
-
let stdout = "";
|
|
122
|
-
let stderr = "";
|
|
123
|
-
proc.stdout?.on("data", (data) => {
|
|
124
|
-
stdout += data.toString();
|
|
125
|
-
});
|
|
126
|
-
proc.stderr?.on("data", (data) => {
|
|
127
|
-
stderr += data.toString();
|
|
128
|
-
});
|
|
129
|
-
proc.on("close", (code) => {
|
|
130
|
-
if (code === 0) {
|
|
131
|
-
resolve(stdout);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
reject(new Error(`agent-browser failed (code ${code}): ${stderr || stdout}`));
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
proc.on("error", (err) => {
|
|
138
|
-
reject(new Error(`agent-browser spawn error: ${err.message}`));
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Open a URL in the browser
|
|
144
|
-
*/
|
|
145
|
-
export async function openUrl(url, options = {}) {
|
|
146
|
-
try {
|
|
147
|
-
const output = await execAgentBrowser(["open", url], options);
|
|
148
|
-
return { success: true, output };
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
return {
|
|
152
|
-
success: false,
|
|
153
|
-
error: error instanceof Error ? error.message : String(error)
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Take a snapshot of the current page (accessibility tree with refs)
|
|
159
|
-
*/
|
|
160
|
-
export async function snapshot(options = {}) {
|
|
161
|
-
const args = ["snapshot"];
|
|
162
|
-
// -i for interactive elements only (reduces tokens)
|
|
163
|
-
if (options.interactive !== false) {
|
|
164
|
-
args.push("-i");
|
|
165
|
-
}
|
|
166
|
-
// -c for compact output
|
|
167
|
-
if (options.compact) {
|
|
168
|
-
args.push("-c");
|
|
169
|
-
}
|
|
170
|
-
const output = await execAgentBrowser(args, options);
|
|
171
|
-
// Parse the JSON output to extract elements
|
|
172
|
-
const elements = [];
|
|
173
|
-
try {
|
|
174
|
-
const parsed = JSON.parse(output);
|
|
175
|
-
if (parsed.success && parsed.data?.refs) {
|
|
176
|
-
for (const [ref, info] of Object.entries(parsed.data.refs)) {
|
|
177
|
-
const refInfo = info;
|
|
178
|
-
elements.push({
|
|
179
|
-
ref: `@${ref}`,
|
|
180
|
-
role: refInfo.role || "unknown",
|
|
181
|
-
name: refInfo.name,
|
|
182
|
-
text: refInfo.text
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return { elements, raw: parsed.data?.snapshot || output };
|
|
187
|
-
}
|
|
188
|
-
catch {
|
|
189
|
-
// Fallback to text parsing if JSON fails
|
|
190
|
-
const refPattern = /@(\w+)\s+(\w+)(?:\s+"([^"]*)")?/g;
|
|
191
|
-
const matches = output.matchAll(refPattern);
|
|
192
|
-
for (const match of matches) {
|
|
193
|
-
elements.push({
|
|
194
|
-
ref: `@${match[1]}`,
|
|
195
|
-
role: match[2],
|
|
196
|
-
name: match[3]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
return { elements, raw: output };
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Click an element by ref or selector
|
|
204
|
-
*/
|
|
205
|
-
export async function click(target, options = {}) {
|
|
206
|
-
try {
|
|
207
|
-
const output = await execAgentBrowser(["click", target], options);
|
|
208
|
-
return { success: true, output };
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
return {
|
|
212
|
-
success: false,
|
|
213
|
-
error: error instanceof Error ? error.message : String(error)
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Type text into the focused element
|
|
219
|
-
*/
|
|
220
|
-
export async function type(text, options = {}) {
|
|
221
|
-
try {
|
|
222
|
-
const output = await execAgentBrowser(["keyboard", "type", text], options);
|
|
223
|
-
return { success: true, output };
|
|
224
|
-
}
|
|
225
|
-
catch (error) {
|
|
226
|
-
return {
|
|
227
|
-
success: false,
|
|
228
|
-
error: error instanceof Error ? error.message : String(error)
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Fill an input field (by ref or selector)
|
|
234
|
-
*/
|
|
235
|
-
export async function fill(target, value, options = {}) {
|
|
236
|
-
try {
|
|
237
|
-
const output = await execAgentBrowser(["fill", target, value], options);
|
|
238
|
-
return { success: true, output };
|
|
239
|
-
}
|
|
240
|
-
catch (error) {
|
|
241
|
-
return {
|
|
242
|
-
success: false,
|
|
243
|
-
error: error instanceof Error ? error.message : String(error)
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Scroll the page
|
|
249
|
-
*/
|
|
250
|
-
export async function scroll(direction, amount, options = {}) {
|
|
251
|
-
try {
|
|
252
|
-
const args = ["scroll", direction];
|
|
253
|
-
if (amount) {
|
|
254
|
-
args.push(String(amount));
|
|
255
|
-
}
|
|
256
|
-
const output = await execAgentBrowser(args, options);
|
|
257
|
-
return { success: true, output };
|
|
258
|
-
}
|
|
259
|
-
catch (error) {
|
|
260
|
-
return {
|
|
261
|
-
success: false,
|
|
262
|
-
error: error instanceof Error ? error.message : String(error)
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Take a screenshot
|
|
268
|
-
*/
|
|
269
|
-
export async function screenshot(outputPath, options = {}) {
|
|
270
|
-
try {
|
|
271
|
-
// Ensure output directory exists
|
|
272
|
-
const dir = dirname(outputPath);
|
|
273
|
-
if (!existsSync(dir)) {
|
|
274
|
-
mkdirSync(dir, { recursive: true });
|
|
275
|
-
}
|
|
276
|
-
const args = ["screenshot", outputPath];
|
|
277
|
-
if (options.fullPage) {
|
|
278
|
-
args.push("--full");
|
|
279
|
-
}
|
|
280
|
-
await execAgentBrowser(args, options);
|
|
281
|
-
return { success: true, path: outputPath };
|
|
282
|
-
}
|
|
283
|
-
catch (error) {
|
|
284
|
-
return {
|
|
285
|
-
success: false,
|
|
286
|
-
error: error instanceof Error ? error.message : String(error)
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Get console messages from the browser
|
|
292
|
-
*/
|
|
293
|
-
export async function getConsoleMessages(options = {}) {
|
|
294
|
-
try {
|
|
295
|
-
const output = await execAgentBrowser(["console"], options);
|
|
296
|
-
// Parse JSON output
|
|
297
|
-
const parsed = JSON.parse(output);
|
|
298
|
-
return Array.isArray(parsed) ? parsed : [];
|
|
299
|
-
}
|
|
300
|
-
catch {
|
|
301
|
-
return [];
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Get page errors
|
|
306
|
-
*/
|
|
307
|
-
export async function getErrors(options = {}) {
|
|
308
|
-
try {
|
|
309
|
-
const output = await execAgentBrowser(["errors"], options);
|
|
310
|
-
const parsed = JSON.parse(output);
|
|
311
|
-
return Array.isArray(parsed) ? parsed : [];
|
|
312
|
-
}
|
|
313
|
-
catch {
|
|
314
|
-
return [];
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Navigate back
|
|
319
|
-
*/
|
|
320
|
-
export async function back(options = {}) {
|
|
321
|
-
try {
|
|
322
|
-
const output = await execAgentBrowser(["back"], options);
|
|
323
|
-
return { success: true, output };
|
|
324
|
-
}
|
|
325
|
-
catch (error) {
|
|
326
|
-
return {
|
|
327
|
-
success: false,
|
|
328
|
-
error: error instanceof Error ? error.message : String(error)
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Navigate forward
|
|
334
|
-
*/
|
|
335
|
-
export async function forward(options = {}) {
|
|
336
|
-
try {
|
|
337
|
-
const output = await execAgentBrowser(["forward"], options);
|
|
338
|
-
return { success: true, output };
|
|
339
|
-
}
|
|
340
|
-
catch (error) {
|
|
341
|
-
return {
|
|
342
|
-
success: false,
|
|
343
|
-
error: error instanceof Error ? error.message : String(error)
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Reload the page
|
|
349
|
-
*/
|
|
350
|
-
export async function reload(options = {}) {
|
|
351
|
-
try {
|
|
352
|
-
const output = await execAgentBrowser(["reload"], options);
|
|
353
|
-
return { success: true, output };
|
|
354
|
-
}
|
|
355
|
-
catch (error) {
|
|
356
|
-
return {
|
|
357
|
-
success: false,
|
|
358
|
-
error: error instanceof Error ? error.message : String(error)
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Close the browser
|
|
364
|
-
*/
|
|
365
|
-
export async function close(options = {}) {
|
|
366
|
-
try {
|
|
367
|
-
const output = await execAgentBrowser(["close"], options);
|
|
368
|
-
return { success: true, output };
|
|
369
|
-
}
|
|
370
|
-
catch (error) {
|
|
371
|
-
return {
|
|
372
|
-
success: false,
|
|
373
|
-
error: error instanceof Error ? error.message : String(error)
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Get the current URL
|
|
379
|
-
*/
|
|
380
|
-
export async function getCurrentUrl(options = {}) {
|
|
381
|
-
try {
|
|
382
|
-
const output = await execAgentBrowser(["get", "url"], options);
|
|
383
|
-
return output.trim();
|
|
384
|
-
}
|
|
385
|
-
catch {
|
|
386
|
-
return null;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Get page title
|
|
391
|
-
*/
|
|
392
|
-
export async function getTitle(options = {}) {
|
|
393
|
-
try {
|
|
394
|
-
const output = await execAgentBrowser(["get", "title"], options);
|
|
395
|
-
return output.trim();
|
|
396
|
-
}
|
|
397
|
-
catch {
|
|
398
|
-
return null;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Evaluate JavaScript in the browser
|
|
403
|
-
*/
|
|
404
|
-
export async function evaluate(expression, options = {}) {
|
|
405
|
-
try {
|
|
406
|
-
const output = await execAgentBrowser(["eval", expression], options);
|
|
407
|
-
return { success: true, output };
|
|
408
|
-
}
|
|
409
|
-
catch (error) {
|
|
410
|
-
return {
|
|
411
|
-
success: false,
|
|
412
|
-
error: error instanceof Error ? error.message : String(error)
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Wait for an element to appear
|
|
418
|
-
*/
|
|
419
|
-
export async function waitFor(selector, options = {}) {
|
|
420
|
-
try {
|
|
421
|
-
const args = ["wait", selector];
|
|
422
|
-
if (options.timeout) {
|
|
423
|
-
args.push("--timeout", String(options.timeout));
|
|
424
|
-
}
|
|
425
|
-
const output = await execAgentBrowser(args, options);
|
|
426
|
-
return { success: true, output };
|
|
427
|
-
}
|
|
428
|
-
catch (error) {
|
|
429
|
-
return {
|
|
430
|
-
success: false,
|
|
431
|
-
error: error instanceof Error ? error.message : String(error)
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Check if agent-browser is installed and accessible
|
|
437
|
-
*/
|
|
438
|
-
export function isAgentBrowserAvailable() {
|
|
439
|
-
try {
|
|
440
|
-
const agentBrowserPath = getAgentBrowserPath();
|
|
441
|
-
// agent-browser doesn't have --version, just check if the binary exists and responds to --help
|
|
442
|
-
const result = spawnSync(agentBrowserPath, ["--help"], {
|
|
443
|
-
stdio: "pipe",
|
|
444
|
-
shell: false
|
|
445
|
-
});
|
|
446
|
-
return result.status === 0;
|
|
447
|
-
}
|
|
448
|
-
catch {
|
|
449
|
-
return false;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* Get agent-browser path for debugging
|
|
454
|
-
*/
|
|
91
|
+
/** Resolve the installed browser helper for the runtime-owned CDP session. */
|
|
455
92
|
export function getAgentBrowserBinaryPath() {
|
|
456
93
|
return getAgentBrowserPath();
|
|
457
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-browser.js","sourceRoot":"","sources":["../../src/utils/agent-browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,SAAS,eAAe,CAAC,UAAkB;IACzC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,UAAU,CAAA;IACnB,CAAC;IACD,IAAI,CAAC;QACH,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;QACtC,OAAO,UAAU,CAAA;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,SAAS,CAAC,UA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QACrB,CAAC;IACH,CAAC;IAED,8DAA8D;IAC9D,OAAO,eAAe,CAAA;AACxB,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,yBAAyB;IACvC,OAAO,mBAAmB,EAAE,CAAA;AAC9B,CAAC"}
|
|
@@ -21,13 +21,13 @@ export declare function getProjectDisplayName(cwd?: string): string;
|
|
|
21
21
|
* Prefers the readable name (`my-app` -> https://my-app.localhost). The
|
|
22
22
|
* path-hashed name is only used when that hostname is already held by another
|
|
23
23
|
* project, so two checkouts with the same name can still run side by side.
|
|
24
|
-
* The data directory (Chrome profile,
|
|
24
|
+
* The data directory (Chrome profile, session discovery) stays keyed by the hashed name
|
|
25
25
|
* either way, so switching hostnames never shares or loses a profile.
|
|
26
26
|
*/
|
|
27
27
|
export declare function getPortlessName(cwd?: string, isHostnameHeld?: (name: string) => boolean): string;
|
|
28
28
|
/**
|
|
29
29
|
* Get the d3k data directory for a project
|
|
30
|
-
*
|
|
30
|
+
* Project browser profiles and session discovery are stored here
|
|
31
31
|
* Structure: ~/.d3k/{projectName}/
|
|
32
32
|
*
|
|
33
33
|
* Honors D3K_DATA_DIR as a full override of the computed project directory.
|
|
@@ -119,7 +119,7 @@ export function getProjectDisplayName(cwd = process.cwd()) {
|
|
|
119
119
|
* Prefers the readable name (`my-app` -> https://my-app.localhost). The
|
|
120
120
|
* path-hashed name is only used when that hostname is already held by another
|
|
121
121
|
* project, so two checkouts with the same name can still run side by side.
|
|
122
|
-
* The data directory (Chrome profile,
|
|
122
|
+
* The data directory (Chrome profile, session discovery) stays keyed by the hashed name
|
|
123
123
|
* either way, so switching hostnames never shares or loses a profile.
|
|
124
124
|
*/
|
|
125
125
|
export function getPortlessName(cwd = process.cwd(), isHostnameHeld = () => false) {
|
|
@@ -128,7 +128,7 @@ export function getPortlessName(cwd = process.cwd(), isHostnameHeld = () => fals
|
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* Get the d3k data directory for a project
|
|
131
|
-
*
|
|
131
|
+
* Project browser profiles and session discovery are stored here
|
|
132
132
|
* Structure: ~/.d3k/{projectName}/
|
|
133
133
|
*
|
|
134
134
|
* Honors D3K_DATA_DIR as a full override of the computed project directory.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev3000",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.188",
|
|
4
4
|
"description": "Agent-first local web debugging runtime with unified server and browser context",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,12 +12,11 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"bin/",
|
|
14
14
|
"dist/",
|
|
15
|
-
"src/tui-interface-impl.tsx",
|
|
16
15
|
"README.md",
|
|
17
16
|
"skills/d3k/"
|
|
18
17
|
],
|
|
19
18
|
"scripts": {
|
|
20
|
-
"build": "./node_modules/@typescript/native/bin/tsc && mkdir -p dist/src && cp src/loading.html dist/src/
|
|
19
|
+
"build": "./node_modules/@typescript/native/bin/tsc && mkdir -p dist/src && cp src/loading.html dist/src/",
|
|
21
20
|
"typegen": "./scripts/typegen.sh",
|
|
22
21
|
"typecheck": "./node_modules/@typescript/native/bin/tsc --noEmit && bun run --filter '*' typecheck",
|
|
23
22
|
"format": "biome format --write .",
|
|
@@ -41,30 +40,21 @@
|
|
|
41
40
|
"claude"
|
|
42
41
|
],
|
|
43
42
|
"dependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"agent-browser": "0.
|
|
46
|
-
"chalk": "^6.0.1",
|
|
43
|
+
"@vercel/sandbox": "^3.9.0",
|
|
44
|
+
"agent-browser": "0.39.2",
|
|
47
45
|
"commander": "15.0.0",
|
|
48
|
-
"
|
|
49
|
-
"ink-select-input": "^6.2.0",
|
|
50
|
-
"ink-spinner": "^5.0.0",
|
|
51
|
-
"ora": "9.4.1",
|
|
52
|
-
"package-manager-detector": "^1.9.0",
|
|
53
|
-
"portless": "0.15.7",
|
|
54
|
-
"react": "19.3.0",
|
|
46
|
+
"portless": "0.15.12",
|
|
55
47
|
"ws": "^8.22.0"
|
|
56
48
|
},
|
|
57
49
|
"devDependencies": {
|
|
58
|
-
"@biomejs/biome": "2.
|
|
59
|
-
"@types/node": "26.6.
|
|
60
|
-
"@types/react": "19.3.0",
|
|
50
|
+
"@biomejs/biome": "2.6.3",
|
|
51
|
+
"@types/node": "26.6.5",
|
|
61
52
|
"@types/ws": "^8.18.2",
|
|
62
53
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
63
54
|
"husky": "^9.1.7",
|
|
64
|
-
"react-devtools-core": "8.0.0",
|
|
65
55
|
"tsx": "^4.23.15",
|
|
66
56
|
"typescript": "^7.0.2",
|
|
67
|
-
"vitest": "5.0.
|
|
57
|
+
"vitest": "5.0.5"
|
|
68
58
|
},
|
|
69
59
|
"engines": {
|
|
70
60
|
"node": ">=24.0.0"
|
|
@@ -81,18 +71,19 @@
|
|
|
81
71
|
],
|
|
82
72
|
"overrides": {
|
|
83
73
|
"@xhmikosr/decompress": "11.1.4",
|
|
84
|
-
"body-parser": "2.
|
|
74
|
+
"body-parser": "2.4.0",
|
|
85
75
|
"defu": "6.1.7",
|
|
86
76
|
"devalue": "5.9.4",
|
|
87
77
|
"linkify-it": "6.1.0",
|
|
88
78
|
"nanoid": "5.1.16",
|
|
89
79
|
"path-to-regexp": "8.4.2",
|
|
90
80
|
"piscina": "5.3.2",
|
|
91
|
-
"postcss": "8.5.
|
|
81
|
+
"postcss": "8.5.32",
|
|
92
82
|
"qs": "6.16.0",
|
|
93
83
|
"rollup": "4.64.3",
|
|
94
84
|
"seroval": "1.6.9",
|
|
95
|
-
"vite": "8.3.
|
|
96
|
-
"yauzl": "3.4.0"
|
|
85
|
+
"vite": "8.3.5",
|
|
86
|
+
"yauzl": "3.4.0",
|
|
87
|
+
"zod": "4.6.7"
|
|
97
88
|
}
|
|
98
89
|
}
|
package/skills/d3k/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ Use `node <skill-directory>/scripts/runtime.mjs` as `runtime` below, from the **
|
|
|
12
12
|
## Prepare
|
|
13
13
|
|
|
14
14
|
1. Run `runtime portless status`. Canonical HTTPS must be ready (`canonical: true`, `serviceInstalled: true`, `setupRequired: false`) before starting the app or browser. If needed run `runtime portless setup`, wait for the one-time administrator authorization, then check again. Stop if setup is unavailable; never silently substitute direct localhost.
|
|
15
|
-
2. Run `runtime status`. Reuse a ready runtime for this project. If it is starting, wait for readiness. Do not start another dev server.
|
|
15
|
+
2. Run `runtime status`. Reuse a ready runtime for this project. If it is starting, wait for readiness. Do not start another dev server.
|
|
16
16
|
3. Start `runtime start` in a retained background tool session. Keep its process handle. The runtime detects the package manager and `dev` script; use `--command '<dev command>'` when needed. Poll `runtime status` until `ready: true` and `browserConnected: true` with a port-free `https://...localhost` URL. Inspect `runtime events` if startup fails while the runtime is still alive, and the retained process output if it exits.
|
|
17
17
|
|
|
18
18
|
## Reproduce and inspect
|
|
@@ -30,3 +30,25 @@ Use `node <skill-directory>/scripts/runtime.mjs` as `runtime` below, from the **
|
|
|
30
30
|
Keep the runtime's project-stable profile for sign-in state. Use `--headless` for CI or when requested; `--servers-only` deliberately omits the browser. Automatic screenshots and persistent log files are off; request a screenshot through `runtime browser screenshot <absolute-path>` when visual evidence is needed.
|
|
31
31
|
|
|
32
32
|
Stop with `runtime stop` or the retained process handle when asked. Leaving the browser open for user testing means leaving the runtime alive. Events are lost when it exits; only profile and session discovery data persist. Console/server text may contain application secrets; inspect selectively and avoid copying sensitive values into reports.
|
|
33
|
+
|
|
34
|
+
## Vercel Sandbox with local Chrome
|
|
35
|
+
|
|
36
|
+
For a remote project with no local checkout, run `runtime sandbox --project <name-or-id> --scope <team> --name <sandbox-name> --no-shell` on the laptop in a retained background session. The launcher requires Vercel CLI login, Bun, Node.js 24+, and macOS. d3k downloads Chrome for Testing automatically on first use and reuses it afterward. It creates a sandbox from the project's linked public GitHub repository, pulls Development env through Vercel CLI, installs dependencies, and starts the remote skill runtime. For a private repository, use `--attach <name>` with an existing sandbox that already contains the checkout. Private-repository access must be configured separately. Do not supply GitHub or Vercel management tokens to the app environment.
|
|
37
|
+
|
|
38
|
+
The app uses `https://<project>.d3k.localhost`; `--hostname songbook` selects `https://songbook.d3k.localhost`. Canonical Portless is required on the laptop before launch, with no Portless inside the VM. A loopback streaming proxy forwards verified HTTPS app traffic and a session token to the sandbox. Add the exact local auth callback URL to the provider allowlist. The laptop companion opens a dedicated local Chrome and maintains an authenticated outbound WSS bridge; project source and dev compute stay remote. Dev commands must honor `PORT`. Keep the companion alive throughout debugging.
|
|
39
|
+
|
|
40
|
+
Run status, browser, events, and stop commands **inside the sandbox's project directory**, using `/tmp/d3k-tools/node_modules/.bin/d3k-runtime`. For example, use `vercel sandbox exec <name> --project <project-id> --scope <team> --workdir <remote-project-root> -- /tmp/d3k-tools/node_modules/.bin/d3k-runtime browser snapshot -i`. Supply a fresh project OIDC token obtained from `vercel project token <project-id> --scope <team> --format json` as the CLI process's `VERCEL_OIDC_TOKEN` environment variable if needed; capture it without printing it or putting it in command arguments. The interactive launcher handles this authentication automatically. Read the remote `status` before driving Chrome and reuse that runtime; do not start another runtime or browser. An interactive `d3k --project team/project` (or `d3k sandbox`) enters the remote project directory and adds tools to PATH. Type `fx` there after authenticating the harness in the sandbox; d3k installs fx if absent but does not provision Gateway keys or forward laptop credentials. `--no-fx` skips installation. Project processes share the harness identity, so manually configured credentials are accessible to project code. Without a TTY, use `vercel sandbox exec` or `vercel sandbox connect` separately. All remote harnesses need their own authentication. The interactive shell does not inherit app env automatically.
|
|
41
|
+
|
|
42
|
+
App traffic streams through the local proxy to the sandbox, preserving the browser origin, redirects, cookies, and WebSockets. Batch browser operations to reduce CDP round trips, select a nearby sandbox region, and avoid continuous screenshots. HMR works through the in-VM proxy. A bridge disconnect records an evidence gap and closes pending channels without replaying commands; reread status and reproduce after reconnecting before claiming complete evidence.
|
|
43
|
+
|
|
44
|
+
Stopping the local launcher stops its runtime and a sandbox it created while preserving the sandbox filesystem. `--attach` leaves the existing VM running. The sandbox agent can control the dedicated Chrome profile, and the public sandbox app endpoint requires the companion session token; application authentication remains the app's responsibility. Keep agent credentials separate from infrastructure credentials; never describe remote browser control as adding no security risk.
|
|
45
|
+
|
|
46
|
+
## CLI aliases and evidence views
|
|
47
|
+
|
|
48
|
+
`d3k`, `dev3000`, and `d3k-runtime` use the same implementation. Local startup is `start`; root options are for sandbox mode. Timeout flags use milliseconds. `logs --count <1..500> --type server|browser|runtime|all` and `errors --context` read recent events from the same live timeline; use `--json` to retain evidence-gap metadata. Prefer cursor-based `events` for reproductions. The runtime does not install agent packages, write log files, or automatically upgrade. Use `browser` rather than the removed `agent-browser` subcommand.
|
|
49
|
+
|
|
50
|
+
Sandbox resume: `d3k --resume` lists locally saved session IDs, projects, sandbox names, branches, URLs, and last-used times. `d3k --resume <id>` restores that sandbox checkout and hostname, refreshes Development env and dependencies, restarts the dev runtime, and pairs the retained browser profile using fresh bridge/proxy tokens. No repository checkout is needed on the laptop. Ctrl-C closes the browser and prints the resume command to stdout. Saved entries contain discovery metadata, not credentials or past terminal output; remote availability is checked on resume. Optional `--command`, `--hostname`, `--timeout`, `--no-shell`, `--no-fx`, and `--headless` override launch settings. Sandboxes originally created by d3k stop compute again on resumed exit; externally attached sandboxes remain running.
|
|
51
|
+
|
|
52
|
+
Use `d3k start --harness codex` locally or `d3k --project my-team/my-project --harness fx` remotely to launch a coding harness after readiness. The supported choices are `fx`, `codex`, and `claude`; commands, paths, and extra arguments are rejected. An interactive terminal is required, and exiting the harness closes a session started by that invocation. Harnesses must already be installed and authenticated, except for existing sandbox fx setup. Codex/Claude receive a prompt to read the bundled d3k skill and reuse the runtime; fx receives a temporary skill context through `--add-dir` (its interactive CLI has no startup prompt). No project instruction files are overwritten. Local harnesses use local credentials; sandbox fx can use the temporary team Gateway key. `--resume <id>` remembers the harness choice.
|
|
53
|
+
|
|
54
|
+
Sandbox Chrome and its children run under macOS filesystem confinement. Do not bypass it or substitute an unrestricted browser. The outer policy replaces Chrome's inner sandbox because macOS cannot nest them. Only Chrome, required system files, and the dedicated profile and temporary files are readable; unrelated laptop files are denied. The profile uses a local password store rather than the laptop keychain. Browser sessions remain accessible to sandbox automation. Other platforms fail closed until equivalent isolation is available.
|
package/dist/commands/crawl.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* d3k crawl - Discover URLs by crawling the app
|
|
3
|
-
*
|
|
4
|
-
* Uses agent-browser to navigate the app and discover all linked pages.
|
|
5
|
-
* Outputs a list of discovered URLs.
|
|
6
|
-
*/
|
|
7
|
-
export interface CrawlOptions {
|
|
8
|
-
depth?: string;
|
|
9
|
-
limit?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function crawlApp(options: CrawlOptions): Promise<void>;
|
|
12
|
-
//# sourceMappingURL=crawl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crawl.d.ts","sourceRoot":"","sources":["../../src/commands/crawl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAmBD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAqFnE"}
|