refactor: move path utilities to utils directory

This commit is contained in:
weishu
2026-01-05 13:00:48 +08:00
parent d388c92114
commit 77eefcd8da
4 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import type { ReactNode } from 'react'
import type { SessionMetadataSummary } from '@/types/api'
import { BulbIcon, ClipboardIcon, EyeIcon, FileDiffIcon, GlobeIcon, PuzzleIcon, QuestionIcon, RocketIcon, SearchIcon, TerminalIcon, WrenchIcon } from '@/components/ToolCard/icons'
import { basename, resolveDisplayPath } from '@/components/ToolCard/path'
import { basename, resolveDisplayPath } from '@/utils/path'
const DEFAULT_ICON_CLASS = 'h-3.5 w-3.5'
// Tool presentation registry for `hapi/web` (aligned with `hapi-app`).
@@ -1,5 +1,5 @@
import type { ToolViewProps } from '@/components/ToolCard/views/_all'
import { basename, resolveDisplayPath } from '@/components/ToolCard/path'
import { basename, resolveDisplayPath } from '@/utils/path'
function isObject(value: unknown): value is Record<string, unknown> {
return Boolean(value) && typeof value === 'object'
@@ -1,7 +1,7 @@
import type { ToolViewComponent, ToolViewProps } from '@/components/ToolCard/views/_all'
import { CodeBlock } from '@/components/CodeBlock'
import { MarkdownRenderer } from '@/components/MarkdownRenderer'
import { basename, resolveDisplayPath } from '@/components/ToolCard/path'
import { basename, resolveDisplayPath } from '@/utils/path'
function isObject(value: unknown): value is Record<string, unknown> {
return Boolean(value) && typeof value === 'object'
@@ -23,4 +23,3 @@ export function basename(path: string): string {
const parts = normalized.split('/').filter(Boolean)
return parts.length > 0 ? parts[parts.length - 1] : path
}