Skip to content

feat: add the Meta AI provider (0.8.0) (ENG-46) - #16

Merged
rbatista191 merged 2 commits into
mainfrom
eng-46-meta-ai-provider
Nov 29, 2026
Merged

rbatista191 merged 2 commits into
mainfrom
eng-46-meta-ai-provider

Conversation

@rbatista191

@rbatista191 rbatista191 commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Adds the META_AI provider for the page that POST /v1/monitor/meta-ai stores with include.html. Until now the dashboard used the Grok provider for Meta AI, and the Grok rules hide nothing on a Meta AI page.

Cleanup options

Option What it hides Selector
always Log-in and sign-up buttons [data-slot="flexbox"]:has(> * > [data-testid="login-button"])
always Toasts, open dialogs and popovers [data-sonner-toaster], [role="dialog"], [data-radix-popper-content-wrapper]
removeHeader The title bar main [data-scroll-container] > :not(:has([role="feed"]))
removeFooter The prompt box main div:has(composer-render-mark):not(:has([role="feed"]))
removeSidebar The left rail nav[data-slot="sidebar"]
removeSources Citation chips and the Sources button [data-testid="citation-pill"], [data-testid="sources-pill"]
removeLinks, invertColors As in the other providers
  • removeSources keeps the answer text. The entity pills (for example "NASA") are part of the answer and stay.
  • No rule uses a class name: the page classes are Tailwind utilities.
  • The page sets <base href="https://www.meta.ai/">, and the provider keeps it.
  • Detection: three patterns (the base URL, the meta-ai-orbit-logo image, the logged-out composer). A Meta AI page also matches the Perplexity "prose" pattern, so it scores 3 to 1, or 2 to 1 without its base URL. Before this PR, the three captures were detected as PERPLEXITY.

Checks

  • pnpm type-check, pnpm lint, pnpm test: 75/75 pass (43 new).
  • The tests use three real US captures from 2026-11-29 in test/fixtures/meta-ai/ (news with 6 sources, plain, table), because samples/ is gitignored. They add about 260 KB.
  • Headless Chromium screenshots of each page with each option. With all options on, only the question and the answer stay. The Grok provider with the same options hid nothing.
  • Detection of the older samples does not change.

Risks

  • The header and footer rules depend on page structure (role="feed", data-scroll-container, composer-render-mark). A redesign can break them.
  • The cookie-banner and dialog rules are not tested on a real banner, because the US captures have none.

Release

After merge, tag v0.8.0 to publish. Then cloro-dev/dashboard#119 changes the Meta AI htmlProvider from GROK to META_AI.

https://claude.ai/code/session_01Vi9vyc4nPaECMgzccWiEMb

Add META_AI, for the page that POST /v1/monitor/meta-ai stores with
include.html. The rules use roles, data attributes and structure, not
class names, because the page classes are Tailwind utilities.

- Always hidden: the log-in and sign-up buttons, toasts, open dialogs.
- removeHeader: the title bar. removeFooter: the prompt box.
  removeSidebar: the left rail. removeSources: the citation chips and the
  Sources button; the answer text and the entity pills stay.
- The page keeps its own <base href="https://www.meta.ai/">.
- The detector finds the page by its base URL, logo and composer. The
  Perplexity "prose" pattern skips pages from www.meta.ai.

Tests: 43 new tests on three real captures (news with sources, plain,
table) in test/fixtures/meta-ai/, because samples/ is not committed.

Claude-Session: https://claude.ai/code/session_01Vi9vyc4nPaECMgzccWiEMb
Comment thread src/core/detector.ts Fixed
Comment thread src/core/detector.ts Fixed
Revert the www.meta.ai exclusion in the Perplexity pattern, which CodeQL
reported as incomplete URL substring sanitization. Split the Meta AI logo
and composer checks into two patterns instead: a Meta AI page without its
base URL now scores 2 for META_AI and 1 for PERPLEXITY.

Claude-Session: https://claude.ai/code/session_01Vi9vyc4nPaECMgzccWiEMb
@rbatista191
rbatista191 merged commit 011b907 into main Nov 29, 2026
6 checks passed
@rbatista191
rbatista191 deleted the eng-46-meta-ai-provider branch November 29, 2026 22:14
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.

2 participants