Skip to content

docs: smoke-test Visibility wrappers for .md export links#792

Open
leo-notte wants to merge 5 commits into
mainfrom
experiment/visibility-md-links
Open

docs: smoke-test Visibility wrappers for .md export links#792
leo-notte wants to merge 5 commits into
mainfrom
experiment/visibility-md-links

Conversation

@leo-notte
Copy link
Copy Markdown
Contributor

@leo-notte leo-notte commented Apr 30, 2026

Summary

  • Wraps one Card (Sessions) and one inline link (API Reference) on docs/src/index.mdx in <Visibility for="humans"> / <Visibility for="agents"> pairs.
  • The agents variant uses .md-suffixed hrefs so the markdown export points to other .md pages instead of bare HTML paths.
  • Smoke test only — not intended to merge as-is.

Why

The .md exports from Mintlify (e.g. https://docs.notte.cc/sdk-reference/manual/index.md) preserve internal hrefs as /path — they don't get auto-rewritten to /path.md. That breaks chained markdown navigation for AI tooling. The Mintlify dev server doesn't serve the .md export locally, so we need a preview deploy to verify whether <Visibility for="agents"> actually filters JSX components like <Card> (the docs only show it filtering paragraph text).

Test plan

  • Open the Mintlify preview for this PR.
  • Visit <preview>/ (HTML) — confirm the rendered page is visually unchanged: one Sessions Card, inline "API Reference" link.
  • Visit <preview>/index.md (markdown) — confirm the Sessions entry's href is /concepts/sessions.md and the inline link is /api-reference/authentication.md. Confirm there is exactly one of each (no duplicates).
  • If both pass: we can move forward with building a preprocessor to apply this pattern across all 855 MDX files.
  • If either fails: investigate whether Visibility filters at the link level vs the block level, and adjust the strategy.

🤖 Generated with Claude Code


Note

Wraps internal MDX links and <Card> hrefs in <Visibility for="humans"> / <Visibility for="agents"> pairs across hand-authored docs and the sphinx-generated SDK reference. The agent variant uses .md-suffixed hrefs so the markdown export at /<page>.md links to other .md exports rather than bare HTML paths. Adds docs/src/scripts/wrap_md_links.py as an idempotent preprocessor with --dry-run support.

Written by Mendral for commit dd3ce4a.

Summary by CodeRabbit

  • Documentation

    • Updated documentation links to automatically adapt based on viewer type (human users vs. AI agents), with each audience directed to the most appropriate documentation format
    • SDK references, guides, features, and concepts documentation now include audience-specific navigation links
    • Expanded coverage across integrations and pricing documentation
  • Chores

    • Added automated tooling to manage audience-specific documentation links

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Walkthrough

This pull request implements role-based URL routing across the documentation by wrapping internal markdown links and Card components in <Visibility> blocks. Each affected link is conditionally rendered with different href targets: users receive extensionless routes (e.g., /concepts/sessions), while agents receive .md-suffixed routes (e.g., /concepts/sessions.md). A new automation script (wrap_md_links.py) is introduced to systematically apply this transformation to MDX files, handling inline links, Card components, code block exclusions, and existing wrapper boundaries. The changes span 100+ documentation files across concepts, features, SDK references, integrations, and guides.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main objective: adding/testing Visibility wrappers for markdown export links with .md suffixes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch experiment/visibility-md-links

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@mintlify
Copy link
Copy Markdown

mintlify Bot commented Apr 30, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Nottelabs 🟢 Ready View Preview Apr 30, 2026, 12:47 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

This smoke-test PR applies a <Visibility for="humans">/<Visibility for="agents"> wrapper pattern across 122 MDX files, where the agents variant carries .md-suffixed hrefs for Mintlify's markdown export. It also introduces wrap_md_links.py, the script that produced the bulk of the changes, as a reusable preprocessor for the remaining ~730 files.

  • EXCLUDE_HREFS = {\"/api-reference\"} only blocks the exact path, not subpaths — any OpenAPI-rendered link such as /api-reference/sessions/create would pass is_excluded and receive a .md suffix that doesn't exist on the deployed site, producing broken agent navigation when the script is run more broadly.

Confidence Score: 4/5

Safe to merge as an acknowledged smoke-test branch; the EXCLUDE_HREFS bug does not affect the current output but must be fixed before the script is applied to the full corpus.

One P1 logic defect exists in the script (EXCLUDE_HREFS prefix matching), but it has no impact on the 122 files already changed in this PR because the only /api-reference link present (/api-reference/authentication) is one of the 3 hand-authored pages that do have .md exports. The PR is explicitly labelled not-for-merge-as-is, capping confidence at 4.

docs/src/scripts/wrap_md_links.py — the is_excluded function needs prefix-based exclusion for /api-reference/* before the script is used at scale.

Important Files Changed

Filename Overview
docs/src/scripts/wrap_md_links.py New preprocessor script that wraps internal links and Card hrefs with Visibility pairs. Core logic is sound (reverse-order card transforms, idempotency check, code-region skipping), but EXCLUDE_HREFS only blocks the exact path "/api-reference" rather than the entire "/api-reference/*" subtree, which will produce broken .md links for OpenAPI-rendered endpoints when run on the remaining ~730 MDX files.
docs/src/index.mdx All Cards and inline links wrapped with Visibility human/agent pairs; agent variant carries .md-suffixed hrefs. The core smoke-test change for this PR.
docs/src/changelog.mdx Inline links in changelog entries wrapped with Visibility pairs by the script; output looks correct.
docs/src/quickstart.mdx Card hrefs for Sessions, Agents, and Scraping wrapped with Visibility pairs; transformations are consistent.

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
docs/src/scripts/wrap_md_links.py:43-66
**`EXCLUDE_HREFS` only matches the exact root path, not subpaths**

The comment explains that `/api-reference` is OpenAPI-rendered and "only the 3 hand-authored subpages have .md exports" — but `is_excluded` only blocks the path `"/api-reference"` exactly. Any link like `/api-reference/sessions/create` or any other OpenAPI-rendered endpoint would pass the check and receive a `.md` suffix that doesn't exist on the deployed site, producing broken agent navigation when the script is run more broadly.

This is fine for the current smoke-test output (the only api-reference link wrapped here is `/api-reference/authentication`, one of the 3 hand-authored pages), but will silently break agent-facing links for every OpenAPI endpoint reference encountered when the script is applied to the remaining ~730 MDX files.

```python
EXCLUDE_HREFS_EXACT = {"/api-reference"}
EXCLUDE_HREF_PREFIXES = ("/api-reference/",)

def is_excluded(path: str) -> bool:
    base = path.split("#", 1)[0].split("?", 1)[0]
    return base in EXCLUDE_HREFS_EXACT or base.startswith(EXCLUDE_HREF_PREFIXES)
```

The 3 hand-authored subpages that do have `.md` exports could be opted back in via an explicit `INCLUDE_HREFS` allowlist.

Reviews (2): Last reviewed commit: "docs: include sdk-reference manual pages..." | Re-trigger Greptile

Comment thread docs/src/index.mdx
@2027-evals
Copy link
Copy Markdown

2027-evals Bot commented Apr 30, 2026

✅ Eval complete for commit dd3ce4a

URL Mapping
docs.notte.cc notte-experiment-visibility-md-links.mintlify.app

Ran evals with prompts:

-0.4 pts · Getting Started — B (79.9/100) from B (80.3) · View metrics

Prompt text:

Use Notte to run a headless browser session. Follow the quickstart at https://notte.cc/ to set up a project that:

  1. Creates a cloud browser session
  2. Connects to it using Playwright, Puppeteer, or the Notte SDK
  3. Navigates to https://news.ycombinator.com
  4. Extracts the titles of the top 5 stories
  5. Prints them to stdout

Verdict:

Notte delivers a smooth, nearly frictionless DX for browser automation — strong SDK, working OpenAPI spec, and an MCP server — held back only by a quickstart page that isn't fully AI-readable in one shot and a missing Context7 index entry.

Friction points:

  • 🟡 The quickstart page at docs — .notte.cc/quickstart did not return complete code examples on the first WebFetch — the agent needed three separate fetches with increasingly specific prompts to extract all code snippets verbatim, suggesting the page may be JavaScript-rendered or paginated in a way that truncates AI-accessible content.
  • 🟡 The docs do not pre-warn that playwright install chromium is required after pip install playwright, which could catch new users off-guard in environments without a pre-installed browser — .

Result: B (79.9/100)

delta vs baseline: -0.4 pts

Dimension Baseline This PR
Setup Friction 86 86
Speed 78 83
Efficiency 62 64
Error Recovery 100 100
Doc Quality 80 70

Stats: 2m 7s · 15 tool calls · 0 errors · 1 interruption · $0.69

View report → · View trace →


Evaluating agent experience using 2027.dev · View dashboard

leo-notte and others added 4 commits April 30, 2026 03:42
Wraps one Card and one inline link in <Visibility for="humans"|"agents">
on index.mdx with .md-suffixed hrefs in the agent variant. Goal is to
verify on a preview deploy that the markdown export at /index.md only
contains the .md-suffixed copy and the rendered HTML at / only contains
the bare-path copy.

If this works, we can build a preprocessor that emits these wrapper
pairs across the docs so relative links in the .md export point to
other .md pages instead of HTML pages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds docs/src/scripts/wrap_md_links.py and runs it across hand-authored
MDX. Inline markdown links and <Card> hrefs that point to internal
pages now get a <Visibility for="humans"> / <Visibility for="agents">
pair — the agent variant uses an .md-suffixed href so the markdown
export at /<page>.md emits links that themselves point to other .md
exports instead of the HTML pages.

Scope: hand-authored MDX only. sdk-reference/ (sphinx_mintlify-generated)
and snippets/ (sniptest-generated) are excluded from this run; they'll
get the same treatment via their respective generators in a follow-up.

The script is idempotent (skips already-wrapped links) and supports
--dry-run and --path for spot checks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Regenerated docs/src/sdk-reference/ against a local sphinx_mintlify
build that emits <Visibility for="humans"> / <Visibility for="agents">
pairs around generated internal links — same pattern as the prior
commit applied to hand-authored MDX. The agent variant uses .md-suffixed
hrefs so the markdown export at /<page>.md links to other .md exports
instead of HTML pages.

Two kinds of changes in this regen:

  * 123 Method Cards wrapped (the <CardGroup> on every class index page).
  * 80 inline type-annotation links wrapped (e.g. [`AgentStatusResponse`]
    in return-type docs).

It also fixes a pre-existing sphinx_mintlify bug where 7 call sites
emitted [Class]{path} (curly braces, not parens) instead of a real
markdown link. That literal-text-with-URL output is now a wrapped
markdown link, which is why the diff is bigger than just the
Visibility wrapping.

The sphinx_mintlify changes themselves live in the sphinx_mintlify
repo and need to be published to PyPI before merging this; instructions
are at sphinx_mintlify's MD_EXPORT_VISIBILITY.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The first preprocessor pass wrapped two patterns it shouldn't have, both
flagged by the broken-link checker:

  * Image links — the inline-link regex matched the [alt](src) portion
    of ![alt](src), producing !<Visibility>...</Visibility> with .md
    appended to image filenames (e.g. /images/bua.png.md). Fix: regex
    now requires no preceding ! via negative lookbehind.

  * /api-reference Cards — that root path is an OpenAPI-rendered hub
    page. Mintlify generates it at runtime and doesn't expose a .md
    export, so /api-reference.md returns 404. Fix: an EXCLUDE_HREFS
    set the script consults before wrapping; /api-reference is the
    only entry for now.

Also reverts the 6 sites that were already incorrectly wrapped: 4
image links (concepts/bua, concepts/personas, concepts/vaults,
integrations/mcp) and 2 /api-reference Cards (features/sessions/puppeteer,
features/functions/invocations).

A dry-run on the full corpus after these changes is a no-op, confirming
the exclusions land only the wrapping that should be there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The earlier preprocessor pass excluded sdk-reference/ wholesale, which
also skipped the 12 hand-authored pages there: 3 root files
(authentication, errors, rate-limits) and 9 under sdk-reference/manual/
(agent, agent_fallback, file_storage, function, index, persona, session,
vault, workflow). Those .md exports were the user-visible regression.

While running on the broader sdk-reference/ tree, two latent bugs
surfaced and are fixed in this commit:

  * Inline-link regex matched across <Visibility> wrapper boundaries
    in sphinx-gen output like `list[<Visibility>...</Visibility>,
    <Visibility>...</Visibility>]` — the outer `[` was unwrapped, the
    inner `]` was inside a wrapper, so the regex captured a span that
    crossed the boundary. Fix: an overlaps_any_region check rejects
    matches whose start is outside but end is inside (or vice versa).

  * Cards in sdk-reference/remoteworkflow/* and a handful of "## Returns"
    inline links in other sphinx-gen pages were unwrapped because the
    prior sphinx_mintlify regen used a stale build cache (and the
    Returns-formatter is a code path that still needs wrapping in
    sphinx_mintlify). Until the next clean regen, the preprocessor
    wraps them — output is functionally identical and a future regen
    will replace them.

Net: 17 files changed, 20 inline links + 17 Cards wrapped. Dry-run is
a no-op. The sphinx_mintlify TODO in /home/lboesinger/github/work/
sphinx_mintlify/MD_EXPORT_VISIBILITY.md still applies.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@mendral-app mendral-app Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs attention

The CI failure is expected and intentional — the docs-sdk-generate pre-commit hook re-runs sphinx-build with the current (old) sphinx_mintlify and produces different output than what's committed, because the new sphinx_mintlify with Visibility wrappers hasn't been published to PyPI yet. The commit message explicitly calls this out. One bug to fix before the preprocessor runs at scale: reindent_block in wrap_md_links.py:180 always prepends exactly " " (2 spaces) to lines after the first, ignoring base_indent — Cards nested deeper than 2 spaces will get malformed indentation. Fix: out.append(inner + ln if ln.strip() else ln) for each subsequent line.

Tag @mendral-app with feedback or questions. View session

Comment on lines +43 to +66
# Hrefs whose .md export doesn't exist on the deployed site, so wrapping
# would produce broken links. /api-reference is OpenAPI-rendered by Mintlify
# at runtime — only the 3 hand-authored subpages have .md exports.
EXCLUDE_HREFS = {"/api-reference"}

VIS_HUMANS_OPEN = '<Visibility for="humans">'
VIS_AGENTS_OPEN = '<Visibility for="agents">'
VIS_CLOSE = "</Visibility>"

# Negative lookbehind on `!` so we don't match the `[alt](src)` portion of
# an `![alt](src)` image — those should stay as plain markdown images.
INLINE_LINK_RE = re.compile(r"(?<!!)\[(?P<text>[^\]\n]+)\]\((?P<path>/[^)\s]*)\)")
CARD_OPEN_RE = re.compile(r'<Card\b[^>]*?\shref="(?P<path>/[^"]+)"[^>]*>')
VIS_OPEN_RE = re.compile(r'<Visibility\s+for="[^"]+"\s*>')


def is_external(path: str) -> bool:
return "://" in path or path.startswith(("mailto:", "tel:", "#"))


def is_excluded(path: str) -> bool:
"""Path resolves to a page that doesn't have a working .md export."""
base = path.split("#", 1)[0].split("?", 1)[0]
return base in EXCLUDE_HREFS
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 EXCLUDE_HREFS only matches the exact root path, not subpaths

The comment explains that /api-reference is OpenAPI-rendered and "only the 3 hand-authored subpages have .md exports" — but is_excluded only blocks the path "/api-reference" exactly. Any link like /api-reference/sessions/create or any other OpenAPI-rendered endpoint would pass the check and receive a .md suffix that doesn't exist on the deployed site, producing broken agent navigation when the script is run more broadly.

This is fine for the current smoke-test output (the only api-reference link wrapped here is /api-reference/authentication, one of the 3 hand-authored pages), but will silently break agent-facing links for every OpenAPI endpoint reference encountered when the script is applied to the remaining ~730 MDX files.

EXCLUDE_HREFS_EXACT = {"/api-reference"}
EXCLUDE_HREF_PREFIXES = ("/api-reference/",)

def is_excluded(path: str) -> bool:
    base = path.split("#", 1)[0].split("?", 1)[0]
    return base in EXCLUDE_HREFS_EXACT or base.startswith(EXCLUDE_HREF_PREFIXES)

The 3 hand-authored subpages that do have .md exports could be opted back in via an explicit INCLUDE_HREFS allowlist.

Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/src/scripts/wrap_md_links.py
Line: 43-66

Comment:
**`EXCLUDE_HREFS` only matches the exact root path, not subpaths**

The comment explains that `/api-reference` is OpenAPI-rendered and "only the 3 hand-authored subpages have .md exports" — but `is_excluded` only blocks the path `"/api-reference"` exactly. Any link like `/api-reference/sessions/create` or any other OpenAPI-rendered endpoint would pass the check and receive a `.md` suffix that doesn't exist on the deployed site, producing broken agent navigation when the script is run more broadly.

This is fine for the current smoke-test output (the only api-reference link wrapped here is `/api-reference/authentication`, one of the 3 hand-authored pages), but will silently break agent-facing links for every OpenAPI endpoint reference encountered when the script is applied to the remaining ~730 MDX files.

```python
EXCLUDE_HREFS_EXACT = {"/api-reference"}
EXCLUDE_HREF_PREFIXES = ("/api-reference/",)

def is_excluded(path: str) -> bool:
    base = path.split("#", 1)[0].split("?", 1)[0]
    return base in EXCLUDE_HREFS_EXACT or base.startswith(EXCLUDE_HREF_PREFIXES)
```

The 3 hand-authored subpages that do have `.md` exports could be opted back in via an explicit `INCLUDE_HREFS` allowlist.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/src/features/sessions/puppeteer.mdx (1)

143-180: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Wrap the API Reference card too.

The other Next Steps cards now branch by audience, but this final internal card still points to the bare route for agents. That leaves the export inconsistent with the rest of the block.

Suggested fix
-  <Card title="API Reference" icon="code" href="/api-reference">
-    Explore the Notte REST API
-  </Card>
+  <Visibility for="humans">
+    <Card title="API Reference" icon="code" href="/api-reference">
+      Explore the Notte REST API
+    </Card>
+  </Visibility>
+  <Visibility for="agents">
+    <Card title="API Reference" icon="code" href="/api-reference.md">
+      Explore the Notte REST API
+    </Card>
+  </Visibility>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/features/sessions/puppeteer.mdx` around lines 143 - 180, The API
Reference Card inside CardGroup is not wrapped with Visibility like the other
entries; duplicate the final Card into two Visibility-wrapped variants
(Visibility for="humans" and Visibility for="agents") so each audience gets the
correct hrefs (/api-reference for humans and /api-reference.md for agents),
using the existing Card component title "API Reference" and icon "code" to match
the pattern used for Playwright/Selenium/External Browser Providers.
docs/src/sdk-reference/misc/domnode.mdx (1)

20-200: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

The DomNode return links are updated well overall, but find() still needs the same treatment.

InteractionDomNode | None is still unwrapped, so agents will miss the .md route for that type and the page stays inconsistent with the rest of the file.

♻️ Suggested fix
-`InteractionDomNode | None`
+<Visibility for="humans">[`InteractionDomNode`](/sdk-reference/misc/interactiondomnode)</Visibility><Visibility for="agents">[`InteractionDomNode`](/sdk-reference/misc/interactiondomnode.md)</Visibility> | None
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/sdk-reference/misc/domnode.mdx` around lines 20 - 200, The find()
return documentation still shows "InteractionDomNode | None" without the
Visibility links used elsewhere; update the find() Returns section so the
InteractionDomNode part uses the same dual Visibility format as other entries
(e.g., <Visibility
for="humans">[`InteractionDomNode`](/sdk-reference/misc/interactiondomnode)</Visibility><Visibility
for="agents">[`InteractionDomNode`](/sdk-reference/misc/interactiondomnode.md)</Visibility>)
and keep the union with None (e.g., ...] | None) so agents get the .md route and
the page matches the rest of the file.
🧹 Nitpick comments (1)
docs/src/scripts/wrap_md_links.py (1)

187-200: ⚡ Quick win

Skip self-closing <Card ... /> tags before close-tag matching.

transform_cards() assumes paired <Card>...</Card> blocks. Adding a quick guard for self-closing tags avoids accidental cross-block capture if those appear.

Suggested hardening
     for m in matches:
         open_start = m.start()
         if in_any_region(open_start, code_regions) or in_any_region(open_start, vis_regions):
             continue
+        if m.group(0).rstrip().endswith("/>"):
+            continue
         path = m.group("path")
         if is_external(path) or is_excluded(path):
             continue
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/scripts/wrap_md_links.py` around lines 187 - 200, transform_cards()
currently assumes every CARD_OPEN_RE match is a paired <Card>... so before
attempting to find a close tag skip self-closing matches: in the loop over
matches (the variable m from CARD_OPEN_RE.finditer(text)) check whether the
matched opening tag is self-closing (e.g., the matched text ends with "/>" or
via a dedicated "self_close" capture group) and continue if so; this prevents
calling find_matching_card_close(new, m.end()) for singleton <Card ... /> tags
and avoids cross-block capture.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/src/guides/scraping.mdx`:
- Line 14: Replace the incorrect verb “checkout” in the sentence fragment "For
detailed usage, checkout the <Visibility ...>[Scrape API Reference]..." with the
two-word verb form "check out" so the sentence reads "For detailed usage, check
out the <Visibility ...>[Scrape API Reference]..." (locate the string in
docs/src/guides/scraping.mdx).

---

Outside diff comments:
In `@docs/src/features/sessions/puppeteer.mdx`:
- Around line 143-180: The API Reference Card inside CardGroup is not wrapped
with Visibility like the other entries; duplicate the final Card into two
Visibility-wrapped variants (Visibility for="humans" and Visibility
for="agents") so each audience gets the correct hrefs (/api-reference for humans
and /api-reference.md for agents), using the existing Card component title "API
Reference" and icon "code" to match the pattern used for
Playwright/Selenium/External Browser Providers.

In `@docs/src/sdk-reference/misc/domnode.mdx`:
- Around line 20-200: The find() return documentation still shows
"InteractionDomNode | None" without the Visibility links used elsewhere; update
the find() Returns section so the InteractionDomNode part uses the same dual
Visibility format as other entries (e.g., <Visibility
for="humans">[`InteractionDomNode`](/sdk-reference/misc/interactiondomnode)</Visibility><Visibility
for="agents">[`InteractionDomNode`](/sdk-reference/misc/interactiondomnode.md)</Visibility>)
and keep the union with None (e.g., ...] | None) so agents get the .md route and
the page matches the rest of the file.

---

Nitpick comments:
In `@docs/src/scripts/wrap_md_links.py`:
- Around line 187-200: transform_cards() currently assumes every CARD_OPEN_RE
match is a paired <Card>... so before attempting to find a close tag skip
self-closing matches: in the loop over matches (the variable m from
CARD_OPEN_RE.finditer(text)) check whether the matched opening tag is
self-closing (e.g., the matched text ends with "/>" or via a dedicated
"self_close" capture group) and continue if so; this prevents calling
find_matching_card_close(new, m.end()) for singleton <Card ... /> tags and
avoids cross-block capture.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e6923e4f-d29c-4b2c-b2e7-c1ba3114d5c0

📥 Commits

Reviewing files that changed from the base of the PR and between 60be49b and dd3ce4a.

📒 Files selected for processing (123)
  • docs/src/changelog.mdx
  • docs/src/concepts/agents.mdx
  • docs/src/concepts/file-storage.mdx
  • docs/src/concepts/functions.mdx
  • docs/src/concepts/scraping.mdx
  • docs/src/concepts/sessions.mdx
  • docs/src/features/agents/configuration.mdx
  • docs/src/features/agents/fallback.mdx
  • docs/src/features/agents/lifecycle.mdx
  • docs/src/features/agents/replay.mdx
  • docs/src/features/agents/structured-output.mdx
  • docs/src/features/agents/workflows.mdx
  • docs/src/features/functions/creating.mdx
  • docs/src/features/functions/invocations.mdx
  • docs/src/features/functions/management.mdx
  • docs/src/features/functions/schedules.mdx
  • docs/src/features/sessions/browser-controls.mdx
  • docs/src/features/sessions/browser-profiles.mdx
  • docs/src/features/sessions/browser-types.mdx
  • docs/src/features/sessions/captcha-solving.mdx
  • docs/src/features/sessions/cloudflare-web-bot-auth.mdx
  • docs/src/features/sessions/configuration.mdx
  • docs/src/features/sessions/cookies.mdx
  • docs/src/features/sessions/external-providers.mdx
  • docs/src/features/sessions/lifecycle.mdx
  • docs/src/features/sessions/live-view.mdx
  • docs/src/features/sessions/playwright-vs-notte.mdx
  • docs/src/features/sessions/playwright.mdx
  • docs/src/features/sessions/puppeteer.mdx
  • docs/src/features/sessions/recordings.mdx
  • docs/src/features/sessions/selenium.mdx
  • docs/src/features/sessions/stealth-mode.mdx
  • docs/src/guides/scraping.mdx
  • docs/src/index.mdx
  • docs/src/integrations/massive.mdx
  • docs/src/integrations/stagehand.mdx
  • docs/src/pricing.mdx
  • docs/src/product/anything-api.mdx
  • docs/src/quickstart.mdx
  • docs/src/rate-limits.mdx
  • docs/src/scripts/wrap_md_links.py
  • docs/src/sdk-reference/agentsclient/arun.mdx
  • docs/src/sdk-reference/agentsclient/arun_custom.mdx
  • docs/src/sdk-reference/agentsclient/async_watch_logs.mdx
  • docs/src/sdk-reference/agentsclient/async_watch_logs_and_wait.mdx
  • docs/src/sdk-reference/agentsclient/create_function.mdx
  • docs/src/sdk-reference/agentsclient/function_code.mdx
  • docs/src/sdk-reference/agentsclient/index.mdx
  • docs/src/sdk-reference/agentsclient/list.mdx
  • docs/src/sdk-reference/agentsclient/replay.mdx
  • docs/src/sdk-reference/agentsclient/run.mdx
  • docs/src/sdk-reference/agentsclient/run_custom.mdx
  • docs/src/sdk-reference/agentsclient/start.mdx
  • docs/src/sdk-reference/agentsclient/status.mdx
  • docs/src/sdk-reference/agentsclient/stop.mdx
  • docs/src/sdk-reference/agentsclient/wait.mdx
  • docs/src/sdk-reference/agentsclient/watch_logs.mdx
  • docs/src/sdk-reference/agentsclient/watch_logs_and_wait.mdx
  • docs/src/sdk-reference/agentsclient/workflow_code.mdx
  • docs/src/sdk-reference/agentsclient/workflow_create.mdx
  • docs/src/sdk-reference/manual/index.mdx
  • docs/src/sdk-reference/misc/agentsclient.mdx
  • docs/src/sdk-reference/misc/domnode.mdx
  • docs/src/sdk-reference/misc/interactiondomnode.mdx
  • docs/src/sdk-reference/misc/mp4replay.mdx
  • docs/src/sdk-reference/misc/nottefunction.mdx
  • docs/src/sdk-reference/misc/nottepersona.mdx
  • docs/src/sdk-reference/misc/nottevault.mdx
  • docs/src/sdk-reference/misc/remotefilestorage.mdx
  • docs/src/sdk-reference/misc/remotesession.mdx
  • docs/src/sdk-reference/misc/remoteworkflow.mdx
  • docs/src/sdk-reference/misc/sessionsclient.mdx
  • docs/src/sdk-reference/notteclient/index.mdx
  • docs/src/sdk-reference/notteclient/scrape.mdx
  • docs/src/sdk-reference/nottefunction/fork.mdx
  • docs/src/sdk-reference/nottefunction/get_run.mdx
  • docs/src/sdk-reference/nottefunction/index.mdx
  • docs/src/sdk-reference/nottefunction/replay.mdx
  • docs/src/sdk-reference/nottefunction/run.mdx
  • docs/src/sdk-reference/nottefunction/stop_run.mdx
  • docs/src/sdk-reference/nottepersona/aemails.mdx
  • docs/src/sdk-reference/nottepersona/asms.mdx
  • docs/src/sdk-reference/nottepersona/create_number.mdx
  • docs/src/sdk-reference/nottepersona/delete_number.mdx
  • docs/src/sdk-reference/nottepersona/emails.mdx
  • docs/src/sdk-reference/nottepersona/index.mdx
  • docs/src/sdk-reference/nottepersona/sms.mdx
  • docs/src/sdk-reference/nottevault/credential_fields_to_dict.mdx
  • docs/src/sdk-reference/nottevault/get_credit_card.mdx
  • docs/src/sdk-reference/nottevault/get_credit_card_async.mdx
  • docs/src/sdk-reference/nottevault/index.mdx
  • docs/src/sdk-reference/nottevault/replace_credentials.mdx
  • docs/src/sdk-reference/remoteagent/arun.mdx
  • docs/src/sdk-reference/remoteagent/async_watch_logs_and_wait.mdx
  • docs/src/sdk-reference/remoteagent/index.mdx
  • docs/src/sdk-reference/remoteagent/replay.mdx
  • docs/src/sdk-reference/remoteagent/run.mdx
  • docs/src/sdk-reference/remoteagent/start.mdx
  • docs/src/sdk-reference/remoteagent/status.mdx
  • docs/src/sdk-reference/remoteagent/stop.mdx
  • docs/src/sdk-reference/remoteagent/wait.mdx
  • docs/src/sdk-reference/remoteagent/watch_logs.mdx
  • docs/src/sdk-reference/remoteagent/watch_logs_and_wait.mdx
  • docs/src/sdk-reference/remoteagentfallback/index.mdx
  • docs/src/sdk-reference/remotefilestorage/index.mdx
  • docs/src/sdk-reference/remotefilestorage/list_downloaded_files.mdx
  • docs/src/sdk-reference/remotefilestorage/list_uploaded_files.mdx
  • docs/src/sdk-reference/remotesession/debug_info.mdx
  • docs/src/sdk-reference/remotesession/execute.mdx
  • docs/src/sdk-reference/remotesession/get_cookies.mdx
  • docs/src/sdk-reference/remotesession/index.mdx
  • docs/src/sdk-reference/remotesession/observe.mdx
  • docs/src/sdk-reference/remotesession/replay.mdx
  • docs/src/sdk-reference/remotesession/scrape.mdx
  • docs/src/sdk-reference/remotesession/set_cookies.mdx
  • docs/src/sdk-reference/remotesession/status.mdx
  • docs/src/sdk-reference/remotesession/viewer_notebook.mdx
  • docs/src/sdk-reference/remoteworkflow/fork.mdx
  • docs/src/sdk-reference/remoteworkflow/get_run.mdx
  • docs/src/sdk-reference/remoteworkflow/index.mdx
  • docs/src/sdk-reference/remoteworkflow/replay.mdx
  • docs/src/sdk-reference/remoteworkflow/run.mdx
  • docs/src/sdk-reference/remoteworkflow/stop_run.mdx


The Scrape API allows you to get the data you want from web pages using a single call. You can scrape page content and capture its data in various formats.
For detailed usage, checkout the [Scrape API Reference](/sdk-reference/remotesession/scrape).
For detailed usage, checkout the <Visibility for="humans">[Scrape API Reference](/sdk-reference/remotesession/scrape)</Visibility><Visibility for="agents">[Scrape API Reference](/sdk-reference/remotesession/scrape.md)</Visibility>.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the wording: “check out” is the verb here.

“Checkout” reads like a noun in this sentence, so switching to “check out” would read more naturally.

♻️ Proposed fix
-For detailed usage, checkout the <Visibility for="humans">[Scrape API Reference](/sdk-reference/remotesession/scrape)</Visibility><Visibility for="agents">[Scrape API Reference](/sdk-reference/remotesession/scrape.md)</Visibility>.
+For detailed usage, check out the <Visibility for="humans">[Scrape API Reference](/sdk-reference/remotesession/scrape)</Visibility><Visibility for="agents">[Scrape API Reference](/sdk-reference/remotesession/scrape.md)</Visibility>.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
For detailed usage, checkout the <Visibility for="humans">[Scrape API Reference](/sdk-reference/remotesession/scrape)</Visibility><Visibility for="agents">[Scrape API Reference](/sdk-reference/remotesession/scrape.md)</Visibility>.
For detailed usage, check out the <Visibility for="humans">[Scrape API Reference](/sdk-reference/remotesession/scrape)</Visibility><Visibility for="agents">[Scrape API Reference](/sdk-reference/remotesession/scrape.md)</Visibility>.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/guides/scraping.mdx` at line 14, Replace the incorrect verb
“checkout” in the sentence fragment "For detailed usage, checkout the
<Visibility ...>[Scrape API Reference]..." with the two-word verb form "check
out" so the sentence reads "For detailed usage, check out the <Visibility
...>[Scrape API Reference]..." (locate the string in
docs/src/guides/scraping.mdx).

Comment on lines +255 to +258
if args.path:
targets = [ROOT / args.path]
else:
targets = [p for p in ROOT.rglob("*.mdx") if is_in_scope(p)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Constrain --path to docs/src and enforce scope checks.

Line 255–Line 257 bypass is_in_scope() and allow absolute/traversal paths, so this command can rewrite files outside intended directories (and outside .mdx scope).

Suggested fix
 def main() -> int:
     p = argparse.ArgumentParser()
@@
     args = p.parse_args()

     if args.path:
-        targets = [ROOT / args.path]
+        root_resolved = ROOT.resolve()
+        target = (ROOT / args.path).resolve()
+        try:
+            target.relative_to(root_resolved)
+        except ValueError:
+            p.error("--path must resolve under docs/src")
+        if target.suffix != ".mdx":
+            p.error("--path must point to an .mdx file")
+        if not target.exists():
+            p.error(f"--path does not exist: {args.path}")
+        if not is_in_scope(target):
+            p.error(f"--path is excluded by scope rules: {args.path}")
+        targets = [target]
     else:
         targets = [p for p in ROOT.rglob("*.mdx") if is_in_scope(p)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant