connect-widget

connect-widget is a cursor rule for Cursor from airweave-ai/airweave. It costs 0 tokens per session (2,604 once invoked), scanned A, original, MIT.

An embeddable interface lets people manage connections to data sources inside another application. It runs in an iframe, a webpage embedded within a webpage, and communicates with the surrounding application.

In plain words
What is it for?
Use it to let users add, reconnect, or manage source connections from within your product.
Why use it?
It avoids building a separate connection-management screen and the messaging needed to integrate it with the host application.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to let users add, reconnect, or manage source connections from within your product.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/airweave-ai/airweave/connect-widget
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/airweave-ai/airweave

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for connect-widget

README.md
[![agentmods](https://agentmods.dev/badge/rules/airweave-ai/airweave/connect-widget/github.svg)](https://agentmods.dev/rules/airweave-ai/airweave/connect-widget)
Your own site
<a href="https://agentmods.dev/rules/airweave-ai/airweave/connect-widget"><img src="https://agentmods.dev/badge/rules/airweave-ai/airweave/connect-widget/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for connect-widget

Your own site · 80×15
<a href="https://agentmods.dev/rules/airweave-ai/airweave/connect-widget"><img src="https://agentmods.dev/badge/rules/airweave-ai/airweave/connect-widget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,604 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02604
Opus 5.5 $0.00000 $0.01042
Sonnet 5.5 $0.00000 $0.00521
Haiku 4.5 $0.00000 $0.00260

Measured 1mo ago against content hash 36242e973554, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

connect-widget scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/connect-widget.mdc · 317 lines

How it starts

The opening of the file, as written. The whole thing — 317 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Airweave Connect Widget Architecture

What is Connect?

The Connect widget is an embeddable component that allows end users to manage their source connections within third-party applications. It runs inside an iframe and communicates with parent applications via postMessage.

Tech Stack & Core Technologies

  • React 19 with TypeScript for type-safe component development
  • Vite for fast development builds and HMR
  • TailwindCSS v4 for styling with CSS-first configuration
  • Base UI (@base-ui/react) for accessible, unstyled primitives
  • Lucide icons for consistent iconography
  • TanStack Router for file-based routing with type safety
  • TanStack Query for server state and data fetching
  • marked for Markdown rendering in form field descriptions (with XSS-safe link renderer)
  • No authentication - relies on session tokens passed from parent

Project Structure

connect/src/
├── components/         # UI components
│   ├── ActionErrorBanner.tsx  # Dismissible inline error banner for action failures
│   ├── ConnectionItem.tsx     # Single connection display (supports reconnect loading state)
│   ├── ConnectionsErrorView.tsx
│   ├── DynamicFormField.tsx   # Dynamic form fields with markdown support
│   ├── EmptyState.tsx         # Dual-layout empty state (rich hero when showConnect=true, simple manage view otherwise)
│   ├── ErrorScreen.tsx        # Full-screen error display
│   ├── FolderSelectionView.tsx # Folder picker wrapper (optional feature)
│   ├── FolderTree.tsx         # Hierarchical folder checkbox tree
│   ├── LoadingScreen.tsx      # Loading spinner (legacy, prefer contextual skeletons)
│   ├── PoweredByAirweave.tsx  # Footer branding
│   ├── SessionProvider.tsx    # Session context provider
│   ├── Skeleton.tsx           # Contextual skeleton loaders (ConnectionItemSkeleton, SourceItemSkeleton, SourceConfigSkeleton)
│   ├── SourceItem.tsx         # Single source in picker
│   ├── SourcesList.tsx        # Source selection grid
│   └── SuccessScreen.tsx      # Main connected state
├── hooks/
│   └── useParentMessaging.ts  # iframe ↔ parent communication
├── lib/
│   ├── api.ts                 # API client with session auth
│   ├── connection-utils.ts    # Connection status helpers
│   ├── env.ts                 # Environment configuration
│   ├── icons.ts               # Icon registry and helpers
│   ├── oauth.ts               # OAuth popup and message handling
│   ├── theme-defaults.ts      # Default theme configuration
│   ├── theme.tsx              # Theme context and CSS variables
│   ├── types.ts               # TypeScript type definitions
│   └── useOAuthFlow.ts        # OAuth flow state management hook
├── routes/
│   ├── __root.tsx             # Root layout
│   ├── index.tsx              # Main entry route
│   └── oauth-callback.tsx     # OAuth callback handler
├── router.tsx                 # TanStack Router setup
├── routeTree.gen.ts           # Auto-generated route tree
└── styles.css                 # Global styles and Tailwind imports

Read the full file on GitHub · 317 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 317 lines · 2,604 tokens per session scan A 36242e973554

Subscribe to this mod's changes

connect-widget is a cursor rule published in the GitHub repository airweave-ai/airweave (6,552 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,604 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.