Unverified 提交 8c1df628 authored 作者: Adeniji Adekunle James's avatar Adeniji Adekunle James 提交者: GitHub

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. -->
上级 bd14a4dd
......@@ -22,6 +22,7 @@ import { DyadMcpToolCall } from "./DyadMcpToolCall";
import { DyadMcpToolResult } from "./DyadMcpToolResult";
import { DyadWebSearchResult } from "./DyadWebSearchResult";
import { DyadWebSearch } from "./DyadWebSearch";
import { DyadWebCrawl } from "./DyadWebCrawl";
import { DyadRead } from "./DyadRead";
import { mapActionToButton } from "./ChatInput";
import { SuggestedAction } from "@/lib/schemas";
......@@ -134,6 +135,7 @@ function preprocessUnclosedTags(content: string): {
"dyad-codebase-context",
"dyad-web-search-result",
"dyad-web-search",
"dyad-web-crawl",
"dyad-read",
"think",
"dyad-command",
......@@ -207,6 +209,7 @@ function parseCustomTags(content: string): ContentPiece[] {
"dyad-codebase-context",
"dyad-web-search-result",
"dyad-web-search",
"dyad-web-crawl",
"dyad-read",
"think",
"dyad-command",
......@@ -319,6 +322,16 @@ function renderCustomTag(
{content}
</DyadWebSearch>
);
case "dyad-web-crawl":
return (
<DyadWebCrawl
node={{
properties: {},
}}
>
{content}
</DyadWebCrawl>
);
case "dyad-web-search-result":
return (
<DyadWebSearchResult
......
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>
);
};
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论