agentic-browser 2.0.1 → 2.1.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/README.md CHANGED
@@ -132,7 +132,7 @@ agentic-browser agent elements --roles button,link,input --visible-only --limit
132
132
  agentic-browser agent elements --selector "#main-content"
133
133
  ```
134
134
 
135
- Returns a JSON array of elements with CSS selectors and fallback selectors usable in the typed agent commands like `agent click`, `agent type`, and `agent select`:
135
+ Returns a JSON array of elements with selectors and fallback selectors usable in the typed agent commands like `agent click`, `agent type`, and `agent select`:
136
136
 
137
137
  ```json
138
138
  {
@@ -154,6 +154,8 @@ Returns a JSON array of elements with CSS selectors and fallback selectors usabl
154
154
 
155
155
  MCP responses are compact — `visible`, `actions`, and `tagName` are omitted to reduce token usage, and `enabled` is omitted when it is `true`. Responses also include a `summary` block with `countsByRole` and `primaryActions` so an LLM can identify the main controls faster. The full element shape is available via the programmatic API.
156
156
 
157
+ When an element lives inside an open shadow root or a same-origin iframe, discovery returns a composed locator using `>>>` to cross boundaries, for example `iframe[name="checkout"] >>> button[aria-label="Pay"]`. The same locator string works with `agent click`, `agent type`, MCP `browser_interact`, and fallback selectors.
158
+
157
159
  ````
158
160
 
159
161
  ## MCP Server
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { r as createCliRuntime } from "../runtime-DUSoQl5x.mjs";
2
+ import { r as createCliRuntime } from "../runtime-CEvs2yzE.mjs";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import crypto from "node:crypto";
6
6
  import { Command } from "commander";
7
-
8
7
  //#region src/cli/commands/agent.ts
9
8
  const STATE_FILE_NAME = "agent-state.json";
10
9
  function stateFilePath(runtime) {
@@ -184,7 +183,6 @@ async function agentCleanup(runtime, input) {
184
183
  ...runtime.api.cleanupSessions(input)
185
184
  };
186
185
  }
187
-
188
186
  //#endregion
189
187
  //#region src/cli/output/result-formatter.ts
190
188
  function formatResult(resultStatus, message) {
@@ -193,7 +191,6 @@ function formatResult(resultStatus, message) {
193
191
  message
194
192
  };
195
193
  }
196
-
197
194
  //#endregion
198
195
  //#region src/cli/commands/session-start.ts
199
196
  async function runSessionStart(runtime, input) {
@@ -203,32 +200,27 @@ async function runSessionStart(runtime, input) {
203
200
  sessionId: session.sessionId
204
201
  };
205
202
  }
206
-
207
203
  //#endregion
208
204
  //#region src/cli/commands/session-status.ts
209
205
  async function runSessionStatus(runtime, input) {
210
206
  return runtime.api.getSession(input.sessionId);
211
207
  }
212
-
213
208
  //#endregion
214
209
  //#region src/cli/commands/session-stop.ts
215
210
  async function runSessionStop(runtime, input) {
216
211
  await runtime.api.terminateSession(input.sessionId);
217
212
  return { terminated: true };
218
213
  }
219
-
220
214
  //#endregion
221
215
  //#region src/cli/commands/session-cleanup.ts
222
216
  async function runSessionCleanup(runtime, input) {
223
217
  return runtime.api.cleanupSessions(input);
224
218
  }
225
-
226
219
  //#endregion
227
220
  //#region src/cli/commands/session-restart.ts
228
221
  async function runSessionRestart(runtime, input) {
229
222
  return await runtime.api.restartSession(input.sessionId);
230
223
  }
231
-
232
224
  //#endregion
233
225
  //#region src/cli/commands/session-auth.ts
234
226
  async function runSessionAuth(runtime, input) {
@@ -238,7 +230,6 @@ async function runSessionAuth(runtime, input) {
238
230
  valid: runtime.context.tokenService.validate(input.sessionId, token)
239
231
  };
240
232
  }
241
-
242
233
  //#endregion
243
234
  //#region src/cli/commands/command-run.ts
244
235
  async function runCommand(runtime, input) {
@@ -253,7 +244,6 @@ async function runCommand(runtime, input) {
253
244
  throw new Error(`Command rejected: ${error.message}`);
254
245
  }
255
246
  }
256
-
257
247
  //#endregion
258
248
  //#region src/cli/commands/page-content.ts
259
249
  async function runPageContent(runtime, input) {
@@ -262,34 +252,29 @@ async function runPageContent(runtime, input) {
262
252
  selector: input.selector
263
253
  });
264
254
  }
265
-
266
255
  //#endregion
267
256
  //#region src/cli/commands/memory-search.ts
268
257
  async function runMemorySearch(runtime, input) {
269
258
  if (!input.taskIntent || !input.taskIntent.trim()) throw new Error("taskIntent is required");
270
259
  return runtime.api.searchMemory(input);
271
260
  }
272
-
273
261
  //#endregion
274
262
  //#region src/cli/commands/memory-inspect.ts
275
263
  async function runMemoryInspect(runtime, input) {
276
264
  if (!input.insightId || !input.insightId.trim()) throw new Error("insightId is required");
277
265
  return runtime.api.inspectMemory(input.insightId);
278
266
  }
279
-
280
267
  //#endregion
281
268
  //#region src/cli/commands/memory-verify.ts
282
269
  async function runMemoryVerify(runtime, input) {
283
270
  if (!input.insightId || !input.insightId.trim()) throw new Error("insightId is required");
284
271
  return runtime.api.verifyMemory(input.insightId);
285
272
  }
286
-
287
273
  //#endregion
288
274
  //#region src/cli/commands/memory-stats.ts
289
275
  async function runMemoryStats(runtime) {
290
276
  return runtime.api.memoryStats();
291
277
  }
292
-
293
278
  //#endregion
294
279
  //#region src/cli/index.ts
295
280
  async function main() {
@@ -520,7 +505,7 @@ async function main() {
520
505
  await startMcpServer();
521
506
  });
522
507
  program.command("setup").description("Configure agentic-browser as MCP server for your AI tool").action(async () => {
523
- const { runSetup } = await import("../setup-COK-KCfv.mjs");
508
+ const { runSetup } = await import("../setup-BP0YyerC.mjs");
524
509
  await runSetup();
525
510
  });
526
511
  await program.parseAsync(process.argv);
@@ -533,6 +518,5 @@ main().then((keepAlive) => {
533
518
  console.error(JSON.stringify({ error: message }));
534
519
  process.exit(1);
535
520
  });
536
-
537
521
  //#endregion
538
- export { };
522
+ export {};
package/dist/index.mjs CHANGED
@@ -1,4 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { i as createMockAgenticBrowserCore, n as createAgenticBrowserCore, t as AgenticBrowserCore } from "./runtime-DUSoQl5x.mjs";
3
-
4
- export { AgenticBrowserCore, createAgenticBrowserCore, createMockAgenticBrowserCore };
2
+ import { i as createMockAgenticBrowserCore, n as createAgenticBrowserCore, t as AgenticBrowserCore } from "./runtime-CEvs2yzE.mjs";
3
+ export { AgenticBrowserCore, createAgenticBrowserCore, createMockAgenticBrowserCore };
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { n as createAgenticBrowserCore } from "../runtime-DUSoQl5x.mjs";
2
+ import { n as createAgenticBrowserCore } from "../runtime-CEvs2yzE.mjs";
3
3
  import { z } from "zod";
4
4
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
-
7
6
  //#region src/mcp/response-helpers.ts
8
7
  function uniqueLines(content, maxLineLength = 160) {
9
8
  const seen = /* @__PURE__ */ new Set();
@@ -156,7 +155,6 @@ function compactMemoryResults(results) {
156
155
  return compact;
157
156
  }) };
158
157
  }
159
-
160
158
  //#endregion
161
159
  //#region src/mcp/index.ts
162
160
  let core;
@@ -379,6 +377,5 @@ async function main() {
379
377
  };
380
378
  await server.connect(transport);
381
379
  }
382
-
383
380
  //#endregion
384
- export { main };
381
+ export { main };