feat: add MCP research access and browser key management
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user