iframer-cli 2.0.0 → 2.0.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.
Files changed (2) hide show
  1. package/mcp-server.cjs +31 -11
  2. package/package.json +1 -1
package/mcp-server.cjs CHANGED
@@ -28429,7 +28429,22 @@ async function apiDelete(endpoint) {
28429
28429
  function err(message) {
28430
28430
  return { content: [{ type: "text", text: message }], isError: true };
28431
28431
  }
28432
- var INSTRUCTIONS = `iframer — browser access for AI agents when normal methods fail.
28432
+ var IS_DEV = !!process.env.IFRAMER_URL;
28433
+ var INSTRUCTIONS = IS_DEV ? `iframer-dev — local development instance of iframer (connects to ${process.env.IFRAMER_URL}).
28434
+
28435
+ This is the LOCAL dev server running in Docker on localhost. Use this MCP when developing or testing iframer itself.
28436
+
28437
+ IMPORTANT: This connects to the local Docker container, NOT to api.iframer.sh. The browser session runs inside Docker with a virtual display (noVNC available at http://localhost:6080).
28438
+
28439
+ WORKFLOW:
28440
+ 1. Use "execute" with a pipeline of steps — the session starts automatically inside Docker
28441
+ 2. iframer handles obstacles (captcha, cookie banners) automatically
28442
+ 3. If execute fails, read the error — it tells you exactly what went wrong and where
28443
+ 4. Call "session" action=stop when done to save session state
28444
+
28445
+ TIMEOUTS: Each step has a 20-second stale-state timeout. If nothing changes for 20s, iframer aborts with a detailed error.
28446
+
28447
+ CREDENTIALS: Use "credentials" action=store to save login details encrypted server-side.` : `iframer — browser access for AI agents when normal methods fail.
28433
28448
 
28434
28449
  PHILOSOPHY: You are a capable agent. Do your work locally first. Only call iframer when you hit a wall: captcha, login-gated content, heavy bot detection, or content that requires a real browser to render. iframer is a swiss knife you pull out for hard problems, not your default browsing tool.
28435
28450
 
@@ -28513,6 +28528,7 @@ var stepSchema = exports_external.discriminatedUnion("type", [
28513
28528
  exports_external.object({ type: exports_external.literal("click"), selector: exports_external.string() }),
28514
28529
  exports_external.object({ type: exports_external.literal("fill"), selector: exports_external.string(), value: exports_external.string() }),
28515
28530
  exports_external.object({ type: exports_external.literal("human-click"), selector: exports_external.string().optional(), x: exports_external.number().optional(), y: exports_external.number().optional() }),
28531
+ exports_external.object({ type: exports_external.literal("right-click"), selector: exports_external.string().optional(), x: exports_external.number().optional(), y: exports_external.number().optional() }),
28516
28532
  exports_external.object({ type: exports_external.literal("human-type"), selector: exports_external.string(), value: exports_external.string() }),
28517
28533
  exports_external.object({ type: exports_external.literal("evaluate"), expression: exports_external.string() }),
28518
28534
  exports_external.object({ type: exports_external.literal("extract"), expression: exports_external.string() }),
@@ -28583,16 +28599,20 @@ Obstacles handled:`);
28583
28599
  if (data.error) {
28584
28600
  lines.push(`
28585
28601
  --- Failure ---`);
28586
- lines.push(`Failed at step ${data.error.failedAtStep}: ${JSON.stringify(data.error.failedStep)}`);
28587
- lines.push(`Error type: ${data.error.errorType}`);
28588
- lines.push(`Message: ${data.error.message}`);
28589
- lines.push(`Retryable: ${data.error.retryable}`);
28590
- if (data.error.suggestion)
28591
- lines.push(`Suggestion: ${data.error.suggestion}`);
28592
- if (data.error.pageState?.screenshotUrl)
28593
- lines.push(`Screenshot at failure: ${data.error.pageState.screenshotUrl}`);
28594
- if (data.error.pageState?.url)
28595
- lines.push(`URL at failure: ${data.error.pageState.url}`);
28602
+ if (typeof data.error === "string") {
28603
+ lines.push(`Error: ${data.error}`);
28604
+ } else {
28605
+ lines.push(`Failed at step ${data.error.failedAtStep}: ${JSON.stringify(data.error.failedStep)}`);
28606
+ lines.push(`Error type: ${data.error.errorType}`);
28607
+ lines.push(`Message: ${data.error.message}`);
28608
+ lines.push(`Retryable: ${data.error.retryable}`);
28609
+ if (data.error.suggestion)
28610
+ lines.push(`Suggestion: ${data.error.suggestion}`);
28611
+ if (data.error.pageState?.screenshotUrl)
28612
+ lines.push(`Screenshot at failure: ${data.error.pageState.screenshotUrl}`);
28613
+ if (data.error.pageState?.url)
28614
+ lines.push(`URL at failure: ${data.error.pageState.url}`);
28615
+ }
28596
28616
  }
28597
28617
  return { content: [{ type: "text", text: lines.join(`
28598
28618
  `) }] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iframer-cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "CLI for iframer — browser access for AI agents",
5
5
  "bin": {
6
6
  "iframer": "./cli.js"