Skip to content
Haze UI

AI inline app connect

Inline OAuth connection card inside a chat turn that pauses a tool call, authorizes GitHub and resumes to output a pull request card.

pnpm dlx shadcn@latest add @haze/ai-connect
Open preview in a new tab
Livesmall script

When to use

  • Unblocking an agent tool call that lacks an active third-party app connection without leaving the chat
  • Showing explicit repository permission scopes before a user authorizes GitHub or another integration
  • Automatically resuming a paused action and displaying the created pull request card once connected

When not to use

  • Managing a full settings directory of persistent MCP servers and API keys; use mcp-servers
  • Asking yes/no permission for an already connected local command; use ai-tool-approval

Installation

Add the Haze registry to components.json once, then install AI inline app connect with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/ai-connect
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
idstring"haze-ai-connect"Unique prefix for section heading IDs.
headingstring"Inline app connection"Card header title.
userPromptstring"Open a pull request with the dark mode contrast fix"User request that triggered the paused tool call.
repositorystring"linden-labs/web"Target repository displayed in the tool call and scope note.
providerstring"GitHub"Integration name shown on the embedded connection card.
permissionsstring"Read & write pull requests · No force push"Summary of requested access scopes.
prNumberstring"418"Pull request number rendered after authorization succeeds.
prTitlestring"Fix contrast on dark status chips"Title shown on the resulting pull request link card.
classstring–Extra classes on the outer section.

Keyboard interactions

Tab
Move across Reset, Cancel, Connect GitHub and the resulting View PR link
EnterSpace
Authorize the integration, cancel the paused call or reset the flow

Accessibility

  • Authorization progress, resumed execution, cancellation and reset states announce clearly through a polite role="status" live region.
  • Under prefers-reduced-motion, clicking Connect GitHub completes immediately without intermediate spinner transitions.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI block "AI inline app connect" with `npx shadcn@latest add @haze/ai-connect`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiConnect from "@/components/haze/blocks/ai-connect.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/ai-connect.md

  • Customize with real content

    Adapt the Haze ai-connect block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, repository, provider, permissions, prNumber, prTitle, class. Keep the layout, the heading level rules and these accessibility details: Authorization progress, resumed execution, cancellation and reset states announce clearly through a polite role="status" live region. Under prefers-reduced-motion, clicking Connect GitHub completes immediately without intermediate spinner transitions. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using ai-connect, check it fits: use it when unblocking an agent tool call that lacks an active third-party app connection without leaving the chat; showing explicit repository permission scopes before a user authorizes github or another integration; automatically resuming a paused action and displaying the created pull request card once connected. Avoid it when managing a full settings directory of persistent mcp servers and api keys; use mcp-servers; asking yes/no permission for an already connected local command; use ai-tool-approval. Alternatives: @haze/mcp-servers, @haze/ai-tool-approval, @haze/ai-tool-calls.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog