slapify 0.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.
@@ -0,0 +1,362 @@
1
+ import { execSync } from "child_process";
2
+ // Transient errors that should trigger automatic retry
3
+ const TRANSIENT_ERRORS = [
4
+ "Execution context was destroyed",
5
+ "Target closed",
6
+ "Navigation interrupted",
7
+ "Protocol error",
8
+ "Session closed",
9
+ "Page crashed",
10
+ "Frame was detached",
11
+ "Cannot find context",
12
+ ];
13
+ /**
14
+ * Wrapper around agent-browser CLI
15
+ */
16
+ export class BrowserAgent {
17
+ config;
18
+ isOpen = false;
19
+ constructor(config = {}) {
20
+ this.config = {
21
+ headless: true,
22
+ timeout: 30000,
23
+ viewport: { width: 1280, height: 720 },
24
+ ...config,
25
+ };
26
+ }
27
+ /**
28
+ * Check if an error is transient and should be retried
29
+ */
30
+ isTransientError(errorMessage) {
31
+ return TRANSIENT_ERRORS.some((e) => errorMessage.toLowerCase().includes(e.toLowerCase()));
32
+ }
33
+ /**
34
+ * Sleep for a given number of milliseconds
35
+ */
36
+ sleep(ms) {
37
+ execSync(`sleep ${ms / 1000}`);
38
+ }
39
+ /**
40
+ * Execute an agent-browser command with auto-retry for transient errors
41
+ */
42
+ exec(command, args = [], retries = 2) {
43
+ const fullCommand = ["agent-browser", command, ...args].join(" ");
44
+ // Set up environment with executable path if configured
45
+ const env = { ...process.env };
46
+ if (this.config.executablePath) {
47
+ env.AGENT_BROWSER_EXECUTABLE_PATH = this.config.executablePath;
48
+ }
49
+ let lastError = null;
50
+ for (let attempt = 0; attempt <= retries; attempt++) {
51
+ try {
52
+ const result = execSync(fullCommand, {
53
+ encoding: "utf-8",
54
+ timeout: this.config.timeout,
55
+ stdio: ["pipe", "pipe", "pipe"],
56
+ env,
57
+ });
58
+ return result.trim();
59
+ }
60
+ catch (error) {
61
+ const errorMsg = error.message || error.stderr?.toString() || "";
62
+ // If we have stdout, return it (some commands output to stdout even on "error")
63
+ if (error.stdout) {
64
+ const stdout = error.stdout.toString().trim();
65
+ // Check if stdout contains an actual error message
66
+ if (!this.isTransientError(stdout)) {
67
+ return stdout;
68
+ }
69
+ }
70
+ // Check if this is a transient error worth retrying
71
+ if (this.isTransientError(errorMsg) && attempt < retries) {
72
+ // Wait before retry (with exponential backoff)
73
+ this.sleep(500 * (attempt + 1));
74
+ continue;
75
+ }
76
+ lastError = new Error(`Browser command failed: ${fullCommand}\n${errorMsg}`);
77
+ }
78
+ }
79
+ throw lastError || new Error(`Browser command failed: ${fullCommand}`);
80
+ }
81
+ /**
82
+ * Check if agent-browser is installed
83
+ */
84
+ static isInstalled() {
85
+ try {
86
+ execSync("agent-browser --version", { stdio: "pipe" });
87
+ return true;
88
+ }
89
+ catch {
90
+ return false;
91
+ }
92
+ }
93
+ /**
94
+ * Install agent-browser and its browser
95
+ */
96
+ static install() {
97
+ console.log("Installing agent-browser...");
98
+ execSync("npm install -g agent-browser", { stdio: "inherit" });
99
+ console.log("Installing browser...");
100
+ execSync("agent-browser install", { stdio: "inherit" });
101
+ }
102
+ /**
103
+ * Navigate to a URL
104
+ */
105
+ async navigate(url) {
106
+ const args = [];
107
+ if (this.config.headless === false) {
108
+ args.push("--headed");
109
+ }
110
+ // Use custom executable path if specified
111
+ if (this.config.executablePath) {
112
+ args.push("--executable-path", `"${this.config.executablePath}"`);
113
+ }
114
+ this.exec("open", [url, ...args]);
115
+ this.isOpen = true;
116
+ // Set viewport if specified
117
+ if (this.config.viewport) {
118
+ this.exec("set", [
119
+ "viewport",
120
+ String(this.config.viewport.width),
121
+ String(this.config.viewport.height),
122
+ ]);
123
+ }
124
+ }
125
+ /**
126
+ * Get page snapshot (accessibility tree)
127
+ */
128
+ async snapshot(interactive = true) {
129
+ const args = interactive ? ["-i"] : [];
130
+ return this.exec("snapshot", args);
131
+ }
132
+ /**
133
+ * Get page snapshot as JSON with refs
134
+ */
135
+ async snapshotJson() {
136
+ const result = this.exec("snapshot", ["-i", "--json"]);
137
+ try {
138
+ const parsed = JSON.parse(result);
139
+ return {
140
+ snapshot: parsed.data?.snapshot || result,
141
+ refs: parsed.data?.refs || {},
142
+ };
143
+ }
144
+ catch {
145
+ return { snapshot: result, refs: {} };
146
+ }
147
+ }
148
+ /**
149
+ * Click an element by ref or selector
150
+ */
151
+ async click(selector) {
152
+ this.exec("click", [selector]);
153
+ }
154
+ /**
155
+ * Fill an input field
156
+ */
157
+ async fill(selector, value) {
158
+ this.exec("fill", [selector, `"${value}"`]);
159
+ }
160
+ /**
161
+ * Type text (appends to existing value)
162
+ */
163
+ async type(selector, value) {
164
+ this.exec("type", [selector, `"${value}"`]);
165
+ }
166
+ /**
167
+ * Press a key
168
+ */
169
+ async press(key) {
170
+ this.exec("press", [key]);
171
+ }
172
+ /**
173
+ * Hover over an element
174
+ */
175
+ async hover(selector) {
176
+ this.exec("hover", [selector]);
177
+ }
178
+ /**
179
+ * Select dropdown option
180
+ */
181
+ async select(selector, value) {
182
+ this.exec("select", [selector, value]);
183
+ }
184
+ /**
185
+ * Scroll the page
186
+ */
187
+ async scroll(direction, amount) {
188
+ const args = amount ? [direction, String(amount)] : [direction];
189
+ this.exec("scroll", args);
190
+ }
191
+ /**
192
+ * Wait for various conditions
193
+ */
194
+ async wait(condition) {
195
+ if (typeof condition === "number") {
196
+ this.exec("wait", [String(condition)]);
197
+ }
198
+ else if (condition.startsWith("text=")) {
199
+ this.exec("wait", ["--text", `"${condition.substring(5)}"`]);
200
+ }
201
+ else if (condition.startsWith("url=")) {
202
+ this.exec("wait", ["--url", `"${condition.substring(4)}"`]);
203
+ }
204
+ else {
205
+ this.exec("wait", [condition]);
206
+ }
207
+ }
208
+ /**
209
+ * Take a screenshot
210
+ */
211
+ async screenshot(path, fullPage = false) {
212
+ const args = [];
213
+ if (path)
214
+ args.push(path);
215
+ if (fullPage)
216
+ args.push("--full");
217
+ return this.exec("screenshot", args);
218
+ }
219
+ /**
220
+ * Get text content of an element
221
+ */
222
+ async getText(selector) {
223
+ return this.exec("get", ["text", selector]);
224
+ }
225
+ /**
226
+ * Get current URL
227
+ */
228
+ async getUrl() {
229
+ return this.exec("get", ["url"]);
230
+ }
231
+ /**
232
+ * Get page title
233
+ */
234
+ async getTitle() {
235
+ return this.exec("get", ["title"]);
236
+ }
237
+ /**
238
+ * Check if element is visible
239
+ */
240
+ async isVisible(selector) {
241
+ const result = this.exec("is", ["visible", selector]);
242
+ return result.toLowerCase().includes("true");
243
+ }
244
+ /**
245
+ * Execute JavaScript
246
+ */
247
+ async evaluate(script) {
248
+ return this.exec("eval", [`"${script.replace(/"/g, '\\"')}"`]);
249
+ }
250
+ /**
251
+ * Set cookies
252
+ */
253
+ async setCookie(name, value) {
254
+ this.exec("cookies", ["set", name, value]);
255
+ }
256
+ /**
257
+ * Set localStorage value
258
+ */
259
+ async setLocalStorage(key, value) {
260
+ this.exec("storage", ["local", "set", key, `"${value}"`]);
261
+ }
262
+ /**
263
+ * Set sessionStorage value
264
+ */
265
+ async setSessionStorage(key, value) {
266
+ this.exec("storage", ["session", "set", key, `"${value}"`]);
267
+ }
268
+ /**
269
+ * Go back
270
+ */
271
+ async goBack() {
272
+ this.exec("back", []);
273
+ }
274
+ /**
275
+ * Go forward
276
+ */
277
+ async goForward() {
278
+ this.exec("forward", []);
279
+ }
280
+ /**
281
+ * Reload page
282
+ */
283
+ async reload() {
284
+ this.exec("reload", []);
285
+ }
286
+ /**
287
+ * Close the browser
288
+ */
289
+ async close() {
290
+ if (this.isOpen) {
291
+ try {
292
+ this.exec("close", []);
293
+ }
294
+ catch {
295
+ // Ignore close errors
296
+ }
297
+ this.isOpen = false;
298
+ }
299
+ }
300
+ /**
301
+ * Get current browser state (with graceful error handling)
302
+ */
303
+ async getState() {
304
+ // Get each piece of state individually, with fallbacks
305
+ let url = "";
306
+ let title = "";
307
+ let snapshotData = { snapshot: "", refs: {} };
308
+ try {
309
+ url = await this.getUrl();
310
+ }
311
+ catch {
312
+ url = "unknown";
313
+ }
314
+ try {
315
+ title = await this.getTitle();
316
+ }
317
+ catch {
318
+ title = "";
319
+ }
320
+ try {
321
+ snapshotData = await this.snapshotJson();
322
+ }
323
+ catch {
324
+ // Try plain snapshot as fallback
325
+ try {
326
+ const plainSnapshot = await this.snapshot();
327
+ snapshotData = { snapshot: plainSnapshot, refs: {} };
328
+ }
329
+ catch {
330
+ snapshotData = { snapshot: "Unable to get page snapshot", refs: {} };
331
+ }
332
+ }
333
+ return {
334
+ url,
335
+ title,
336
+ snapshot: snapshotData.snapshot,
337
+ refs: snapshotData.refs,
338
+ };
339
+ }
340
+ /**
341
+ * Wait for page to be stable (no navigation in progress)
342
+ */
343
+ async waitForStable(timeout = 2000) {
344
+ const startTime = Date.now();
345
+ let lastUrl = "";
346
+ while (Date.now() - startTime < timeout) {
347
+ try {
348
+ const currentUrl = await this.getUrl();
349
+ if (currentUrl === lastUrl && currentUrl !== "about:blank") {
350
+ // URL hasn't changed, page is likely stable
351
+ return;
352
+ }
353
+ lastUrl = currentUrl;
354
+ }
355
+ catch {
356
+ // Ignore errors during stability check
357
+ }
358
+ this.sleep(200);
359
+ }
360
+ }
361
+ }
362
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/browser/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,MAAM,eAAe,CAAC;AAG9D,uDAAuD;AACvD,MAAM,gBAAgB,GAAG;IACvB,iCAAiC;IACjC,eAAe;IACf,wBAAwB;IACxB,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,oBAAoB;IACpB,qBAAqB;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,YAAY;IACf,MAAM,CAAgB;IACtB,MAAM,GAAY,KAAK,CAAC;IAEhC,YAAY,SAAwB,EAAE;QACpC,IAAI,CAAC,MAAM,GAAG;YACZ,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,EAAE,KAAK,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;YACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}