feat: add MCP research access and browser key management

This commit is contained in:
yuxuanhui
2026-09-09 16:18:27 +08:00
parent 4debca7dbd
commit 45238280e3
47 changed files with 2642 additions and 44 deletions
+7 -3
View File
@@ -1,7 +1,10 @@
import type { PageContext, UIAction } from "./types";
export type WorkspacePage = PageContext["page"];
const contextLabels: Record<WorkspacePage, (context: PageContext) => string> = {
export type WorkspacePage = PageContext["page"] | "mcp-keys";
const contextLabels: Record<
PageContext["page"],
(context: PageContext) => string
> = {
alphas: (context) =>
`上下文:${context.alpha_id ? `Alpha ${context.alpha_id}` : "Alpha 列表"}${context.selected_ids?.length ? ` · 已选 ${context.selected_ids.length} 条` : ""}`,
operators: () => "上下文:算子库",
@@ -24,8 +27,9 @@ export function contextLabel(context: PageContext): string {
}
export function pageFromHash(hash: string): WorkspacePage {
const value = hash.replace(/^#/, "");
const value = hash.replace(/^#/, "").split("?")[0];
const page = value.startsWith("quantflow/") ? "quantflow" : value;
if (page === "mcp-keys") return page;
return Object.hasOwn(contextLabels, page)
? (page as WorkspacePage)
: "alphas";