# fsb

Adopt this skill: https://proskills.md/skills/other/fullselfbrowsing-fsb-skills-fsb

Page: https://proskills.md/skills/other/fullselfbrowsing-fsb-skills-fsb
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/fsb/SKILL.md
size: 7226
sha: a7da1622e48107c8dbf94cd601a833a50f4cdfcb
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/SKILL.md

```text
---
name: fsb
description: FSB drives the user's Chrome via the FSB extension and an MCP bridge for live web tasks.
version: 0.9.95
user-invocable: true
requires:
  bins: [node, npx]
  env: []
homepage: https://full-selfbrowsing.com
platforms: [macos, linux, windows]
metadata:
  openclaw: {"install":[{"kind":"node","package":"fsb-mcp-server","bins":["fsb-mcp-server"],"label":"Install FSB MCP server (npm)"}]}
  hermes:
    mcp_servers:
      fsb:
        command: "npx"
        args: ["-y", "fsb-mcp-server@latest"]
---

# FSB

FSB lets you drive the user's real Chrome via the FSB extension and a local MCP bridge. Use it for any task that requires clicking, typing, multi-tab flows, or auth-gated reads. Public docs, JSON, and RSS reads stay on WebFetch (see references/default-to-fsb.md). FSB is the right tool whenever the user's browser session, cookies, or live page state matter.

## When to use FSB

- If a request mentions a real website, prefer FSB tools when one fits.
- ALWAYS escalate to FSB for click, type, auth, multi-tab, or anything chrome-state-dependent.
- ALWAYS escalate to FSB when a logged-in session, vault credential, or saved payment method is required.
- ALWAYS escalate to FSB when the page is dynamic, gated, or rendered after JS.
- Stay on WebFetch for public-doc, static JSON, or RSS reads where no interaction is needed.
- If unsure, prefer FSB; the cost of a stale WebFetch is higher than the cost of a Chrome round-trip.

## Sensitive actions and logged-in context

FSB drives the user's real Chrome, so every action runs inside whatever sessions, cookies, and saved auth that browser already holds. Before the final click or `invoke_capability` call that submits a purchase, payment, account change (password update, data deletion, permission grant, settings write), or public post (tweet, comment, DM, issue, PR), pause and ask the user to confirm in chat -- state the action, the target site, and any amount or recipient, then wait for an explicit yes. Vault-backed fills (`fill_credential`, `use_payment_method`) are allowed during preparation; only the final submission is gated. Read-only inspection (`read_page`, `get_dom_snapshot`, `get_text`) does not require confirmation.

## Doctor-first protocol

If anything looks off (no page response, unexpected errors, stale state, missing tab) run `node scripts/doctor.mjs` (which wraps `npx -y fsb-mcp-server@latest doctor`) BEFORE retrying the same call. Read the layered output, fix the failing layer, then resume. Do not loop on the same failing call hoping it self-heals.

## v0.9.62 visual-session contract

As of fsb-mcp-server v0.9.0 (FSB milestone v0.9.62) the visual session is IMPLICIT. Every MCP action tool call carries a required field bundle:

- `visual_reason` (required string) -- short human-readable reason shown in the overlay.
- `client` (required, allowlisted) -- badge label such as `OpenClaw`, `Claude`, `Codex`. Freeform strings reject with `BADGE_NOT_ALLOWED`.
- `is_final` (optional boolean) -- set `true` on the LAST action of a task to clear the overlay immediately.

The first action call brings up the overlay; each subsequent action call re-arms a 60-second sliding window; `is_final: true` clears immediately; 60 seconds of silence auto-clears. No `start_visual_session` / `end_visual_session` calls are needed -- those tools were removed in v0.9.0 and are no longer registered. Read-only tools (`read_page`, `get_dom_snapshot`, `list_tabs`, ...) do NOT carry the bundle and do NOT re-arm the sliding window. If the first action call hits `NO_OWNED_TAB`, call `open_tab({ url, active: false })` first, then retry. Lifecycle details, the read-tool vs action-tool split, and the typed-error catalogue live in `references/visual-session-lifecycle.md`.

The canonical 36-tool action list, the 15-tool read-only list, and the typed-error names (`VISUAL_FIELDS_REQUIRED`, `BADGE_NOT_ALLOWED`) are pinned in `.planning/v0.9.62-CONTRACT.md` -- that artifact is the single source of truth. Use it to answer "does this tool require the field bundle?" by lookup; do not re-derive the lists from memory.

On Hermes: as of fsb-mcp-server v0.9.2 / FSB v0.9.69 (PR #49), the badge label `Hermes` is on the v0.9.36 shared client allowlist, so action calls passing `client: "Hermes"` accept normally. The field bundle (`visual_reason`, `client`, optional `is_final`) works identically; no Hermes-specific schema fork exists.

## Multi-agent contract

Never pass `agent_id` (the server mints it). Use `go_back` instead of `execute_js("history.back()")`. Each agent owns its own tabs; do not foreground or close tabs you do not own, and do not introduce a global browser lock -- per-agent ownership is the only concurrency mechanism. Typed errors (`NO_OWNED_TAB`, `AMBIGUOUS_TAB`, `TAB_NOT_OWNED`, `AGENT_CAP_REACHED`, `TAB_INCOGNITO_NOT_SUPPORTED`, `TAB_OUT_OF_SCOPE`), the bootstrap recovery ladder, and the default recovery flow: see `references/multi-agent-contract.md`.

## Vault and credentials

Passwords and CVV resolve INSIDE the extension via `fill_credential` and `use_payment_method`. Never put secrets in chat, prompts, logs, or tool args. See `references/vault-boundary.md`.

## References (load on demand)

- `references/visual-session-lifecycle.md` -- v0.9.62 implicit contract: field bundle (visual_reason / client / is_final), sliding 60s window, is_final immediate clear, read-tool vs action-tool split, typed-error recovery.
- `references/tool-decision-tree.md` -- read_page vs get_dom_snapshot vs get_page_snapshot vs get_site_guide; when execute_js is first-class vs when typed tools are required; per-branch field-bundle reminders; verify after "no detectable effect" warnings.
- `references/multi-agent-contract.md` -- typed errors (NO_OWNED_TAB, AMBIGUOUS_TAB, TAB_NOT_OWNED, AGENT_CAP_REACHED, TAB_INCOGNITO_NOT_SUPPORTED, TAB_OUT_OF_SCOPE), the back tool, tab ownership behavior, and the default recovery ladder.
- `references/restricted-tab-recovery.md` -- chrome://, edge://, and web-store recovery tools.
- `references/vault-boundary.md` -- credential routing rules and forbidden patterns.
- `references/default-to-fsb.md` -- soft preference and hard escalation rule in full.
- `references/hermes-tool-prefix.md` -- on Hermes, imported MCP tools surface as `mcp_fsb_<tool>` (e.g., `mcp_fsb_click`). Naming-only convention; server side is unchanged.
- `references/v0.9.62-contract-mirror.md` -- mirror of the canonical 36 action / 15 read-only / 3 typed-error lists for Hub-installed users without repo access. Authoritative source is `.planning/v0.9.62-CONTRACT.md`.
- `.planning/v0.9.62-CONTRACT.md` (repo) -- canonical 36 action tools, 15 read-only tools, three typed-error names; single source of truth for the v0.9.62 contract.

## Scripts (run as needed)

- `scripts/doctor.mjs` -- diagnose the failing layer; prints [OK], [FAIL], and [WARN] markers per layer.
- `scripts/print-stdio.mjs` -- print the OpenClaw stdio config block to paste into your MCP config.
- `scripts/install-host.mjs` -- detect other MCP hosts on the machine; confirmation-based per-host install.
- `scripts/print-hermes-yaml.mjs` -- print the Hermes mcp_servers config block to paste into `~/.hermes/config.yaml`.
```

## File: skills/fsb/references/README.md
size: 409
sha: f697f20cc3dc52e2ab0899e907d89fd858511830
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/README.md

```text
# references/ -- placeholder

Status: scaffolded by Phase 248. Reference files are filled in Phase 250.

Phase 250 adds: tool-decision-tree.md, multi-agent-contract.md, restricted-tab-recovery.md, default-to-fsb.md, vault-boundary.md, plus a visual-session lifecycle reference. SKILL.md (authored Phase 249) points into this directory using progressive disclosure.

ASCII only; no emojis. See repo CLAUDE.md.
```

## File: skills/fsb/scripts/README.md
size: 498
sha: 8857a1e63807bd7db4b224fb65675bba19e08807
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/scripts/README.md

```text
# scripts/ -- placeholder

Status: scaffolded by Phase 248. Script files are filled in Phase 249.

Phase 249 adds three Node `.mjs` scripts: doctor.mjs (wraps `npx -y fsb-mcp-server@latest doctor`), print-stdio.mjs (sources canonical OpenClaw stdio block from `mcp/src/install.ts` `getSetupSections()`), install-host.mjs (detect-list-confirm flow over `npx -y fsb-mcp-server@latest install --list`).

No `.sh` / `.cmd` siblings; cross-platform Node only. ASCII only; no emojis. See repo CLAUDE.md.
```

## File: skills/fsb/scripts/doctor.mjs
size: 5790
sha: ea551a8039b9e184af489b7840ff9e1aabc16a87
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/scripts/doctor.mjs

```text
#!/usr/bin/env node
// doctor.mjs -- FSB skill diagnostic dispatcher (SKILL-03 / SKILL-06)
// Wraps `npx -y fsb-mcp-server@latest doctor`, parses the failing layer,
// and prints a focused [OK]/[FAIL]/[WARN] branch with a one-line next step.
// Cross-platform: Node ESM only; no shell-specific assumptions.
//
// Exit code contract:
//   0 -- all six layers green ([OK])
//   1 -- a known layer failed ([FAIL])
//   2 -- could not launch the doctor at all (npx / Node missing)
//   3 -- doctor ran but its output was unparseable ([WARN])

import { spawn } from 'node:child_process';
import process from 'node:process';

// Most-fundamental first; first failing layer wins.
const LAYERS = ['package', 'bridge', 'extension', 'active-tab', 'content-script', 'config'];

const NEXT_STEPS = {
  package:        'Run `npx -y fsb-mcp-server@latest --version` to confirm npm can reach the package.',
  bridge:         'Start the FSB extension and run `npx -y fsb-mcp-server@latest status --watch` to confirm ws://localhost:7225 is reachable.',
  extension:      'Install the FSB Chrome extension from https://chromewebstore.google.com/detail/badgafnfchcihdfnjneklogedcdkmjfk -- then reopen this session.',
  'active-tab':   'Open a normal http(s) tab (not chrome://, edge://, or the Web Store) and run `npx -y fsb-mcp-server@latest status --watch` to re-attach.',
  'content-script': 'Reload the active tab. The FSB content script attaches on page load; reloads after extension install are required.',
  config:         'Re-run `npx -y fsb-mcp-server@latest install --<host>` for your MCP host (replace <host> with claude-desktop, cursor, etc.).',
  ok:             'All layers green. Run a small read_page or list_tabs call to confirm end-to-end.',
};

const FAILURE_MARKERS = [
  'fail',
  'error',
  'missing',
  'timeout',
  'not reachable',
  'not found',
  'not detected',
  'unreachable',
];

const FENCE = '--- FSB skill doctor summary ---';

function emitSummary(headerLines) {
  process.stdout.write('\n');
  process.stdout.write(FENCE + '\n');
  for (const line of headerLines) {
    process.stdout.write(line + '\n');
  }
}

function parseFailingLayer(buffer) {
  const lower = buffer.toLowerCase();
  const lines = lower.split(/\r?\n/);

  // Pass 0: prefer the doctor's own explicit `Layer: <name>` anchor when present.
  // This wins over substring heuristics so verbose bridge-subsystem log lines
  // (e.g., "[FSB Bridge ...] << Response: ... error=...") cannot fake a match.
  for (const line of lines) {
    const m = line.match(/(^|\s)layer:\s*([a-z\-]+)/);
    if (!m) continue;
    const value = m[2].trim();
    if (value === 'ok') return 'ok';
    if (LAYERS.includes(value)) return value;
  }

  // Pass 1: scan line-by-line for first layer keyword paired with a failure marker
  // on the same line. Skip noisy bridge-subsystem log lines that begin with
  // a "[fsb bridge" prefix -- those are runtime logs, not the layered diagnostic.
  for (const layer of LAYERS) {
    for (const line of lines) {
      if (line.startsWith('[fsb bridge')) continue;
      if (!line.includes(layer)) continue;
      for (const marker of FAILURE_MARKERS) {
        if (line.includes(marker)) {
          return layer;
        }
      }
    }
  }

  // Pass 2: detect "all green" / per-layer [OK] success state.
  if (lower.includes('all green')) {
    return 'ok';
  }

  // If every layer keyword appears with [ok] nearby on its line, treat as ok.
  let okHits = 0;
  for (const layer of LAYERS) {
    for (const line of lines) {
      if (line.includes(layer) && line.includes('[ok]')) {
        okHits += 1;
        break;
      }
    }
  }
  if (okHits === LAYERS.length) {
    return 'ok';
  }

  // Ambiguous -- caller emits [WARN].
  return null;
}

function main() {
  let combined = '';
  let launched = false;

  const child = spawn('npx', ['-y', 'fsb-mcp-server@latest', 'doctor'], {
    stdio: ['ignore', 'pipe', 'pipe'],
    shell: false,
  });

  child.on('error', (err) => {
    // ENOENT or similar -- could not launch the doctor at all.
    if (!launched) {
      process.stderr.write(`spawn error: ${err && err.message ? err.message : String(err)}\n`);
      emitSummary([
        '[FAIL] cannot launch `npx -y fsb-mcp-server@latest doctor` -- is Node 18+ installed and on PATH?',
        'next-step: Install Node 18+ (https://nodejs.org/en/download) and reopen the session.',
      ]);
      process.exit(2);
    }
  });

  child.stdout.on('data', (chunk) => {
    launched = true;
    const text = chunk.toString('utf8');
    combined += text;
    process.stdout.write(text);
  });

  child.stderr.on('data', (chunk) => {
    launched = true;
    const text = chunk.toString('utf8');
    combined += text;
    process.stderr.write(text);
  });

  child.on('close', (code) => {
    if (!launched) {
      // 'error' handler already emitted; just bail.
      return;
    }

    const failingLayer = parseFailingLayer(combined);

    if (failingLayer === 'ok') {
      emitSummary([
        '[OK] all six layers green',
        'next-step: ' + NEXT_STEPS.ok,
      ]);
      process.exit(0);
    } else if (failingLayer && LAYERS.includes(failingLayer)) {
      emitSummary([
        '[FAIL] failing layer: ' + failingLayer,
        'next-step: ' + NEXT_STEPS[failingLayer],
      ]);
      process.exit(1);
    } else {
      // Unparseable output. If the child exited non-zero we still surface [WARN]
      // so OpenClaw sees a structured branch, but the exit code marks ambiguity.
      void code;
      emitSummary([
        '[WARN] doctor output did not match a known layer pattern; raw output above',
        'next-step: re-run `npx -y fsb-mcp-server@latest doctor` and report this output if it persists.',
      ]);
      process.exit(3);
    }
  });
}

main();
```

## File: skills/fsb/scripts/install-host.mjs
size: 11844
sha: 8870b50f3ecb5597f13a3f5dc7796c081d0eb11a
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/scripts/install-host.mjs

```text
#!/usr/bin/env node
// install-host.mjs -- confirmation-based multi-host installer (SKILL-05 / SKILL-06)
// Detects other MCP hosts via `npx -y fsb-mcp-server@latest install --list`,
// prompts y/n per host, runs `npx -y fsb-mcp-server@latest install --<host>` only on explicit yes.
// NEVER passes --all. NEVER auto-writes OpenClaw's MCP config (use print-stdio.mjs).

import { spawn } from 'node:child_process';
import { createInterface } from 'node:readline';
import process from 'node:process';
import os from 'node:os';
import path from 'node:path';
import { existsSync, readFileSync, writeFileSync } from 'node:fs';

const NPX = 'npx';
const PKG = 'fsb-mcp-server@latest';
const MARKERS = ['detected', 'found', 'available', 'configured'];
const FILLER = new Set([
  'mcp', 'host', 'hosts', 'server', 'client', 'clients',
  'config', 'version', 'the', 'with', 'from', 'into', 'at', 'on'
]);
const HOST_NAME_RE = /^[a-z0-9-]+$/;

// Hermes Skills Hub branch (additive to the existing CLI-driven host loop).
// Mirrors the OpenClaw skip pattern -- detection is filesystem-based, install
// is fs.writeFileSync-based; we NEVER pass --hermes to the CLI (no such flag).
const HERMES_CONFIG_PATH = path.join(os.homedir(), '.hermes', 'config.yaml');
const HERMES_BLOCK = `mcp_servers:
  fsb:
    command: "npx"
    args: ["-y", "fsb-mcp-server@latest"]
`;
const HERMES_FSB_CHILD = `  fsb:
    command: "npx"
    args: ["-y", "fsb-mcp-server@latest"]
`;

// Detect the indent width used by direct children of `mcp_servers:`.
// Walks lines after the heading; the first line that starts with whitespace +
// an alphanumeric `key:` defines the indent unit. Returns 2 if none found
// before EOF or a column-0 line.
//
// Worked example -- input:
//   mcp_servers:
//       other:        <- 4-space indent
//         command: "x"
// Returns: 4
function detectMcpServersIndent(content) {
  const lines = content.split('\n');
  let headerIdx = -1;
  for (let i = 0; i < lines.length; i++) {
    if (/^mcp_servers:\s*(?:#.*)?$/.test(lines[i])) {
      headerIdx = i;
      break;
    }
  }
  if (headerIdx === -1) return 2;
  for (let i = headerIdx + 1; i < lines.length; i++) {
    const line = lines[i];
    // Column-0 non-whitespace = end of mcp_servers block
    if (line.length > 0 && !/^\s/.test(line)) return 2;
    const m = /^(\s+)[A-Za-z0-9_-]+:/.exec(line);
    if (m) return m[1].length;
  }
  return 2;
}

// Returns true only if `fsb:` exists as a DIRECT child of `mcp_servers:`
// (matches the detected indent exactly, not deeper). Scoped to the
// mcp_servers block; ends at first column-0 non-whitespace line or EOF.
function findFsbInMcpServers(content) {
  const lines = content.split('\n');
  let headerIdx = -1;
  for (let i = 0; i < lines.length; i++) {
    if (/^mcp_servers:\s*(?:#.*)?$/.test(lines[i])) {
      headerIdx = i;
      break;
    }
  }
  if (headerIdx === -1) return false;
  const indent = detectMcpServersIndent(content);
  const directChildRe = new RegExp('^' + ' '.repeat(indent) + 'fsb:\\s*$');
  for (let i = headerIdx + 1; i < lines.length; i++) {
    const line = lines[i];
    if (line.length > 0 && !/^\s/.test(line)) return false; // left the block
    if (directChildRe.test(line)) return true;
  }
  return false;
}

function runDetect() {
  return new Promise((resolve) => {
    let listOut = '';
    let launched = true;
    const child = spawn(NPX, ['-y', PKG, 'install', '--list'], {
      stdio: ['ignore', 'pipe', 'pipe'],
      shell: false
    });

    child.on('error', (err) => {
      launched = false;
      if (err && err.code === 'ENOENT') {
        process.stdout.write(
          '[FAIL] cannot launch `npx -y fsb-mcp-server@latest install --list` -- is Node 18+ on PATH?\n'
        );
        process.stdout.write(
          'next-step: Install Node 18+ (https://nodejs.org/en/download) and reopen the session.\n'
        );
        process.exit(2);
      }
      process.stdout.write('[FAIL] detect step error: ' + (err && err.message ? err.message : String(err)) + '\n');
      process.exit(2);
    });

    child.stdout.on('data', (chunk) => {
      const text = chunk.toString('utf8');
      listOut += text;
      process.stdout.write(text);
    });

    child.stderr.on('data', (chunk) => {
      process.stderr.write(chunk);
    });

    child.on('close', (code) => {
      if (!launched) return;
      resolve({ listOut, code: code == null ? 0 : code });
    });
  });
}

function parseHosts(listOut) {
  const seen = [];
  const lines = listOut.split('\n');
  for (const rawLine of lines) {
    const line = rawLine.toLowerCase();
    let hasMarker = false;
    for (const marker of MARKERS) {
      if (line.indexOf(marker) !== -1) {
        hasMarker = true;
        break;
      }
    }
    if (!hasMarker) continue;

    const tokenRe = /(?:^|\s|:)([a-z][a-z0-9-]+)(?=\s|$|[,.;:])/g;
    let m;
    while ((m = tokenRe.exec(line)) !== null) {
      const tok = m[1];
      if (FILLER.has(tok)) continue;
      if (MARKERS.indexOf(tok) !== -1) continue;
      if (tok === 'openclaw') continue;
      if (seen.indexOf(tok) === -1) seen.push(tok);
    }
  }
  return seen;
}

function ask(rl, prompt) {
  return new Promise((resolve) => {
    let settled = false;
    const finish = (value) => {
      if (settled) return;
      settled = true;
      resolve(value == null ? '' : value);
    };
    const onClose = () => finish('');
    rl.once('close', onClose);
    try {
      rl.question(prompt, (answer) => {
        rl.removeListener('close', onClose);
        finish(answer);
      });
    } catch (_err) {
      rl.removeListener('close', onClose);
      finish('');
    }
  });
}

function runInstallHost(host) {
  return new Promise((resolve) => {
    const flag = '--' + host;
    let launched = true;
    const child = spawn(NPX, ['-y', PKG, 'install', flag], {
      stdio: 'inherit',
      shell: false
    });

    child.on('error', (err) => {
      launched = false;
      process.stdout.write(
        '[FAIL] could not launch installer for ' + host + ': ' + (err && err.message ? err.message : String(err)) + '\n'
      );
      resolve({ ok: false, code: -1 });
    });

    child.on('close', (code) => {
      if (!launched) return;
      const exitCode = code == null ? 0 : code;
      resolve({ ok: exitCode === 0, code: exitCode });
    });
  });
}

async function maybeInstallHermes(rl, stdinClosed) {
  if (!existsSync(HERMES_CONFIG_PATH)) {
    process.stdout.write(
      '[WARN] no Hermes config detected at ~/.hermes/config.yaml -- skipping Hermes branch\n'
    );
    return { status: 'skipped' };
  }

  let existing = '';
  try {
    existing = readFileSync(HERMES_CONFIG_PATH, 'utf8');
  } catch (err) {
    process.stdout.write(
      '[FAIL] could not read ~/.hermes/config.yaml: ' + (err && err.message ? err.message : String(err)) + '\n'
    );
    return { status: 'failed' };
  }

  // Already-configured guard: only true when `fsb:` is a DIRECT child of
  // `mcp_servers:` (avoids cross-section false positives like `other_thing.fsb:`).
  if (findFsbInMcpServers(existing)) {
    process.stdout.write('[WARN] Hermes config already has mcp_servers.fsb -- not overwriting\n');
    return { status: 'already_configured' };
  }

  process.stdout.write('Detected Hermes config at ~/.hermes/config.yaml\n');

  let answer = '';
  if (!stdinClosed) {
    answer = await ask(rl, 'Inject fsb mcp_servers block? [y/N]: ');
  } else {
    process.stdout.write('Inject fsb mcp_servers block? [y/N]: (stdin closed -- treating as no)\n');
  }
  const trimmed = (answer || '').trim();
  const yes = trimmed === 'y' || trimmed === 'Y';

  if (!yes) {
    process.stdout.write('Skipped Hermes\n');
    return { status: 'skipped' };
  }

  let newContent;
  if (/^mcp_servers:\s*(?:#.*)?$/m.test(existing)) {
    // File has an `mcp_servers:` heading already (possibly with trailing comment) --
    // inject the fsb child immediately after that heading line so other mcp_servers
    // entries are preserved. Indent is detected from any existing children so we
    // match the user's style rather than forcing 2 spaces.
    const indent = detectMcpServersIndent(existing);
    const indentStr = ' '.repeat(indent);
    const fsbChild =
      indentStr + 'fsb:\n' +
      indentStr + indentStr + 'command: "npx"\n' +
      indentStr + indentStr + 'args: ["-y", "fsb-mcp-server@latest"]\n';
    newContent = existing.replace(/^(mcp_servers:\s*(?:#.*)?)\n/m, '$1\n' + fsbChild);
  } else {
    // No existing mcp_servers heading -- append the full block, ensuring the
    // file ends with a newline before the appended block.
    const sep = existing.length === 0 || existing.endsWith('\n') ? '' : '\n';
    newContent = existing + sep + HERMES_BLOCK;
  }

  try {
    writeFileSync(HERMES_CONFIG_PATH, newContent, 'utf8');
  } catch (err) {
    process.stdout.write(
      '[FAIL] could not write ~/.hermes/config.yaml: ' + (err && err.message ? err.message : String(err)) + '\n'
    );
    return { status: 'failed' };
  }

  process.stdout.write('[OK] wrote mcp_servers.fsb into ~/.hermes/config.yaml\n');
  return { status: 'installed' };
}

async function main() {
  const { listOut } = await runDetect();
  const hosts = parseHosts(listOut);

  const installed = [];
  const skipped = [];
  const failed = [];

  const rl = createInterface({ input: process.stdin, output: process.stdout });
  let stdinClosed = false;
  rl.on('close', () => { stdinClosed = true; });

  if (hosts.length === 0) {
    process.stdout.write(
      '[WARN] no other MCP hosts detected via the CLI list. Re-run after installing one (Claude Desktop, Cursor, VS Code, etc.).\n'
    );
  }

  for (const host of hosts) {
    if (!HOST_NAME_RE.test(host)) {
      process.stdout.write('[WARN] skipping host with unexpected characters: ' + JSON.stringify(host) + '\n');
      skipped.push(host);
      continue;
    }
    if (host === 'openclaw') {
      process.stdout.write('[WARN] OpenClaw config is print-only -- run print-stdio.mjs instead\n');
      skipped.push(host);
      continue;
    }

    process.stdout.write('Detected host: ' + host + '\n');
    let answer = '';
    if (!stdinClosed) {
      answer = await ask(rl, 'Install fsb-mcp-server into ' + host + '? [y/N]: ');
    } else {
      process.stdout.write('Install fsb-mcp-server into ' + host + '? [y/N]: (stdin closed -- treating as no)\n');
    }
    const trimmed = (answer || '').trim();
    const yes = trimmed === 'y' || trimmed === 'Y';

    if (!yes) {
      skipped.push(host);
      continue;
    }

    const result = await runInstallHost(host);
    if (result.ok) {
      installed.push(host);
    } else {
      failed.push(host + '(exit=' + result.code + ')');
    }
  }

  // Hermes Skills Hub branch: filesystem-based detection (no CLI flag). Runs
  // independently after the CLI-driven host loop so it surfaces in the summary
  // bucket alongside the other hosts.
  const hermesResult = await maybeInstallHermes(rl, stdinClosed);
  if (hermesResult.status === 'installed') {
    installed.push('hermes');
  } else if (hermesResult.status === 'failed') {
    failed.push('hermes(write-failed)');
  } else {
    // 'skipped' and 'already_configured' both fall into the skipped bucket.
    skipped.push('hermes');
  }

  rl.close();

  process.stdout.write('--- FSB skill install summary ---\n');
  process.stdout.write('[OK] installed: ' + (installed.length ? installed.join(', ') : 'none') + '\n');
  process.stdout.write('[WARN] skipped:  ' + (skipped.length ? skipped.join(', ') : 'none') + '\n');
  if (failed.length) {
    process.stdout.write('[FAIL] errored:   ' + failed.join(', ') + '\n');
  }

  process.exit(0);
}

main().catch((err) => {
  process.stdout.write('[FAIL] unexpected error: ' + (err && err.message ? err.message : String(err)) + '\n');
  process.exit(2);
});
```

## File: skills/fsb/scripts/print-hermes-yaml.mjs
size: 2302
sha: 521d4a1158b1c3bba727efbe8b6e715c4f27660e
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/scripts/print-hermes-yaml.mjs

```text
#!/usr/bin/env node
// print-hermes-yaml.mjs -- prints the canonical Hermes ~/.hermes/config.yaml mcp_servers.fsb block.
// Parity with skills/fsb/SKILL.md metadata.hermes -- enforced by tests/skill-fsb-spec.test.js (TEST-03 extension).
// Mirrors the fail-loud pattern from scripts/print-stdio.mjs (BLOCK constant + defense-in-depth validator).

const BLOCK = `mcp_servers:
  fsb:
    command: "npx"
    args: ["-y", "fsb-mcp-server@latest"]
`;

// Defense-in-depth: BLOCK is hand-written YAML. Node has no stdlib YAML parser,
// so we declare the equivalent JSON shape and assert (a) the JSON validator is
// itself well-formed and (b) the hand-written YAML satisfies string-level
// invariants that prove it round-trips to the same structure. Fail loudly on drift.
const EQUIVALENT = {
  mcp_servers: {
    fsb: {
      command: 'npx',
      args: ['-y', 'fsb-mcp-server@latest']
    }
  }
};

try {
  // Round-trip the JSON form to confirm the validator itself is well-formed.
  const parsed = JSON.parse(JSON.stringify(EQUIVALENT));
  const ok =
    parsed &&
    parsed.mcp_servers &&
    parsed.mcp_servers.fsb &&
    parsed.mcp_servers.fsb.command === 'npx' &&
    Array.isArray(parsed.mcp_servers.fsb.args) &&
    parsed.mcp_servers.fsb.args.length === 2 &&
    parsed.mcp_servers.fsb.args[0] === '-y' &&
    parsed.mcp_servers.fsb.args[1] === 'fsb-mcp-server@latest';
  // Structural string-level guards on the hand-written YAML:
  const yamlOk =
    /^mcp_servers:\n/.test(BLOCK) &&
    /\n {2}fsb:\n/.test(BLOCK) &&
    /\n {4}command: "npx"\n/.test(BLOCK) &&
    /\n {4}args: \["-y", "fsb-mcp-server@latest"\]\n/.test(BLOCK);
  if (!ok || !yamlOk) {
    process.stderr.write('[FAIL] BLOCK constant is not valid YAML/JSON or has drifted\n');
    process.exit(1);
  }
} catch (_err) {
  process.stderr.write('[FAIL] BLOCK constant is not valid YAML/JSON or has drifted\n');
  process.exit(1);
}

process.stdout.write('Paste this into ~/.hermes/config.yaml under the top-level mcp_servers key (merge with existing entries):\n');
process.stdout.write('\n');
process.stdout.write(BLOCK);
process.stdout.write('\n');
process.stdout.write('After saving, restart Hermes so the FSB MCP server registers. See skills/fsb/SKILL.md metadata.hermes for the source-of-truth shape.\n');

process.exit(0);
```

## File: skills/fsb/scripts/print-stdio.mjs
size: 1541
sha: 9724a92956e559e385e3a15009bc6bce8199510c
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/scripts/print-stdio.mjs

```text
#!/usr/bin/env node
// print-stdio.mjs -- prints the canonical OpenClaw stdio MCP config block (SKILL-04 / SKILL-06)
// Block parity with mcp/src/install.ts STDIO_COMMAND (line 28) and Claude Desktop section (~lines 170-176)
// -- enforced at CI time by tests/skill-fsb-spec.test.js (Phase 251 TEST-03).

const BLOCK = `{
  "mcpServers": {
    "fsb": {
      "command": "npx",
      "args": ["-y", "fsb-mcp-server@latest"]
    }
  }
}
`;

// Defense-in-depth: BLOCK is hard-coded but verify it is valid JSON and matches
// the canonical structure. If this ever drifts, fail loudly before printing.
try {
  const parsed = JSON.parse(BLOCK);
  const ok =
    parsed &&
    parsed.mcpServers &&
    parsed.mcpServers.fsb &&
    parsed.mcpServers.fsb.command === 'npx' &&
    Array.isArray(parsed.mcpServers.fsb.args) &&
    parsed.mcpServers.fsb.args.length === 2 &&
    parsed.mcpServers.fsb.args[0] === '-y' &&
    parsed.mcpServers.fsb.args[1] === 'fsb-mcp-server@latest';
  if (!ok) {
    process.stderr.write('[FAIL] BLOCK constant is not valid JSON or has drifted\n');
    process.exit(1);
  }
} catch (err) {
  process.stderr.write('[FAIL] BLOCK constant is not valid JSON or has drifted\n');
  process.exit(1);
}

process.stdout.write('Paste this into your OpenClaw MCP config:\n');
process.stdout.write('\n');
process.stdout.write(BLOCK);
process.stdout.write('\n');
process.stdout.write('If your OpenClaw build documents a different shape, see mcp/src/install.ts getSetupSections() (canonical source of truth).\n');

process.exit(0);
```

## File: skills/fsb/references/default-to-fsb.md
size: 3703
sha: 9b3c222ea9beb11cd77087cdb7c3f510cc96d952
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/default-to-fsb.md

````text
# Default to FSB

When a request involves a real browser session, FSB is usually the right tool. This file states the rule once and gives the carve-out for read-only public content.

## Soft preference

When a click, type, multi-tab, or auth task could route through either FSB or another tool, prefer FSB. The cost of a stale WebFetch (cached, missing logged-in state, missing JS-rendered content) is higher than the cost of a Chrome round-trip. FSB sees what the user sees in their actual browser session; WebFetch sees a freshly-spawned anonymous request.

Rule: **Default to FSB tools when one fits.**

## Hard escalation rule

If ANY of the following triggers apply, the task MUST use FSB. There is no judgment call here.

- Any click on a real web page.
- Any text input into a real form (search box, login field, comment box, anything).
- Any auth flow (login, MFA prompt, vault credential lookup, saved-payment selection).
- Any multi-tab orchestration (open a new tab and switch back, fill a form across two tabs, copy from tab A to tab B).
- Any task that needs the user's logged-in session, cookies, or chrome-state-dependent rendering.
- Any dynamic page where the relevant content is rendered after JS, behind a scroll, or behind a click.

Rule: **If a task hits any bullet above, it does not belong on WebFetch. Escalate to FSB.**

## Stay on WebFetch (carve-out)

WebFetch is fine -- often better -- for read-only public content where no interaction is needed. Spinning up the FSB extension for a static fetch is unnecessary overhead.

Stay-with-WebFetch cases:

- Public documentation pages (HTML / Markdown).
- JSON endpoints (REST APIs, public JSON files).
- RSS / Atom feeds.
- `sitemap.xml`, `robots.txt`.
- Raw `README.md` / source files from public GitHub repos.
- Static landing pages with no logged-in state.

## Decision flowchart

```
Is the task interactive web automation?
  |
  +-- yes -> FSB (use the tools in references/tool-decision-tree.md)
  |
  +-- no  -> Is it logged-in / chrome-state-dependent?
                |
                +-- yes -> FSB
                |
                +-- no  -> Is the content available as public HTML / JSON / RSS?
                              |
                              +-- yes -> WebFetch (or the host's existing read tool)
                              |
                              +-- no  -> FSB (default to the heavier tool)
```

When in doubt at the bottom of the tree, default to FSB. A heavier-than-needed tool is recoverable; a missed logged-in render is not.

## Concrete examples

### FSB (interactive / chrome-state-dependent)

- "Search for `fsb-mcp-server` on GitHub and click the first result." -- click + multi-step.
- "Log into example.com and download today's invoice." -- auth + download.
- "Open my Gmail and read the latest message from billing@example.com." -- logged-in session.
- "Fill out the contact form at https://example.com/contact and submit it." -- form + typed events.
- "Compare prices for product X across these three tabs." -- multi-tab.

### WebFetch (public read-only)

- "Read the README of github.com/fullselfbrowsing/FSB." -- raw public content.
- "Fetch https://api.github.com/repos/fullselfbrowsing/FSB and report stargazers." -- public JSON.
- "Read the latest entry from this RSS feed." -- RSS read.
- "Pull the changelog text from https://example.com/changelog." -- static HTML.

## See also

- `references/tool-decision-tree.md` -- once the decision lands on FSB, which tool first.
- `references/restricted-tab-recovery.md` -- recovery on `chrome://` / `edge://` / Web Store.
- `references/vault-boundary.md` -- credential routing rules.
- `USAGE.md` -- the human-facing overview.
````

## File: skills/fsb/references/hermes-tool-prefix.md
size: 1569
sha: 2733fae29c2e66b7a722b2fc48ed3034eadd4330
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/hermes-tool-prefix.md

```text
# FSB on Hermes -- tool naming

Hermes auto-prefixes imported MCP tools with the server's name. The FSB MCP server registers as `fsb` (see `~/.hermes/config.yaml` `mcp_servers.fsb`), so every FSB tool surfaces inside Hermes as `mcp_fsb_<tool>`. The prefix is applied by Hermes at import time; the FSB MCP server itself still exports the bare tool names (`click`, `read_page`, etc.), so cross-references in this skill and in the v0.9.62 contract continue to use the bare names.

## Examples

| FSB tool | Hermes-side name |
| --- | --- |
| click | mcp_fsb_click |
| type_text | mcp_fsb_type_text |
| read_page | mcp_fsb_read_page |
| get_dom_snapshot | mcp_fsb_get_dom_snapshot |
| execute_js | mcp_fsb_execute_js |

## Scope

- This is a Hermes-side naming convention; the FSB MCP server still exports the bare names.
- The v0.9.62 field bundle (`visual_reason`, `client`, optional `is_final`) is unchanged. See `references/visual-session-lifecycle.md` and `references/v0.9.62-contract-mirror.md`.
- Pass `client: "Hermes"` on action calls. The label was added to the v0.9.36 shared allowlist in FSB v0.9.69 (PR #49), so action calls accept normally and do not reject with `BADGE_NOT_ALLOWED`.

## See also

- `references/visual-session-lifecycle.md` -- v0.9.62 implicit contract: field bundle, sliding window, typed-error recovery.
- `references/v0.9.62-contract-mirror.md` -- mirror of the canonical 36 action / 15 read-only / 3 typed-error names.
- `references/tool-decision-tree.md` -- read-only-first decision tree (the `## On Hermes` subsection links back here).
```

## File: skills/fsb/references/multi-agent-contract.md
size: 5731
sha: 46c03886ec6532de5d7aeb7a24d873f13cc32494
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/multi-agent-contract.md

````text
# FSB multi-agent contract (current as of v0.9.95)

This file documents the rules that make FSB's per-agent tab ownership work. Anyone calling FSB tools through MCP MUST follow these rules; breaking them produces typed errors that recover cleanly only when the caller knows the contract. The contract is small (six error names + the `agent_id` rule), but every rule matters: bypassing one corrupts the ownership graph and the only recovery is closing the affected tab.

## Tab ownership behavior (v0.8.0+)

- Each agent owns its own tabs. `open_tab` defaults to `active: false` so it claims a tab without stealing the user's focus -- only pass `active: true` when the user explicitly needs to see that tab.
- Do not foreground a tab unless the task requires it. `switch_tab` defaults to background; it foregrounds only when `active: true` is explicit.
- Close only tabs this agent owns. `close_tab` refuses the active foreground tab unless `allow_active: true` is set. Never close or reopen Chrome itself.
- There is no global browser lock. The per-agent ownership graph is the only concurrency mechanism -- do not introduce a global lock as a blocker.

## Never pass agent_id

Callers MUST NOT pass `agent_id` on any FSB MCP tool call. The FSB MCP server mints `agent_id` when a session opens and threads it through the bridge automatically.

Caller-supplied `agent_id` breaks ownership accounting -- a fabricated id either steals tabs from another agent or claims tabs the bridge has not handed out. The server's session map is the only authority on which agent owns which tab; do not try to anticipate, derive, or override it from the calling side.

```
[BAD]  click({ selector: "#submit", agent_id: "openclaw-1" })
[GOOD] click({ selector: "#submit" })
```

## Six typed errors and how to recover

When an FSB tool call hits one of the dispatcher boundaries, the server returns a structured error with one of the names below. Match on the name; do not parse the human-readable message.

### NO_OWNED_TAB

- What it means: The calling agent does not currently own any tabs. The most common cause is the very first tool call of a fresh agent session (including `start_visual_session`).
- What to do: Call `open_tab({ url, active: false })` to claim a tab without stealing focus, then retry the original call. `navigate` and `switch_tab` can also claim an unowned normal tab if one already exists.

### AMBIGUOUS_TAB

- What it means: The calling agent owns multiple tabs and the tool did not specify a `tab_id`, so the target is ambiguous.
- What to do: Call `list_tabs` to enumerate owned tabs, then retry with the intended `tab_id`.

### TAB_NOT_OWNED

- What it means: The tool targeted a tab that belongs to a different agent (or to `legacy:sidepanel`).
- What to do: Either call `switch_tab` to a tab this agent owns, or `open_tab` to create a new one in agent scope.

### AGENT_CAP_REACHED

- What it means: The session hit its concurrent-agent cap (default 8, configurable 1-64 in extension settings).
- What to do: Reduce parallel calls, finish in-flight tasks, or raise the cap from the FSB extension's options page.

### TAB_INCOGNITO_NOT_SUPPORTED

- What it means: The targeted tab is in an Incognito window. FSB rejects Incognito tabs at the dispatcher boundary because the extension's storage and ownership model do not span Incognito.
- What to do: Move the work to a normal (non-Incognito) Chrome window. Open a new tab there with `open_tab`.

### TAB_OUT_OF_SCOPE

- What it means: The targeted tab is in a different Chrome window than the agent's session window. Each agent only sees tabs in the window where its session began.
- What to do: Use `list_tabs` to enumerate this agent's owned tabs and pick one; if the work belongs in a different window, open a new tab in the current window with `open_tab`.

## Use go_back instead of execute_js('history.back()')

Use `go_back` for one-step history navigation, and `go_forward` to undo it. Do NOT call `execute_js("history.back()")`.

`go_back` is ownership-gated, carries the `visual_reason`/`client` field bundle like other action tools, and returns the resulting URL. `execute_js("history.back()")` bypasses ownership, lies about success on BF-cached pages, and returns whatever the JS evaluator coerced last.

```
[BAD]  execute_js("history.back()")
[GOOD] go_back({ visual_reason: "Return to results", client: "OpenClaw" })
```

The separate `back` tool that older builds registered was removed; it duplicated `go_back`.

## Why the contract matters

FSB's per-agent ownership is what lets multiple AI sessions share one Chrome instance without fighting. The contract is small (six error names plus `agent_id`), but every rule matters -- bypassing one rule corrupts the ownership graph and the only recovery is closing the affected tab.

## Default recovery ladder

When a tool call fails and you are not sure which layer broke, try these in order before escalating to the doctor:

1. `list_tabs({})` -- check whether this agent owns any tab. Recovery-safe; works on restricted URLs too.
2. If no owned tab: `open_tab({ url, active: false })` to claim one in the background.
3. If the tab is on a non-injectable URL (`chrome://`, `edge://`, Web Store, `data:`, `file:`): `navigate({ url })` to a normal `http(s)` page.
4. If the page loaded but DOM tools still fail: bridge or content-script issue. Run `node scripts/doctor.mjs`.

## See also

- `references/tool-decision-tree.md` -- which tools to reach for first.
- `references/restricted-tab-recovery.md` -- recovery on `chrome://`, `edge://`, and Web Store tabs.
- `references/default-to-fsb.md` -- soft preference and hard escalation rule.
- `references/vault-boundary.md` -- credential routing rules.
````

## File: skills/fsb/references/restricted-tab-recovery.md
size: 5637
sha: b4cb536d1ff1c355dc914cfb942ec1f42a231e5e
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/restricted-tab-recovery.md

```text
# Restricted-tab recovery

When FSB's active tab is at a restricted URL, the FSB content script cannot attach. DOM tools (`read_page`, `get_dom_snapshot`, `click`, `type_text`, etc.) will fail. The full non-injectable list:

- `chrome://*`, `edge://*`, `about:*`, `view-source:*`
- `https://chrome.google.com/webstore/*`, `https://chromewebstore.google.com/*`
- `data:` URLs (no origin -- the extension cannot register a host match)
- `file:` URLs (unless the user has manually granted file-URL access to the extension)
- `blob:` URLs spawned in restricted contexts

This file lists the recovery toolset that works even on these tabs and shows the standard bootstrap recovery sequence.

## Why DOM tools fail on these URLs

Browsers forbid content scripts from attaching to internal pages, the Chrome Web Store, and origin-less schemes (`data:`, `file:`, certain `blob:`) as a security boundary. The Manifest V3 `host_permissions` list cannot match them; Chrome rejects the injection at the policy layer. There is no extension-side workaround -- the boundary is enforced by the browser itself, before any of FSB's code runs.

For local testing, serve the page over `http://localhost` instead of opening a `data:` or `file:` URL.

Without a content script, the FSB extension cannot read the DOM, dispatch typed events, or observe mutations. Any attempt by FSB tools that route through the content script (`read_page`, `click`, `type_text`, `get_dom_snapshot`, etc.) fails fast with an attach error. The recovery path is to leave the restricted tab using a tool that does NOT require content-script attachability.

## Safe recovery tools (work even on restricted tabs)

These tools route through the extension's background service worker, not the content script, so they continue to function on `chrome://`, `edge://`, and Web Store URLs.

| Tool       | What it does                                                  | Example                                                                                              |
|------------|---------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| list_tabs  | Enumerate the agent's owned tabs.                             | `list_tabs({})` -- find a non-restricted tab to switch to.                                           |
| switch_tab | Switch agent focus to another owned tab.                      | `switch_tab({ tab_id: <id from list_tabs> })`                                                        |
| open_tab   | Open a new tab in agent scope (background by default).        | `open_tab({ url: "https://example.com" })`                                                           |
| navigate   | Change the URL of the current tab.                            | `navigate({ url: "https://example.com" })` -- works zero-content-script per Phase 247 active-tab work.|
| go_back    | Step back one history entry on the current tab.               | `go_back({})`                                                                                        |
| go_forward | Step forward one history entry on the current tab.            | `go_forward({})`                                                                                     |
| refresh    | Reload the current tab.                                       | `refresh({})` -- useful after the extension installs mid-session.                                    |

Every tool name in the table above is a registered name in `mcp/ai/tool-definitions.cjs`. Any tool not on this list (`read_page`, `click`, `type_text`, `get_dom_snapshot`, `get_page_snapshot`, `wait_for_element`, etc.) requires content-script attach and will fail on a restricted tab.

## Worked example: bootstrap recovery from chrome://newtab

This is the canonical recovery sequence when the active tab is `chrome://newtab` (the most common bootstrap scenario, since Chrome opens new windows there by default).

1. The first DOM call (e.g., `read_page({})`) fails with an attach error because the active tab is `chrome://newtab`.
2. Call `list_tabs({})` to enumerate owned tabs. This is recovery-safe; it routes through the background service worker, not the content script.
3. If the list contains a normal `http(s)` tab, call `switch_tab({ tab_id })` to focus it. Resume the original work.
4. If no normal tab exists, call `navigate({ url: "https://example.com" })` (or whatever URL the task targets) to leave the restricted page in the current tab. The FSB content script will attach as soon as the destination loads.
5. Re-run the original DOM call. It should now succeed.
6. If the original call still fails, run `node scripts/doctor.mjs`. The failing layer is now `content-script` (the page loaded but the script did not attach), and the doctor's recovery line tells you to reload the tab.

A second common variant is recovering from a Web Store tab (e.g., the user just installed the extension). Same sequence: `list_tabs` -> `switch_tab` to a normal tab, OR `navigate` to a target URL on the current tab.

## When to escalate to the doctor

If recovery fails, run `node scripts/doctor.mjs`. The recovery toolset above handles the active-tab layer. The doctor handles the other five layers (package, bridge, extension, content-script, config). See `USAGE.md` for the full six-layer recovery table.

## See also

- `references/tool-decision-tree.md` -- which tools to reach for first.
- `references/multi-agent-contract.md` -- ownership errors (`TAB_NOT_OWNED`, etc.) that can fire from `switch_tab`.
- `USAGE.md` -- six-layer doctor recovery table.
```

## File: skills/fsb/references/tool-decision-tree.md
size: 13613
sha: 6ccee257a39c23d76a42f47b415b6a86653df1f3
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/tool-decision-tree.md

````text
# FSB tool decision tree

Read-only first; act with typed events; escalate to autopilot only when the user explicitly delegates the whole task. The tool names listed below match the FSB AI manual-mode tool registry in `mcp/ai/tool-definitions.cjs`. If a name appears as a bare token in the tree or table on this page, it is a real manual-mode tool you can call directly. Names mentioned only in narrative prose (notably `run_task`) live on a different surface and must not be invoked from the manual-mode loop.

## v0.9.62 field bundle (action tools only)

Before any action-tool branch below: every action tool (`click`, `type_text`, `navigate`, `scroll`, `drag`, `select_option`, `press_key`, `press_enter`, `drag_drop`, `hover`, `focus`, `clear_input`, `check_box`, `drop_file`, `upload_file`, `click_and_hold`, `double_click`, `right_click`, `click_at`, `scroll_at`, `double_click_at`, `drag_variable_speed`, `set_attribute`, `insert_text`, `search`, `refresh`, `go_back`, `go_forward`, `open_tab`, `close_tab`, `switch_tab`, `execute_js`, `select_text_range`, `scroll_to_top`, `scroll_to_bottom`, `scroll_to_element`, `fill_sheet`) requires the field bundle on every call:

- `visual_reason` (required string) -- short human-readable reason shown in the overlay.
- `client` (required, allowlisted) -- e.g. `OpenClaw`, `Claude`, `Codex`, `ChatGPT`, `Cursor`, `Antigravity`, `Gemini`, `Grok`, `Perplexity`, `OpenCode`, `Cline`, `Muse`, `Grok Bot`, `Dots`. Freeform strings reject with `BADGE_NOT_ALLOWED`.
- `is_final` (optional boolean) -- set `true` on the LAST action of a task to clear the overlay immediately.

Read-only tools (`read_page`, `get_dom_snapshot`, `get_text`, `get_attribute`, `read_sheet`, `get_page_snapshot`, `list_tabs`, `get_site_guide`, `search_memory`, `report_progress`, `complete_task`, `partial_task`, `fail_task`, `wait_for_element`, `wait_for_stable`) do NOT carry the bundle. Reads stay silent by design; the read-first guidance below is unchanged from v0.9.61. The trigger-watcher tools (`trigger`, `stop_trigger`, `get_trigger_status`, `list_triggers`) and the capability tools (`search_capabilities`, `invoke_capability`) also do not carry this bundle, but they are separate tool families, not part of either pinned list -- see "Trigger watchers vs manual polling" and "Capability tools vs page automation" below.

The explicit `start_visual_session` / `end_visual_session` tools were removed in v0.9.0; the decision tree never reaches for them. See `references/visual-session-lifecycle.md` for the full lifecycle and `.planning/v0.9.62-CONTRACT.md` for the canonical lists.

## On Hermes

Tool names shown here without prefix appear as `mcp_fsb_<tool>` inside Hermes (e.g., `click` -> `mcp_fsb_click`, `read_page` -> `mcp_fsb_read_page`). See `references/hermes-tool-prefix.md`. The field bundle and read/action split are unchanged.

## Read-only first (in this order)

Pick the lightest reader that answers the question. Escalate down the list only when the lighter tool cannot give you what you need.

- `read_page` -- the default reader. Use first when you need the user-visible text plus interactable elements of the current tab. Cheap; runs on the live DOM.
- `get_dom_snapshot` -- escalate from `read_page` when you need the structured DOM (attributes, hidden elements, ARIA roles, element refs like `e5`). More tokens; slower.
- `get_page_snapshot` -- escalate from `get_dom_snapshot` when you need the full page including computed visual state (e.g., position-aware layout, what is actually painted). Heaviest; use sparingly.
- `get_site_guide` -- check this BEFORE the three above for known sites. The skill ships ~43 site guides under `site-guides/`; if the active host has a guide, it tells you exactly which selectors are stable.

If `get_site_guide` returns a guide, follow the guide's selectors first; only fall back to `read_page` or the snapshot tools when the guide does not cover the current state.

## execute_js vs typed tools

`execute_js` is a first-class interaction tool in FSB, not a last resort. The current MCP tool description even instructs callers to "try execute_js FIRST" for clicks, scrolls, reads, and attribute lookups, because it bypasses overlay/obscured-element issues, viewport constraints, and CDP timeouts that block native click/scroll.

Use this split:

- **Use `execute_js` freely for**: reading DOM (text, attributes, computed styles, hidden nodes), querying multiple elements at once, scrolling, probing structure during exploration, and clicking elements blocked by overlays or off-screen.
- **Use typed tools (`type_text`, `clear_input`, `select_option`, `check_box`, `press_enter`, `press_key`, `drag`, `drag_drop`) for**: controlled text inputs, validation-sensitive form fields, real drag operations, and any input where framework change handlers must fire.
- **After any `execute_js` click, verify** with `read_page` or `get_dom_snapshot` -- a true click produces an observable DOM change. If the page state did not change, fall back to the typed `click` tool, which dispatches real CDP events that React/Vue/Angular synthetic-event pipelines listen for.

The one rule that does not bend: `element.value = 'foo'` via `execute_js` will NOT update controlled-input component state in React, Vue, Solid, or Angular. Use `type_text` for any text input bound to framework state.

```
[BAD]  execute_js("document.querySelector('input[name=q]').value = 'foo'")
[GOOD] type_text({ selector: "input[name=q]", text: "foo" })

[OK]   execute_js("return Array.from(document.querySelectorAll('a')).map(a=>a.href)")
[OK]   execute_js("document.querySelector('#add-to-cart').click(); return true")  // verify after
```

## Trigger watchers vs manual polling

Use `trigger` when the user wants to watch one page element for a future change instead of you polling `read_page`/`get_dom_snapshot` in a loop -- for example "let me know when this price drops below $50" or "watch for the order status to change to Shipped". Arm one selector plus one condition (`changed`, `threshold`, `delta_percent`, `equals`, `contains`, `regex`, or a compound AND/OR of these). `trigger` blocks by default (30s heartbeats, 120s timeout, 240s safety ceiling) or pass `detached: true` to get a `trigger_id` back immediately and poll it yourself. Manage armed watches with `stop_trigger` (cancel), `get_trigger_status` (one watch), and `list_triggers` (enumerate active/attention watches, or all with `include_terminal`). None of the four trigger tools carry the field bundle above -- they are a separate tool family from the action-tool contract. Watches are local to the open browser session: Chrome and the FSB extension must stay running, and FSB does not provide server-side monitoring or push delivery, so do not promise the user a notification after the session ends. See `mcp/README.md#trigger-watchers` for the full contract.

## Capability tools vs page automation

Before driving a multi-step page flow by hand, check whether a verified first-party API capability already covers it: call `search_capabilities({ query })` for up to 5 ranked hits with a readiness label, then `invoke_capability({ slug, params })` to run one. Readiness labels matter -- only `t1-ready` hits execute directly; `t1-guarded-fail-closed`, `learn-pending`, and `discovery-pending` hits return typed pending/fallback responses instead of running, so fall back to manual page automation for those rather than assuming the call succeeded. `search_capabilities` is read-only and bypasses the mutation queue; `invoke_capability` is serialized like other action tools but does NOT carry the field bundle above. `invoke_capability` calls with purchase, payment, account-change, or public-post effects need the same pause-and-confirm-in-chat treatment as the equivalent page click -- see "Sensitive actions and logged-in context" in `SKILL.md`.

## Verify after a "no detectable effect" warning

`click` (and other action tools) can return a "no detectable effect" warning even when the page actually changed -- the action-detection heuristic produces false negatives on async/animated UIs. Before retrying, verify page state with `read_page` or `get_dom_snapshot`. If the state already advanced, treat the action as successful and continue.

## Tool-by-tool quick reference

| Tool | When to use | Common pitfall |
| --- | --- | --- |
| `read_page` | Default reader for the active tab text and interactables. | Stale if a recent action changed the DOM and you have not re-read. |
| `get_dom_snapshot` | Need attributes, ARIA, hidden nodes that `read_page` omits. | Tokens scale with page size; prefer `read_page` first. |
| `get_page_snapshot` | Need computed layout or position-aware state. | Heaviest read; do not call in a tight loop. |
| `get_site_guide` | Known site -- check first to get stable selectors. | Skip if the host has no guide; do not call once per action. |
| `click` | Fire a real user click on a typed selector. | If the click does not register, the element may need `scroll_to_element` first. |
| `type_text` | Type into an input or textarea via typed events. | Do NOT use `execute_js` to set `.value`; React and Vue change handlers will not fire. |
| `press_enter` | Submit a form or confirm via the Enter key. | Many sites prefer `click` on a submit button; fall back to `press_enter` only if there is no button. |
| `wait_for_element` | Block until a selector appears. | Always set a timeout; bare waits hang the loop on broken selectors. |
| `wait_for_stable` | Block until DOM mutations settle. | Pair with `wait_for_element` when the page renders progressively. |
| `open_tab` | New tab in agent scope (background by default). | Default is background; pass `active: true` ONLY when the user must see it. |
| `switch_tab` | Move agent focus to another owned tab. | Cross-agent tabs reject with `TAB_NOT_OWNED` -- see `references/multi-agent-contract.md`. |
| `list_tabs` | Enumerate owned tabs (recovery and bootstrap). | Recovery-safe even on `chrome://` and the Web Store; see `references/restricted-tab-recovery.md`. |
| `navigate` | Change URL in current tab. | Recovery-safe; use to escape restricted tabs. |
| `go_back` | Step back one history entry. | Use this typed tool, never `execute_js("history.back()")` -- see `references/multi-agent-contract.md`. |
| `go_forward` | Step forward one history entry. | Pair with `go_back`; same ownership rules. |
| `refresh` | Reload current tab. | Use after content-script attach failures. |
| `execute_js` | First-class for reads, attribute lookups, scrolls, and clicks blocked by overlays. | Do not use to set `.value` on controlled inputs (use `type_text`); verify state after JS clicks. |

## Worked example

You land on an unfamiliar product page and the user asks "add the medium size to cart".

1. Call `get_site_guide` -- if the host is one of the ~43 covered sites, the guide names the size-picker and add-to-cart selectors directly; jump to step 4.
2. If no guide, call `read_page` to see the rendered text and the candidate interactables.
3. If the page is custom-rendered and `read_page` cannot resolve the size control to a stable selector, escalate to `get_dom_snapshot` and read element refs (`e5`, `e23`, etc.).
4. `click` the size option using the selector or ref.
5. `wait_for_stable` while the cart updates.
6. `click` the add-to-cart button. Re-check with `read_page` only if you need to verify the cart count.

## Action-tool bundle reminder

Every entry in the "Tool-by-tool quick reference" table above that is an action tool (everything except `read_page`, `get_dom_snapshot`, `get_page_snapshot`, `get_site_guide`, `list_tabs`, `wait_for_element`, and `wait_for_stable`) MUST carry the v0.9.62 field bundle: `visual_reason` (required string), `client` (required, allowlisted), and optional `is_final: true` on the last action of a task. Missing fields reject with `VISUAL_FIELDS_REQUIRED`; non-allowlisted `client` values reject with `BADGE_NOT_ALLOWED`. See `references/visual-session-lifecycle.md` for lifecycle mechanics and `.planning/v0.9.62-CONTRACT.md` for the canonical 37-tool action list (36 pinned plus the `upload_file` addendum) and 15-tool read-only list.

## When to escalate to autopilot

Autopilot (the `run_task` MCP tool, served by `mcp/src/tools/autopilot.ts`) is a separate surface. It runs FSB's plan-and-execute loop end-to-end. It is NOT in `mcp/ai/tool-definitions.cjs` because it is not a manual-mode tool -- it is the delegation surface. Autopilot manages its own internal visual-session lifecycle and is NOT affected by the v0.9.0 implicit-contract change; do not pass field-bundle plumbing through `run_task`.

Use autopilot ONLY when the user explicitly delegates the whole task ("use FSB autopilot to ...", "run the full task with FSB"). Default to the manual mode tools above for everything else. Autopilot is not the default entry point.

## See also

- `references/visual-session-lifecycle.md` -- v0.9.62 implicit contract, field bundle, sliding window, typed errors.
- `references/multi-agent-contract.md` -- typed errors and history navigation.
- `references/restricted-tab-recovery.md` -- DOM tools fail on `chrome://`, `edge://`, and the Web Store.
- `references/default-to-fsb.md` -- when to prefer FSB versus WebFetch.
- `references/vault-boundary.md` -- credential-routed tools.
- `mcp/README.md#trigger-watchers` -- full trigger contract: watch modes, condition kinds, concurrency cap.
- `.planning/v0.9.62-CONTRACT.md` -- canonical 37 action tools (36 pinned plus the `upload_file` addendum), 15 read-only tools, three typed-error names.
````

## File: skills/fsb/references/v0.9.62-contract-mirror.md
size: 2027
sha: c46d56bad31b3d1aa3aa72e09e903c7d240b8210
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/v0.9.62-contract-mirror.md

````text
# v0.9.62 visual-session contract -- mirror

> **Mirror.** Authoritative source is `.planning/v0.9.62-CONTRACT.md` in the FSB repo
> (https://github.com/fullselfbrowsing/FSB). If the repo and this mirror disagree,
> the repo wins. This file exists so Hub-installed users (skill at `~/.hermes/skills/`,
> no repo access) can still resolve "does this tool require the field bundle?" by lookup.

## Action tools (36 -- carry the field bundle on every call)

```
click
type_text
navigate
scroll
drag
select_option
press_key
press_enter
drag_drop
hover
focus
clear_input
check_box
drop_file
click_and_hold
double_click
right_click
click_at
scroll_at
double_click_at
drag_variable_speed
set_attribute
insert_text
search
refresh
go_back
go_forward
open_tab
close_tab
switch_tab
execute_js
select_text_range
scroll_to_top
scroll_to_bottom
scroll_to_element
fill_sheet
```

Count: 36. Every entry above requires `visual_reason` (string) and `client` (allowlisted) on every call; optional `is_final: true` clears the overlay immediately.

## Read-only tools (15 -- do NOT carry the field bundle)

```
read_sheet
read_page
get_text
get_attribute
get_dom_snapshot
list_tabs
get_page_snapshot
get_site_guide
search_memory
report_progress
complete_task
partial_task
fail_task
wait_for_element
wait_for_stable
```

Count: 15. These tools never carry the field bundle and never re-arm the 60-second sliding window.

## Typed errors (3 -- schema layer)

- `VISUAL_FIELDS_REQUIRED` -- raised when an action tool is missing `visual_reason` or `client`.
- `BADGE_NOT_ALLOWED` -- raised when `client` is not on the v0.9.36 shared allowlist. Allowed values: Claude, Codex, ChatGPT, Perplexity, Cursor, Antigravity, OpenCode, OpenClaw, Grok, Gemini, Hermes, Cline, Continue, Zed, VS Code, Copilot, JetBrains, Xcode, Eclipse, Cody, Roo Code, Kiro, Goose, Muse, Grok Bot, Dots.
- `TOOL_REMOVED` -- retired together with the error-only `start_visual_session` / `end_visual_session` stubs; those names are no longer registered. The contract is implicit.
````

## File: skills/fsb/references/vault-boundary.md
size: 3382
sha: 9477ea9a417eae88cba509f0ca29f521a9000c30
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/vault-boundary.md

````text
# Vault boundary

Passwords, CVVs, and saved payment methods never cross into chat or tool arguments. They stay inside the FSB Chrome extension's encrypted storage, where the extension fills them at the DOM layer. The MCP server, the OpenClaw host, and the model itself never see the values.

## The rule

1. Passwords, CVV codes, and other secret credentials are entered through `fill_credential` ONLY. The model passes a credential reference (e.g., a label like `gmail-personal`); the extension resolves the value internally.
2. Saved payment methods are entered through `use_payment_method` ONLY. Same shape: the model passes a reference; the extension fills card number, expiry, and CVV at the DOM layer.
3. No secrets in chat. The model MUST NOT echo a credential value, MUST NOT include one in tool args, MUST NOT log one in narration.
4. `requires.env: []` is mandatory in `SKILL.md` frontmatter. There are no provider env vars in the skill -- vault values resolve inside the FSB Chrome extension's encrypted storage (`secure-config.js` in the extension source), not in the MCP server process and not in the OpenClaw host process.

## Where vault values live

Users configure vault entries from the FSB Chrome extension surface (popup or sidepanel options page). Each entry is keyed by a label and stored encrypted. When the model invokes `fill_credential({ label, selector })` or `use_payment_method({ label, ... })`, the extension reads the encrypted value, fills the target DOM element via typed events, and never echoes the value back to the MCP server or the host. The full lifecycle of a vault value is: user types it once into the extension UI -> encrypted storage -> typed events into a target form. It never leaves the user's browser process.

## Anti-patterns

```
[BAD]  type_text({ selector: "#password", text: "hunter2" })
       # secret leaks into MCP args, host logs, model context, retry buffers.
[GOOD] fill_credential({ label: "gmail-personal", selector: "#password" })
```

```
[BAD]  use_payment_method({ card_number: "4111-1111-1111-1111", cvv: "123" })
       # full PAN + CVV leak into MCP args. Use the saved-method label instead.
[GOOD] use_payment_method({ label: "personal-visa", form_selector: "form#checkout" })
```

```
[BAD]  Add provider keys to SKILL.md `requires.env`.
       # the skill never holds secrets. requires.env stays empty.
[GOOD] Configure provider keys in the FSB Chrome extension's options page.
```

## Why this boundary matters

The MCP transport layer logs tool args by default; OpenClaw and other hosts retain context across turns; retry buffers in the bridge can replay calls. Anything passed as a tool argument is durable. Vault values are not -- they cross only the extension <-> DOM boundary, which lives entirely in the user's browser. Routing a password through `type_text` instead of `fill_credential` collapses that boundary and turns a one-shot DOM event into a value that persists across the entire stack.

## See also

- `references/default-to-fsb.md` -- when an auth flow triggers escalation to FSB.
- `references/multi-agent-contract.md` -- ownership rules for vault-using tabs.
- `references/tool-decision-tree.md` -- which read tool to use to confirm a credential filled successfully (e.g., `read_page` to verify a logged-in heading).
- `SKILL.md` -- `requires.env: []` is the contract this file documents.
````

## File: skills/fsb/references/visual-session-lifecycle.md
size: 8521
sha: aa24da7424dca08e409788795f1272ac6d02a394
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/references/visual-session-lifecycle.md

````text
# Visual session lifecycle (v0.9.62)

As of fsb-mcp-server v0.9.0 (FSB milestone v0.9.62) the visual session is IMPLICIT. There is no `start_visual_session` / `end_visual_session` pairing. Every action tool call carries a field bundle, and the lifecycle is driven by those fields alone. This file documents the bundle, the sliding 60-second window, the read-tool vs action-tool split, and the bootstrap path.

If you arrived here from v0.8.0 / v0.9.36 docs that documented an explicit start/end pairing, that pairing was removed in v0.9.0. The removed names are no longer registered, so calling them fails with the MCP host's unknown-tool error. The migration recipe is in `mcp/CHANGELOG.md` v0.9.0.

## The field bundle

Every MCP action tool accepts and requires the following fields on every call:

| Field           | Type    | Required | Description                                                                                          |
|-----------------|---------|----------|------------------------------------------------------------------------------------------------------|
| `visual_reason` | string  | required | Short human-readable reason shown in the overlay (for example, `"Logging in to GitHub"`).            |
| `client`        | string  | required | Allowlisted client label. Validated against the v0.9.36 shared badge allowlist (see below).          |
| `is_final`      | boolean | optional | When `true`, the overlay clears immediately after the tool's `change_report` resolves. Default `false`. |

Allowlisted `client` values (shared allowlist): `Claude`, `Codex`, `ChatGPT`, `Perplexity`, `Cursor`, `Antigravity`, `OpenCode`, `OpenClaw`, `Grok`, `Gemini`, `Hermes`, `Cline`, `Continue`, `Zed`, `VS Code`, `Copilot`, `JetBrains`, `Xcode`, `Eclipse`, `Cody`, `Roo Code`, `Kiro`, `Goose`, `Muse`, `Grok Bot`, `Dots`. The skill ships as part of OpenClaw, so the canonical `client` value for this surface is `OpenClaw`. Freeform strings reject with `BADGE_NOT_ALLOWED`.

The canonical 36-tool action list lives in `.planning/v0.9.62-CONTRACT.md` (Action Tools section). The 15-tool read-only list lives in the same file (Read-Only Tools section). Do not re-derive either list from memory.

## Implicit start

The first action tool call on a tab creates the visual session. The extension paints the overlay using the supplied `visual_reason` and the badge corresponding to `client`. There is no separate open call -- the bundle on the action call IS the open.

```
mcp> click({ selector: "#submit", visual_reason: "Completing checkout", client: "OpenClaw" })
```

When this call dispatches, the overlay appears with `"Completing checkout"` and the OpenClaw badge. The death-timer is armed at 60 seconds.

## Sliding 60-second window

Each subsequent action tool call on the same tab re-arms the 60-second death timer (sliding window). The overlay stays alive as long as action calls keep arriving within 60 seconds of each other.

```
mcp> click({ selector: "#step-1", visual_reason: "Completing checkout", client: "OpenClaw" })
mcp> type_text({ selector: "#email", text: "user@example.com", visual_reason: "Completing checkout", client: "OpenClaw" })
mcp> click({ selector: "#continue", visual_reason: "Completing checkout", client: "OpenClaw" })
```

Each call here re-arms the timer to 60 seconds from its own dispatch. If 60 seconds pass with no further action call, the overlay auto-clears -- no explicit end call is required.

Callers may repeat the same `visual_reason` across the sequence (as above) or vary it per call to surface step-level overlay text to the user. The `client` value MUST stay on the v0.9.36 allowlist for the whole sequence; cross-client switching on the same tab still rejects with the existing `TAB_NOT_OWNED` ownership gate from v0.9.60.

## Immediate clear with is_final

Set `is_final: true` on the LAST action of a task to clear the overlay immediately after that action's `change_report` resolves -- no 60-second wait.

```
mcp> click({ selector: "#confirm-order", visual_reason: "Confirming order", client: "OpenClaw", is_final: true })
```

`is_final` is the explicit task-completion signal. Use it whenever the task ends on an action call; otherwise the overlay sits for up to 60 seconds before the auto-clear fires. The two clear paths are mutually compatible -- whichever fires first wins. If `is_final` is omitted on the last action and no further action calls follow, the auto-clear fires after 60 seconds of silence.

## Read tools do NOT carry the bundle

Read-only MCP tools (`read_page`, `get_dom_snapshot`, `get_text`, `get_attribute`, `read_sheet`, `get_page_snapshot`, `list_tabs`, `get_site_guide`, `search_memory`, `report_progress`, `complete_task`, `partial_task`, `fail_task`, `wait_for_element`, `wait_for_stable`) do NOT accept `visual_reason`, `client`, or `is_final`. Reads stay silent by design: they do not bring up the overlay, they do not re-arm the sliding window, and they do not clear the overlay.

Concrete contrast -- action tool WITH bundle vs read tool WITHOUT:

```
[ACTION] click({ selector: "#open-menu", visual_reason: "Browsing settings", client: "OpenClaw" })
[READ]   read_page({})
```

The action call brings up (or re-arms) the overlay. The read call slips through silently and does not touch the visual-session state. This split is enforced at the MCP server's schema layer; passing the bundle to a read tool is a schema-layer reject before any work runs.

## Bootstrap: NO_OWNED_TAB

The new contract still goes through the v0.9.60 ownership gate. On the very first call of a fresh agent session there is no owned tab, so an action call rejects with `NO_OWNED_TAB`. Recover by opening a tab first:

```
list_tabs({})                                  // optional: see if anything is already owned
open_tab({ url: "<target>", active: false })   // claim a tab without stealing user focus
click({ selector: "#submit", visual_reason: "...", client: "OpenClaw" })   // now succeeds
```

`open_tab` is itself an action tool, so it also carries the bundle on its call (the `open_tab` call brings up the overlay on the newly opened tab once the page loads enough for the content script to attach).

## Typed errors

Three typed errors guard the contract. Match on the name, not the human-readable body:

| Error                     | Condition                                                                 | Recovery                                                                                              |
|---------------------------|---------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| `VISUAL_FIELDS_REQUIRED`  | Action call missing `visual_reason` or `client`.                          | Add the missing field(s) and retry. Schema-layer reject; no DOM mutation occurs.                      |
| `BADGE_NOT_ALLOWED`       | `client` value not on the v0.9.36 allowlist.                              | Use one of the allowlisted labels listed above (`OpenClaw` for this skill) and retry.                  |

The two error names are pinned by `.planning/v0.9.62-CONTRACT.md` and stay verbatim across surfaces.

## Autopilot exception

If `run_task` (autopilot) is being used, autopilot manages its own internal visual-session lifecycle and is NOT affected by the v0.9.0 implicit-contract change. Do NOT pass field-bundle plumbing through `run_task`. Drive autopilot only when the user explicitly delegates the whole task.

## MV3 service-worker eviction

The sliding-window state is persisted in `chrome.storage.session` and replayed on service-worker wake; the death-timer deadline survives eviction via the v0.9.36 visual-session persistence pattern. Callers do not need to do anything to handle eviction -- the bridge reconciles automatically on reconnect.

## See also

- `USAGE.md` -- "v0.9.62 visual-session contract" section with the user-facing summary.
- `SKILL.md` -- canonical list pointers (action tools / read-only tools / typed errors).
- `references/multi-agent-contract.md` -- ownership errors (`NO_OWNED_TAB`, `TAB_NOT_OWNED`, etc.) that fire before the visual-session lifecycle.
- `references/tool-decision-tree.md` -- which tool to pick first; per-branch field-bundle reminders.
- `.planning/v0.9.62-CONTRACT.md` -- canonical 36 action tools, 15 read-only tools, three typed-error names.
- `mcp/CHANGELOG.md` v0.9.0 -- migration recipe with concrete before/after code.
````

## File: skills/fsb/USAGE.md
size: 12743
sha: 04e98a50210271aa06a69d8ec6c66fae3bbd340f
upstream: https://github.com/fullselfbrowsing/fsb/blob/main/skills/fsb/USAGE.md

````text
# FSB Skill -- Usage

> **v0.9.0 breaking change** -- The explicit `start_visual_session` / `end_visual_session` tools were REMOVED in fsb-mcp-server v0.9.0 (FSB milestone v0.9.62). Action tools now require `visual_reason` + `client` fields in every call (validated against the v0.9.36 badge allowlist). The visual session is created implicitly on the first action call, refreshed on a sliding 60-second window, and cleared by `is_final: true` (immediate) or 60 seconds of silence (auto-clear). The removed names are no longer registered at all. See [`mcp/CHANGELOG.md`](../../mcp/CHANGELOG.md#v0.9.0) and [`mcp/README.md`](../../mcp/README.md#visual-session-lifecycle) for the migration recipe with concrete before/after code.

FSB drives the user's real Chrome via the FSB extension and a local MCP bridge so OpenClaw can run live web tasks (clicks, typing, multi-tab flows, auth-gated reads).

## Who FSB is for

FSB is for tasks that need a real browser session: clicking buttons, typing into forms, multi-tab orchestration, logged-in reads, vault-backed credentials, or anything that depends on live page state rendered after JavaScript. If a request mentions a real website and a user action, prefer FSB tools.

The carve-out: public-doc reads, JSON endpoints, and RSS feeds that do not require interaction can stay on WebFetch (see `references/default-to-fsb.md`). Everything else -- click, type, auth, multi-tab, dynamic content -- belongs on FSB.

The goal of this page: get a new user from a clean machine to a green doctor in under five minutes.

## Install (3 steps)

1. **Install the FSB Chrome extension.**

   Primary path -- Chrome Web Store. Paste this URL into Chrome's address bar and click `Add to Chrome`:

   ```
   https://chromewebstore.google.com/detail/badgafnfchcihdfnjneklogedcdkmjfk
   ```

   Fallback path -- GitHub Releases. If the Web Store listing is unavailable in your region, download the latest `.zip` from the releases page, unzip it, then load it unpacked at `chrome://extensions` with `Developer mode` toggled on:

   ```
   https://github.com/fullselfbrowsing/FSB/releases
   ```

   For an unpacked install, record the extension ID shown on `chrome://extensions`; changing the install path or browser profile can change that ID. Branded Chrome 137 no longer accepts `--load-extension`; use the **Load unpacked** button. [Chrome for Testing and Chromium still support the flag](https://groups.google.com/a/chromium.org/g/chromium-extensions/c/1-g8EFx2BBY/m/S0ET5wPjCAAJ).

   This skill prints the URL for the user to click. It does NOT auto-launch the browser to that URL.

2. **Install the FSB MCP server config.**

   Print the canonical OpenClaw stdio block and paste it into your MCP host config, then restart the host:

   ```
   node scripts/print-stdio.mjs
   ```

   To discover other supported hosts on the machine (Claude Desktop, Cursor, etc.), run:

   ```
   npx -y fsb-mcp-server@latest install --list
   ```

   Then run the host-specific installer, for example:

   ```
   npx -y fsb-mcp-server@latest install --claude-desktop
   ```

   Notes:
   - What these commands do: each invocation spawns the `fsb-mcp-server` Node package via npx. `install --list` only prints detected MCP hosts and exits. `install --<host>` writes the FSB stdio block into that host's MCP config file and nothing else. Run only the host installers you actually want configured; decline prompts otherwise.
   - By default, `npx -y fsb-mcp-server@latest` resolves to the latest published bridge so security fixes ship without re-running the installer. If you prefer review-before-upgrade, pin a release by replacing `fsb-mcp-server` with `fsb-mcp-server@x.y.z` (see releases at `https://www.npmjs.com/package/fsb-mcp-server`) in the stdio block printed by `node scripts/print-stdio.mjs` and in any host-specific install command. The bridge accepts the same arguments either way.
   - Zero environment variables are needed. Vault values (passwords, payment methods) resolve inside the FSB Chrome extension's encrypted storage and never cross into the MCP server process or the OpenClaw host process. See `references/vault-boundary.md` for the boundary rules.

3. **Verify with the doctor.**

   ```
   node scripts/doctor.mjs
   ```

   Expect six `[OK]` lines, one per layer (`package`, `bridge`, `extension`, `active-tab`, `content-script`, `config`). If any layer prints `[FAIL]`, jump to the recovery table below in the section "Recover when the doctor fails".

## Try it

Once the doctor is green, paste any of these into your OpenClaw chat to confirm the loop works.

### Manual mode (default)

Manual-mode prompts are the default entry point. Each one calls a single FSB tool so you can see the round-trip plainly.

- Exercise `read_page`: "Open https://example.com and read the page. Summarize the visible text in two sentences."
- Exercise `click`: "On https://example.com, click the 'More information...' link and tell me what page loads."
- Exercise `type_text`: "Open https://duckduckgo.com, type `fsb-mcp-server` into the search box, and press Enter. Then list the first three result titles."

### Autopilot (explicit delegation only)

NEVER call `run_task` (autopilot) unless the user has explicitly said something like "use FSB autopilot", "delegate this to FSB", "run the whole task autonomously", or named `run_task` directly. Manual mode tools (`read_page`, `click`, `type_text`, `press_enter`, etc.) are the default for everything else, including tasks with many steps. If the user has not asked for autopilot, drive each step yourself with manual mode tools and observe the result before the next step.

When the user does explicitly delegate, autopilot hands the full plan and execute loop to FSB. Example invocation:

- Exercise `run_task`: "Use FSB autopilot to find the first GitHub repo for `fsb-mcp-server` and report a one paragraph summary of its README."

Autopilot is NOT the default entry point. Read the user's message again before reaching for `run_task`. If delegation language is missing, stay in manual mode.

## v0.9.62 visual-session contract

FSB shows a trusted client badge and an orange element targeting overlay on the user's tab while a tool sequence is running, so the user can see what is being driven. OpenClaw is a trusted client. As of fsb-mcp-server v0.9.0 (milestone v0.9.62) the visual session is IMPLICIT: every action tool call carries the field bundle (`visual_reason`, `client`, optional `is_final`), and the lifecycle is driven by those fields alone. There is no `start_visual_session` / `end_visual_session` pairing to write.

Three rules govern the bundle:

- **`visual_reason`** -- short human-readable string shown in the overlay (for example, `"Completing checkout"`). Required on every action tool call.
- **`client`** -- allowlisted badge label. Required on every action tool call. The shared allowlist accepts: `Claude`, `Codex`, `ChatGPT`, `Perplexity`, `Cursor`, `Antigravity`, `OpenCode`, `OpenClaw`, `Grok`, `Gemini`, `Hermes`, `Cline`, `Continue`, `Zed`, `VS Code`, `Copilot`, `JetBrains`, `Xcode`, `Eclipse`, `Cody`, `Roo Code`, `Kiro`, `Goose`, `Muse`, `Grok Bot`, `Dots`. Freeform strings reject with `BADGE_NOT_ALLOWED`. The skill ships as part of OpenClaw, so the canonical `client` value for this surface is `OpenClaw`.
- **`is_final`** -- optional boolean. Set `true` on the LAST action of a task to clear the overlay immediately after that action's `change_report` resolves. Default `false`.

Read-only tools (`read_page`, `get_dom_snapshot`, `get_text`, `get_attribute`, `read_sheet`, `get_page_snapshot`, `list_tabs`, `get_site_guide`, `search_memory`, `report_progress`, `complete_task`, `partial_task`, `fail_task`, `wait_for_element`, `wait_for_stable`) do NOT carry the bundle and do NOT re-arm the sliding window. Reads stay silent by design. The newer `stop_trigger`, `get_trigger_status`, and `list_triggers` tools are also read-only and bundle-exempt, but are a separate family from this pinned 15-tool list -- see the Addendum in `.planning/v0.9.62-CONTRACT.md`.

### Example 1 -- action call with the implicit visual session

```
mcp> click({ selector: "#submit", visual_reason: "Completing checkout", client: "OpenClaw" })
```

The overlay glow appears on the active tab with the supplied reason. Subsequent action calls within 60 seconds re-arm the death timer (sliding window). After 60 seconds of silence, the overlay clears automatically.

### Example 2 -- final action of a task (is_final clear)

```
mcp> click({ selector: "#confirm-order", visual_reason: "Confirming order", client: "OpenClaw", is_final: true })
```

The overlay clears immediately after the underlying click completes -- no 60-second wait.

### Typed errors

Three typed errors guard the contract; match on the name, not the human-readable body:

- **`VISUAL_FIELDS_REQUIRED`** -- raised when an action call is missing `visual_reason` or `client`. Schema-layer reject; no DOM mutation occurs.
- **`BADGE_NOT_ALLOWED`** -- raised when `client` is not on the v0.9.36 allowlist. Use one of the labels above.

### Autopilot exception

If `run_task` (autopilot) is being used, autopilot manages its own internal visual-session lifecycle and is NOT affected by the v0.9.0 implicit-contract change. Do NOT wrap a `run_task` call in your own field-bundle plumbing.

For lifecycle details, the sliding-window mechanics, the read-tool vs action-tool split, and the `NO_OWNED_TAB` bootstrap, see `references/visual-session-lifecycle.md`. The canonical action-tool list (37 tools as of the 2026-06-17 `upload_file` addendum), the read-only list (15 tools), and the typed-error catalogue live in `.planning/v0.9.62-CONTRACT.md`. Trigger watchers (`trigger`, `stop_trigger`, `get_trigger_status`, `list_triggers`) and capability tools (`search_capabilities`, `invoke_capability`) are separate tool families entirely outside this field-bundle contract -- see `references/tool-decision-tree.md` for when to reach for them.

## Recover when the doctor fails

Each `[FAIL]` from `node scripts/doctor.mjs` maps to one of six layers. Find your symptom in the table below, run the action, and re-run the doctor until you see all six layers green.

| Layer | What it means | What to do |
| --- | --- | --- |
| package | npm cannot fetch `fsb-mcp-server`. | Run `npx -y fsb-mcp-server@latest --version` to confirm npm can reach the package. If that fails, check Node 18+ is installed and on PATH. |
| bridge | The extension is not running, or `ws://localhost:7225` is not reachable. | Start the FSB extension (open Chrome with the extension installed) and run `npx -y fsb-mcp-server@latest status --watch` to confirm `ws://localhost:7225` is reachable. |
| extension | The FSB Chrome extension is not installed. | Install from `https://chromewebstore.google.com/detail/badgafnfchcihdfnjneklogedcdkmjfk` (fallback: GitHub Releases at `https://github.com/fullselfbrowsing/FSB/releases`), then reopen this session. |
| active-tab | The active tab is restricted (`chrome://`, `edge://`, the Web Store) or no tab is owned by the agent. | Open a normal `http(s)` tab (not `chrome://`, `edge://`, or the Web Store) and run `npx -y fsb-mcp-server@latest status --watch` to re-attach. See `references/restricted-tab-recovery.md` for the recovery toolset. |
| content-script | The content script did not attach (extension installed after the tab loaded). | Reload the active tab. The FSB content script attaches on page load; reloads after extension install are required. |
| config | The MCP host config does not include the FSB stdio block. | Re-run `npx -y fsb-mcp-server@latest install --<host>` for your MCP host (replace `<host>` with `claude-desktop`, `cursor`, etc.). Or paste the block printed by `node scripts/print-stdio.mjs` into your host config. |

Re-run `node scripts/doctor.mjs` after each fix. If a layer keeps flipping or you see `[WARN]`, capture the raw output and file an issue at `https://github.com/fullselfbrowsing/FSB/issues`.

For MCP attachment problems, `npx -y fsb-mcp-server@latest doctor` shows the attached extension ID, extension version, install instance ID, connection time, and normal-window count. `NO_BROWSER_WINDOW` means to open a normal window in that profile. `ORIGIN_PIN_MISMATCH` means to run `npx -y fsb-mcp-server@latest pair --reset` and pair again. Only one browser profile holds the bridge attachment at a time; the MCP server and extension are versioned independently. Local HTTP `serve` accepts loopback clients only. After an HTTP restart, reconnect the client to the printed endpoint. If a page read returns `PAGE_UNRESPONSIVE`, recover with `navigate` or `close_tab`; inspect state before repeating an uncertain mutation.
````
