Add MCP CTA to dashboard AI chat empty state (#1779)
Some checks are pending
all-good: Did all the other checks pass? / all-good (push) Waiting to run
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Waiting to run
DB migration compat / Check if migrations changed (push) Waiting to run
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Blocked by required conditions
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Blocked by required conditions
DB migration compat / No migration changes (skipped) (push) Blocked by required conditions
Docker Server Build and Push / Docker Build and Push Server (push) Waiting to run
Docker Server Build and Run / docker (push) Waiting to run
Runs E2E API Tests / wait-for-fast-fail (push) Waiting to run
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (mock, 22.x) (push) Blocked by required conditions
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (prod, 22.x) (push) Blocked by required conditions
Runs E2E API Tests with custom port prefix / wait-for-fast-fail (push) Waiting to run
Runs E2E API Tests with custom port prefix / build (22.x) (push) Blocked by required conditions
Runs E2E Fallback Tests / wait-for-fast-fail (push) Waiting to run
Runs E2E Fallback Tests / E2E Fallback Tests (Node ${{ matrix.node-version }}) (22.x) (push) Blocked by required conditions
Fast-fail tests / select-tests (push) Waiting to run
Fast-fail tests / fast-fail-tests (push) Blocked by required conditions
Lint & build / lint_and_build (24) (push) Waiting to run
TOC Generator / TOC Generator (push) Waiting to run

This commit is contained in:
devin-ai-integration[bot] 2026-07-18 23:51:23 -07:00 committed by GitHub
parent 3b0e555879
commit 7ed89a2a9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 47 additions and 5 deletions

View File

@ -557,6 +557,50 @@ const Composer: FC<{ placeholder?: ComposerPlaceholder, autoFocus?: boolean }> =
);
};
/**
* Canonical link to the "set up the Hexclave MCP server" docs. Uses the docs
* base URL when configured (so it points at localhost:8104 in dev) and falls
* back to the public docs site otherwise.
*/
function getMcpDocsUrl(): string {
const base = (getPublicEnvVar("NEXT_PUBLIC_STACK_DOCS_BASE_URL") ?? "https://docs.hexclave.com").replace(/\/$/, "");
return `${base}/guides/getting-started/ai-integration#option-3-mcp`;
}
/**
* Empty-state variant of the agent-eject CTA: an "or" divider followed by a
* card inviting the user to continue the chat in their own coding agent via
* the Hexclave MCP server. Rendered inside the welcome node of general-purpose
* dashboard AI chats, where there is no transcript to copy yet.
*/
export const AgentEjectWelcomeCta: FC = () => {
const mcpDocsUrl = useMemo(() => getMcpDocsUrl(), []);
return (
<div className="mt-8 flex w-full max-w-[280px] flex-col items-center">
<div className="flex w-full items-center gap-3 text-[10px] font-medium uppercase tracking-[0.2em] text-muted-foreground/40">
<div className="h-px flex-1 bg-border/60" />
<span>or</span>
<div className="h-px flex-1 bg-border/60" />
</div>
<a
href={mcpDocsUrl}
target="_blank"
rel="noopener noreferrer"
className="group mt-4 inline-flex items-center gap-2.5 rounded-xl border border-border/60 bg-muted/20 px-3.5 py-2.5 text-center text-xs leading-snug text-muted-foreground transition-colors hover:transition-none hover:border-border hover:bg-muted/50 hover:text-foreground"
>
<PlugsConnectedIcon className="h-4 w-4 shrink-0 text-purple-400" weight="bold" />
<span>
Chat with Hexclave in your own agent with our{" "}
<span className="font-medium text-foreground/80 underline decoration-foreground/20 underline-offset-2 group-hover:decoration-foreground/40">
MCP server
</span>
</span>
</a>
</div>
);
};
function serializeThreadToMarkdown(messages: readonly ThreadMessage[]): string {
const blocks: string[] = [];
for (const message of messages) {
@ -589,10 +633,7 @@ const AgentEjectFooter: FC = () => {
return threadRuntime.subscribe(sync);
}, [threadRuntime]);
const mcpDocsUrl = useMemo(() => {
const base = (getPublicEnvVar("NEXT_PUBLIC_STACK_DOCS_BASE_URL") ?? "https://docs.hexclave.com").replace(/\/$/, "");
return `${base}/guides/getting-started/ai-integration#option-3-mcp`;
}, []);
const mcpDocsUrl = useMemo(() => getMcpDocsUrl(), []);
const hasMessages = messageCount > 0;

View File

@ -4,7 +4,7 @@ import { cn } from "@/components/ui";
import { createUnifiedAiChatAdapter, getFriendlyAiErrorMessage } from "@/components/assistant-ui/chat-stream";
import { ImageAttachmentAdapter } from "@/components/assistant-ui/image-attachment-adapter";
import { MarkdownText } from "@/components/assistant-ui/markdown-text";
import { Thread } from "@/components/assistant-ui/thread";
import { AgentEjectWelcomeCta, Thread } from "@/components/assistant-ui/thread";
import { ToolFallback } from "@/components/assistant-ui/tool-fallback";
import {
createConversation,
@ -547,6 +547,7 @@ function AskAiWelcome() {
<p className="text-xs text-muted-foreground text-center max-w-[260px] leading-relaxed">
Get AI-powered answers about Hexclave, your project, and analytics.
</p>
<AgentEjectWelcomeCta />
</div>
</div>
);