mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 22:17:00 +00:00
refactor(ui): remove unused helper exports
This commit is contained in:
@@ -3,10 +3,6 @@ export const CHAT_ATTACHMENT_ACCEPT =
|
||||
"image/*,audio/*,application/pdf,text/*,.csv,.json,.md,.txt,.zip," +
|
||||
".doc,.docx,.xls,.xlsx,.ppt,.pptx";
|
||||
|
||||
export function isSupportedChatAttachmentMimeType(mimeType: string | null | undefined): boolean {
|
||||
return typeof mimeType === "string" && !mimeType.startsWith("video/");
|
||||
}
|
||||
|
||||
export function isSupportedChatAttachmentFile(file: Pick<File, "name" | "type">): boolean {
|
||||
if (file.type.startsWith("video/")) {
|
||||
return false;
|
||||
|
||||
@@ -84,24 +84,6 @@ const PATH_ALIASES: Record<string, Tab> = {
|
||||
"/dreams": "dreams",
|
||||
};
|
||||
|
||||
/**
|
||||
* Maps a tab to its parent tab when it should render as an indented sub-item
|
||||
* under the parent in the sidebar. Sub-items still get their own routes.
|
||||
*/
|
||||
export const TAB_PARENTS: Partial<Record<Tab, Tab>> = {
|
||||
skillWorkshop: "skills",
|
||||
};
|
||||
|
||||
export function isChildTab(tab: Tab): boolean {
|
||||
return Object.hasOwn(TAB_PARENTS, tab);
|
||||
}
|
||||
|
||||
export function childTabsOf(parent: Tab): Tab[] {
|
||||
return (Object.entries(TAB_PARENTS) as Array<[Tab, Tab]>)
|
||||
.filter(([, p]) => p === parent)
|
||||
.map(([child]) => child);
|
||||
}
|
||||
|
||||
const PATH_TO_TAB = new Map<string, Tab>([
|
||||
...Object.entries(TAB_PATHS).map(([tab, path]) => [path, tab as Tab] as const),
|
||||
...Object.entries(PATH_ALIASES),
|
||||
|
||||
@@ -9,25 +9,6 @@ export type ThinkingCatalogEntry = {
|
||||
|
||||
const BASE_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high"] as const;
|
||||
|
||||
export function normalizeThinkingProviderId(provider?: string | null): string {
|
||||
if (!provider) {
|
||||
return "";
|
||||
}
|
||||
const normalized = normalizeLowercaseStringOrEmpty(provider);
|
||||
if (normalized === "z.ai" || normalized === "z-ai") {
|
||||
return "zai";
|
||||
}
|
||||
if (normalized === "bedrock" || normalized === "aws-bedrock") {
|
||||
return "amazon-bedrock";
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
export function isBinaryThinkingProvider(provider?: string | null): boolean {
|
||||
void provider;
|
||||
return false;
|
||||
}
|
||||
|
||||
export function normalizeThinkLevel(raw?: string | null): string | undefined {
|
||||
if (!raw) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user