This commit is contained in:
董宏凯 committed 2026-08-13 16:44:47 +08:00
commit 5a4881053d
32 files changed
+787 -101

No files matched your search

@@ -295,17 +295,19 @@ function ToolCall({
</ChainOfThoughtStep>
);
}
if (name === "web_search" || searchItems.length > 0) {
const query = resolveSearchQuery(args, result);
let label: React.ReactNode = t.toolCalls.searchForRelatedInfo;
if (query) {
label =
name === "web_search"
? t.toolCalls.searchOnWebFor(query)
: t.toolCalls.searchFor(query);
}
return (
<ChainOfThoughtStep key={id} label={label} icon={SearchIcon}>
if (name === "web_search" || searchItems.length > 0) {
const query = resolveSearchQuery(args, result);
let label: React.ReactNode = t.toolCalls.searchForRelatedInfo;
if (query) {
label =
name === "web_search"
? `知识库检索 "${query}"`
: t.toolCalls.searchFor(query);
} else if (name === "web_search") {
label = "知识库检索";
}
return (
<ChainOfThoughtStep key={id} label={label} icon={SearchIcon}>
{searchItems.length > 0 && (
<WebSearchResultsList results={searchItems} />
)}
@@ -520,12 +522,12 @@ function ToolCall({
icon={WrenchIcon}
></ChainOfThoughtStep>
);
}
}
interface GenericCoTStep<T extends string = string> {
id?: string;
messageId?: string;
}
}
interface GenericCoTStep<T extends string = string> {
id?: string;
messageId?: string;
type: T;
}
@@ -28,7 +28,7 @@ function cssVar(name: string, fallback = ""): string {
function collectThemePayload(): DeerFlowThemePayload {
const isDark =
document.documentElement.classList.contains("dark") ||
document.documentElement.dataset.theme === "dark";
document.documentElement.getAttribute("theme-mode") === "dark";
return {
type: "deerflow-weknora-theme",
theme: isDark ? "dark" : "light",
@@ -91,7 +91,9 @@ export function WeKnoraKnowledgeDetailPage() {
const path = session.frame_path.startsWith("/")
? session.frame_path
: `/${session.frame_path}`;
setFrameSrc(`${base}${path}`);
const nextUrl = new URL(`${base}${path}`);
nextUrl.searchParams.set("theme", collectThemePayload().theme);
setFrameSrc(nextUrl.toString());
})
.catch((error: unknown) => {
if (cancelled) return;
@@ -112,7 +114,7 @@ export function WeKnoraKnowledgeDetailPage() {
const observer = new MutationObserver(send);
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ["class", "style", "data-theme"],
attributeFilter: ["class", "style", "data-theme", "theme-mode"],
});
window.addEventListener("storage", send);
return () => {