Support web crawl for website replication (PRO) (#1683)

<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added support for the dyad-web-crawl tag to render a Web Crawl UI in
chat, enabling website replication flows. Messages with <dyad-web-crawl>
now show a styled card with crawl details.

- **New Features**
  - Added DyadWebCrawl component with label and updated icon.
  - Updated DyadMarkdownParser to parse and render dyad-web-crawl.

<sup>Written for commit 45903364b5d6cbdcfc5c3a37579e9eda05e01db3.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
This commit is contained in:
Adeniji Adekunle James
2025-11-04 01:09:54 +00:00
committed by GitHub
parent bd14a4ddae
commit 8c1df62875
2 changed files with 40 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import { DyadMcpToolCall } from "./DyadMcpToolCall";
import { DyadMcpToolResult } from "./DyadMcpToolResult"; import { DyadMcpToolResult } from "./DyadMcpToolResult";
import { DyadWebSearchResult } from "./DyadWebSearchResult"; import { DyadWebSearchResult } from "./DyadWebSearchResult";
import { DyadWebSearch } from "./DyadWebSearch"; import { DyadWebSearch } from "./DyadWebSearch";
import { DyadWebCrawl } from "./DyadWebCrawl";
import { DyadRead } from "./DyadRead"; import { DyadRead } from "./DyadRead";
import { mapActionToButton } from "./ChatInput"; import { mapActionToButton } from "./ChatInput";
import { SuggestedAction } from "@/lib/schemas"; import { SuggestedAction } from "@/lib/schemas";
@@ -134,6 +135,7 @@ function preprocessUnclosedTags(content: string): {
"dyad-codebase-context", "dyad-codebase-context",
"dyad-web-search-result", "dyad-web-search-result",
"dyad-web-search", "dyad-web-search",
"dyad-web-crawl",
"dyad-read", "dyad-read",
"think", "think",
"dyad-command", "dyad-command",
@@ -207,6 +209,7 @@ function parseCustomTags(content: string): ContentPiece[] {
"dyad-codebase-context", "dyad-codebase-context",
"dyad-web-search-result", "dyad-web-search-result",
"dyad-web-search", "dyad-web-search",
"dyad-web-crawl",
"dyad-read", "dyad-read",
"think", "think",
"dyad-command", "dyad-command",
@@ -319,6 +322,16 @@ function renderCustomTag(
{content} {content}
</DyadWebSearch> </DyadWebSearch>
); );
case "dyad-web-crawl":
return (
<DyadWebCrawl
node={{
properties: {},
}}
>
{content}
</DyadWebCrawl>
);
case "dyad-web-search-result": case "dyad-web-search-result":
return ( return (
<DyadWebSearchResult <DyadWebSearchResult

View File

@@ -0,0 +1,27 @@
import type React from "react";
import type { ReactNode } from "react";
import { ScanQrCode } from "lucide-react";
interface DyadWebCrawlProps {
children?: ReactNode;
node?: any;
}
export const DyadWebCrawl: React.FC<DyadWebCrawlProps> = ({
children,
node: _node,
}) => {
return (
<div className="bg-(--background-lightest) rounded-lg px-4 py-2 border my-2">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<ScanQrCode size={16} className="text-blue-600" />
<div className="text-xs text-blue-600 font-medium">Web Crawl</div>
</div>
</div>
<div className="text-sm italic text-gray-600 dark:text-gray-300 mt-2">
{children}
</div>
</div>
);
};