poltertab 1.7.0-beta.3 → 1.7.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
@@ -203,7 +203,8 @@ next use.
203
203
 
204
204
  One agent can drive many tabs. Each agent (and each secondary server) has its
205
205
  own **current tab**; page-facing tools without `tabId`/`session` act there. An
206
- explicit `tabId` acts on that tab without changing the current one. If the
206
+ explicit `tabId` acts on that tab without changing the current one; a `tabId`
207
+ Chrome does not have returns `tab_not_found` on any tool that takes one. If the
207
208
  current tab is closed, untargeted calls fail with a message naming the closed
208
209
  tab instead of quietly acting on another one.
209
210
 
@@ -211,7 +212,7 @@ tab instead of quietly acting on another one.
211
212
  | -------- | ----------- | ------------- |
212
213
  | `browser_tab_new` | `url`, `session`, `background` | Open a tab and make it current |
213
214
  | `browser_tab_list` | `all` | PolterTab's tabs (or every tab), marking the current one |
214
- | `browser_tab_switch` | `tabId` or `session`, `focus` | Make another tab current |
215
+ | `browser_tab_switch` | `tabId` or `session`, `focus` | Make another tab current. A tab that does not exist in Chrome returns `tab_not_found`. |
215
216
  | `browser_tab_close` | `tabId` or `session`, `force` | Close a tab (default: current). Tabs not opened by PolterTab (including ones adopted via `browser_session_create({tabId})`) return `needs_user_permission` — ask the user, then retry with `force: true`. A tab that does not exist in Chrome returns `tab_not_found`. |
216
217
 
217
218
  ### Site memory
@@ -359,7 +359,15 @@ function setupPrimaryWss(wss) {
359
359
  }, COMMAND_TIMEOUT_MS);
360
360
 
361
361
  pendingCommands.set(id, { isProxy: true, sourceWs: ws, timer });
362
- extensionSocket.send(JSON.stringify({ id, action, ...params }));
362
+ // Same envelope construction as the direct path, so a tool argument
363
+ // named id or action cannot override the routing here either. The
364
+ // Primary's own id is kept last: pendingCommands is keyed on it.
365
+ extensionSocket.send(
366
+ JSON.stringify({
367
+ ..._buildEnvelope(action, msg.params, ws.nodeId),
368
+ id,
369
+ }),
370
+ );
363
371
  return;
364
372
  }
365
373
 
@@ -11,7 +11,7 @@ const TARGET = {
11
11
  tabId: {
12
12
  type: "number",
13
13
  description:
14
- "Act on this tab (an id from browser_tab_list) without making it current. Omit to use this agent's current tab: the last one navigated, opened or switched to.",
14
+ "Act on this tab (an id from browser_tab_list) without making it current. Omit to use this agent's current tab: the last one navigated, opened or switched to. A tabId Chrome does not have returns tab_not_found.",
15
15
  },
16
16
  session: {
17
17
  type: "string",
@@ -498,7 +498,11 @@ const BROWSER_TOOLS = [
498
498
  inputSchema: {
499
499
  type: "object",
500
500
  properties: {
501
- tabId: { type: "number" },
501
+ tabId: {
502
+ type: "number",
503
+ description:
504
+ "Tab to switch to; a tabId Chrome does not have returns tab_not_found",
505
+ },
502
506
  session: { type: "string" },
503
507
  focus: {
504
508
  type: "boolean",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poltertab",
3
- "version": "1.7.0-beta.3",
3
+ "version": "1.7.0",
4
4
  "description": "Let any AI assistant drive and scrape your existing Chrome profile — no headless browser, no complex setup.",
5
5
  "bin": {
6
6
  "poltertab": "./bin/poltertab.js"
@@ -204,7 +204,9 @@ commandeer the tab the user is looking at — and later calls reuse it.
204
204
  For several tabs: `browser_tab_new` opens one and makes it current,
205
205
  `browser_tab_list` shows them with their ids, `browser_tab_switch` changes the
206
206
  current one, and `browser_tab_close` closes one. Pass `tabId` to act on a tab
207
- once without switching to it, or name tabs with `session` and pass that. If a
207
+ once without switching to it — a `tabId` Chrome does not have returns
208
+ `tab_not_found` on any tool that takes one — or name tabs with `session` and
209
+ pass that. If a
208
210
  call says your tab was closed, list and switch — do not assume another tab is
209
211
  the same page. Close what you opened.
210
212