Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

♻️ refactor: remove dead utility modules (#17181)

René Wang8d301604d0b6
diff --git a/apps/cli/src/commands/brief.ts b/apps/cli/src/commands/brief.ts
deleted file mode 100644
index adc49a6fdfd..00000000000
--- a/apps/cli/src/commands/brief.ts
+++ /dev/null
@@ -1,210 +0,0 @@
-import type { Command } from 'commander';
-import pc from 'picocolors';
-
-import { getTrpcClient } from '../api/client';
-import { outputJson, printTable, timeAgo, truncate } from '../utils/format';
-import { log } from '../utils/logger';
-
-export function registerBriefCommand(program: Command) {
- const brief = program.command('brief').description('Manage briefs (Agent reports)');
-
- // ── list ──────────────────────────────────────────────
-
- brief
- .command('list')
- .description('List briefs')
- .option('--unresolved', 'Only show unresolved briefs (default)')
- .option('--all', 'Show all briefs')
- .option('--type <type>', 'Filter by type (decision/result/insight/error)')
- .option('-L, --limit <n>', 'Page size', '50')
- .option('--json [fields]', 'Output JSON')
- .action(
- async (options: {
- all?: boolean;
- json?: string | boolean;
- limit?: string;
- type?: string;
- unresolved?: boolean;
- }) => {
- const client = await getTrpcClient();
-
- let items: any[];
-
- if (options.all) {
- const input: Record<string, any> = {};
- if (options.type) input.type = options.type;
- if (options.limit) input.limit = Number.parseInt(options.limit, 10);
- const result = await client.brief.list.query(input as any);
- items = result.data;
- } else {
- const result = await client.brief.listUnresolved.query();
- items = result.data;
- }
-
- if (options.json !== undefined) {
- outputJson(items, typeof options.json === 'string' ? options.json : undefined);
- return;
- }
-
- if (!items || items.length === 0) {
- log.info('No briefs found.');
- return;
- }
-
- const rows = items.map((b: any) => [
- typeBadge(b.type, b.priority),
- truncate(b.title, 40),
- truncate(b.summary, 50),
- b.taskId ? pc.dim(b.taskId) : '-',
- b.resolvedAt ? pc.green('resolved') : b.readAt ? pc.dim('read') : 'new',
- timeAgo(b.createdAt),
- ]);
-
- printTable(rows, ['TYPE', 'TITLE', 'SUMMARY', 'SOURCE', 'STATUS', 'CREATED']);
- },
- );
-
- // ── view ──────────────────────────────────────────────
-
- brief
- .command('view <id>')
- .description('View brief details (auto marks as read)')
- .option('--json [fields]', 'Output JSON')
- .action(async (id: string, options: { json?: string | boolean }) => {
- const client = await getTrpcClient();
- const result = await client.brief.find.query({ id });
- const b = result.data;
-
- if (options.json !== undefined) {
- outputJson(b, typeof options.json === 'string' ? options.json : undefined);
- return;
- }
-
- if (!b) {
- log.error('Brief not found.');
- return;
- }
-
- // Auto mark as read
- if (!b.readAt) {
- await client.brief.markRead.mutate({ id });
- }
-
- const resolvedLabel = b.resolvedAt
- ? (() => {
- const actions = (b.actions as any[]) || [];
- const matched = actions.find((a: any) => a.key === (b as any).resolvedAction);
- return pc.green(` ${matched?.label || '✓ resolved'}`);
- })()
- : '';
-
- console.log(`\n${typeBadge(b.type, b.priority)} ${pc.bold(b.title)}${resolvedLabel}`);
- console.log(`${pc.dim('Type:')} ${b.type} ${pc.dim('Created:')} ${timeAgo(b.createdAt)}`);
- if (b.agentId) console.log(`${pc.dim('Agent:')} ${b.agentId}`);
- if (b.taskId) console.log(`${pc.dim('Task:')} ${b.taskId}`);
- if (b.topicId) console.log(`${pc.dim('Topic:')} ${b.topicId}`);
- console.log(`\n${b.summary}`);
-
- if (b.artifacts && (b.artifacts as string[]).length > 0) {
- console.log(`\n${pc.dim('Artifacts:')}`);
- for (const a of b.artifacts as string[]) {
- console.log(` 📎 ${a}`);
- }
- }
-
- console.log();
- if (!b.resolvedAt) {
- const actions = (b.actions as any[]) || [];
- if (actions.length > 0) {
- console.log('Actions:');
- for (const a of actions) {
- const cmd =
- a.type === 'comment'
- ? `lh brief resolve ${b.id} --action ${a.key} -m "message"`
- : `lh brief resolve ${b.id} --action ${a.key}`;
- console.log(` ${a.label} ${pc.dim(cmd)}`);
- }
- } else {
- console.log(pc.dim('Actions:'));
- console.log(pc.dim(` lh brief resolve ${b.id} # Approve`));
- console.log(pc.dim(` lh brief resolve ${b.id} --reply "revision notes" # Request revision`));
- }
- } else if ((b as any).resolvedComment) {
- console.log(`${pc.dim('Comment:')} ${(b as any).resolvedComment}`);
- }
- });
-
- // ── resolve ──────────────────────────────────────────────
-
- brief
- .command('resolve <id>')
- .description('Resolve a brief (approve, reply, or custom action)')
- .option('--action <key>', 'Execute a specific action (e.g. approve, feedback)')
- .option('--reply <text>', 'Reply with feedback')
- .option('-m, --message <text>', 'Message for comment-type actions')
- .action(async (id: string, options: { action?: string; message?: string; reply?: string }) => {
- const client = await getTrpcClient();
-
- const actionKey = options.action || (options.reply ? 'feedback' : 'approve');
- const actionMessage = options.message || options.reply;
-
- const briefResult = await client.brief.find.query({ id });
- const b = briefResult.data;
-
- // For comment-type actions, add comment to task
- if (actionMessage && b?.taskId) {
- await client.task.addComment.mutate({
- briefId: id,
- content: actionMessage,
- id: b.taskId,
- });
- }
-
- await client.brief.resolve.mutate({
- action: actionKey,
- comment: actionMessage,
- id,
- });
-
- const actions = (b?.actions as any[]) || [];
- const matchedAction = actions.find((a: any) => a.key === actionKey);
- const label = matchedAction?.label || actionKey;
-
- log.info(`${label} — Brief ${pc.dim(id)} resolved.`);
- });
-
- // ── delete ──────────────────────────────────────────────
-
- brief
- .command('delete <id>')
- .description('Delete a brief')
- .action(async (id: string) => {
- const client = await getTrpcClient();
- await client.brief.delete.mutate({ id });
- log.info(`Brief ${pc.dim(id)} deleted.`);
- });
-}
-
-function typeBadge(type: string, priority?: string): string {
- if (priority === 'urgent') {
- return pc.red('🔴');
- }
-
- switch (type) {
- case 'decision': {
- return pc.yellow('🟡');
- }
- case 'result': {
- return pc.green('✅');
- }
- case 'insight': {
- return '💬';
- }
- case 'error': {
- return pc.red('❌');
- }
- default: {
- return '·';
- }
- }
-}
diff --git a/apps/desktop/src/main/libs/acp/client.ts b/apps/desktop/src/main/libs/acp/client.ts
deleted file mode 100644
index 39866d17003..00000000000
--- a/apps/desktop/src/main/libs/acp/client.ts
+++ /dev/null
@@ -1,435 +0,0 @@
-import type { ChildProcess } from 'node:child_process';
-import { spawn } from 'node:child_process';
-import type { Readable } from 'node:stream';
-
-import { createLogger } from '@/utils/logger';
-
-import type {
- ACPInitializeParams,
- ACPPermissionRequest,
- ACPPermissionResponse,
- ACPServerCapabilities,
- ACPSessionCancelParams,
- ACPSessionInfo,
- ACPSessionNewParams,
- ACPSessionPromptParams,
- ACPSessionUpdate,
- FSReadTextFileParams,
- FSReadTextFileResult,
- FSWriteTextFileParams,
- JsonRpcError,
- JsonRpcNotification,
- JsonRpcRequest,
- JsonRpcResponse,
- TerminalCreateParams,
- TerminalCreateResult,
- TerminalKillParams,
- TerminalOutputParams,
- TerminalOutputResult,
- TerminalReleaseParams,
- TerminalWaitForExitParams,
- TerminalWaitForExitResult,
-} from './types';
-
-const logger = createLogger('libs:acp:client');
-
-type PendingRequest = {
- reject: (error: Error) => void;
- resolve: (result: unknown) => void;
-};
-
-export interface ACPClientParams {
- args?: string[];
- command: string;
- cwd?: string;
- env?: Record<string, string>;
-}
-
-export interface ACPClientCallbacks {
- onPermissionRequest?: (request: ACPPermissionRequest) => Promise<ACPPermissionResponse>;
- onSessionComplete?: (sessionId: string) => void;
- onSessionUpdate?: (update: ACPSessionUpdate) => void;
-}
-
-/**
- * ACP Client that communicates with an ACP agent (e.g. Claude Code) over stdio JSON-RPC 2.0.
- *
- * Bidirectional: sends requests to agent AND handles incoming requests from agent
- * (fs/read_text_file, fs/write_text_file, terminal/*, session/request_permission).
- */
-export class ACPClient {
- private buffer = '';
- private callbacks: ACPClientCallbacks = {};
- private nextId = 1;
- private pendingRequests = new Map<number | string, PendingRequest>();
- private process: ChildProcess | null = null;
- private stderrLogs: string[] = [];
-
- // Client-side method handlers (agent calls these)
- private clientMethodHandlers = new Map<string, (params: any) => Promise<unknown>>();
-
- constructor(private readonly params: ACPClientParams) {}
-
- /**
- * Register handlers for client-side methods that the agent can call back.
- */
- registerClientMethods(handlers: {
- 'fs/read_text_file'?: (params: FSReadTextFileParams) => Promise<FSReadTextFileResult>;
- 'fs/write_text_file'?: (params: FSWriteTextFileParams) => Promise<void>;
- 'terminal/create'?: (params: TerminalCreateParams) => Promise<TerminalCreateResult>;
- 'terminal/kill'?: (params: TerminalKillParams) => Promise<void>;
- 'terminal/output'?: (params: TerminalOutputParams) => Promise<TerminalOutputResult>;
- 'terminal/release'?: (params: TerminalReleaseParams) => Promise<void>;
- 'terminal/wait_for_exit'?: (
- params: TerminalWaitForExitParams,
- ) => Promise<TerminalWaitForExitResult>;
- }) {
- for (const [method, handler] of Object.entries(handlers)) {
- if (handler) {
- this.clientMethodHandlers.set(method, handler);
- }
- }
- }
-
- setCallbacks(callbacks: ACPClientCallbacks) {
- this.callbacks = callbacks;
- }
-
- /**
- * Spawn the agent process and initialize the ACP connection.
- */
- async connect(): Promise<ACPServerCapabilities> {
- const { command, args = [], env, cwd } = this.params;
-
- this.process = spawn(command, args, {
- cwd,
- env: { ...process.env, ...env },
- stdio: ['pipe', 'pipe', 'pipe'],
- });
-
- // Capture stderr
- const stderr = this.process.stderr as Readable | null;
- if (stderr) {
- stderr.on('data', (chunk: Buffer) => {
- const lines = chunk
- .toString('utf8')
- .split('\n')
- .filter((l) => l.trim());
- this.stderrLogs.push(...lines);
- });
- }
-
- // Listen for stdout (JSON-RPC messages)
- const stdout = this.process.stdout as Readable | null;
- if (stdout) {
- stdout.on('data', (chunk: Buffer) => {
- this.handleData(chunk.toString('utf8'));
- });
- }
-
- this.process.on('error', (err) => {
- logger.error('ACP process error:', err);
- });
-
- this.process.on('exit', (code, signal) => {
- logger.info('ACP process exited:', { code, signal });
- // Reject all pending requests
- for (const [id, pending] of this.pendingRequests) {
- pending.reject(new Error(`ACP process exited (code=${code}, signal=${signal})`));
- this.pendingRequests.delete(id);
- }
- });
-
- // Initialize
- const capabilities = await this.initialize();
- return capabilities;
- }
-
- /**
- * Send initialize request to the agent.
- */
- private async initialize(): Promise<ACPServerCapabilities> {
- const params: ACPInitializeParams = {
- capabilities: {
- fs: { readTextFile: true, writeTextFile: true },
- terminal: true,
- },
- clientInfo: { name: 'lobehub-desktop', version: '1.0.0' },
- protocolVersion: '0.1',
- };
-
- return this.sendRequest<ACPServerCapabilities>('initialize', params);
- }
-
- /**
- * Create a new session.
- */
- async createSession(params?: ACPSessionNewParams): Promise<ACPSessionInfo> {
- return this.sendRequest<ACPSessionInfo>('session/new', params);
- }
-
- /**
- * Send a prompt to an existing session.
- */
- async sendPrompt(params: ACPSessionPromptParams): Promise<void> {
- return this.sendRequest<void>('session/prompt', params);
- }
-
- /**
- * Cancel an ongoing session operation.
- */
- async cancelSession(params: ACPSessionCancelParams): Promise<void> {
- return this.sendRequest<void>('session/cancel', params);
- }
-
- /**
- * Respond to a permission request from the agent.
- */
- respondToPermission(requestId: string, response: ACPPermissionResponse): void {
- this.sendResponse(requestId, response);
- }
-
- /**
- * Disconnect from the agent and kill the process.
- */
- async disconnect(): Promise<void> {
- if (this.process) {
- this.process.stdin?.end();
- this.process.kill('SIGTERM');
-
- // Force kill after timeout
- await new Promise<void>((resolve) => {
- const timeout = setTimeout(() => {
- if (this.process && !this.process.killed) {
- this.process.kill('SIGKILL');
- }
- resolve();
- }, 5000);
-
- this.process?.on('exit', () => {
- clearTimeout(timeout);
- resolve();
- });
- });
-
- this.process = null;
- }
- }
-
- getStderrLogs(): string[] {
- return this.stderrLogs;
- }
-
- // ============================================================
- // JSON-RPC transport layer
- // ============================================================
-
- private sendRequest<T>(method: string, params?: object): Promise<T> {
- return new Promise((resolve, reject) => {
- const id = this.nextId++;
- const request: JsonRpcRequest = {
- id,
- jsonrpc: '2.0',
- method,
- params,
- };
-
- this.pendingRequests.set(id, {
- reject,
- resolve: resolve as (result: unknown) => void,
- });
-
- this.writeMessage(request);
- });
- }
-
- private sendResponse(id: number | string, result: unknown): void {
- const response: JsonRpcResponse = {
- id,
- jsonrpc: '2.0',
- result,
- };
- this.writeMessage(response);
- }
-
- private sendErrorResponse(id: number | string, error: JsonRpcError): void {
- const response: JsonRpcResponse = {
- error,
- id,
- jsonrpc: '2.0',
- };
- this.writeMessage(response);
- }
-
- private writeMessage(message: JsonRpcRequest | JsonRpcResponse | JsonRpcNotification): void {
- if (!this.process?.stdin?.writable) {
- logger.error('Cannot write to ACP process: stdin not writable');
- return;
- }
-
- const json = JSON.stringify(message);
- const content = `Content-Length: ${Buffer.byteLength(json)}\r\n\r\n${json}`;
- this.process.stdin.write(content);
- }
-
- /**
- * Handle incoming data from stdout, parsing JSON-RPC messages.
- * Uses Content-Length header framing (LSP-style).
- */
- private handleData(data: string): void {
- this.buffer += data;
-
- while (true) {
- // Try to parse a complete message from the buffer
- const headerEnd = this.buffer.indexOf('\r\n\r\n');
- if (headerEnd === -1) break;
-
- const header = this.buffer.slice(0, headerEnd);
- const contentLengthMatch = header.match(/Content-Length:\s*(\d+)/i);
-
- if (!contentLengthMatch) {
- // Try parsing as raw JSON (some agents don't use Content-Length headers)
- const newlineIdx = this.buffer.indexOf('\n');
- if (newlineIdx === -1) break;
-
- const line = this.buffer.slice(0, newlineIdx).trim();
- this.buffer = this.buffer.slice(newlineIdx + 1);
-
- if (line) {
- try {
- const message = JSON.parse(line);
- this.handleMessage(message);
- } catch {
- // Not valid JSON, skip
- }
- }
- continue;
- }
-
- const contentLength = Number.parseInt(contentLengthMatch[1], 10);
- const messageStart = headerEnd + 4; // after \r\n\r\n
- const messageEnd = messageStart + contentLength;
-
- if (Buffer.byteLength(this.buffer.slice(messageStart)) < contentLength) {
- // Not enough data yet
- break;
- }
-
- const messageStr = this.buffer.slice(messageStart, messageEnd);
- this.buffer = this.buffer.slice(messageEnd);
-
- try {
- const message = JSON.parse(messageStr);
- this.handleMessage(message);
- } catch (err) {
- logger.error('Failed to parse ACP JSON-RPC message:', err);
- }
- }
- }
-
- /**
- * Route incoming JSON-RPC messages.
- */
- private handleMessage(message: JsonRpcRequest | JsonRpcResponse | JsonRpcNotification): void {
- // Response to our request
- if ('id' in message && message.id !== null && !('method' in message)) {
- const response = message as JsonRpcResponse;
- const pending = this.pendingRequests.get(response.id!);
- if (pending) {
- this.pendingRequests.delete(response.id!);
- if (response.error) {
- pending.reject(
- new Error(`ACP error [${response.error.code}]: ${response.error.message}`),
- );
- } else {
- pending.resolve(response.result);
- }
- }
- return;
- }
-
- // Incoming request or notification from agent
- if ('method' in message) {
- const method = message.method;
- const params = message.params || {};
-
- // Notification (no id) — e.g., session/update
- if (!('id' in message) || message.id === undefined || message.id === null) {
- this.handleNotification(method, params);
- return;
- }
-
- // Request (has id) — agent calling client methods
- this.handleIncomingRequest(message as JsonRpcRequest);
- }
- }
-
- /**
- * Handle notifications from the agent (no response expected).
- */
- private handleNotification(method: string, params: Record<string, unknown> | object): void {
- switch (method) {
- case 'session/update': {
- if (this.callbacks.onSessionUpdate) {
- this.callbacks.onSessionUpdate(params as unknown as ACPSessionUpdate);
- }
- break;
- }
- default: {
- logger.warn('Unhandled ACP notification:', method);
- }
- }
- }
-
- /**
- * Handle incoming requests from the agent (response required).
- */
- private async handleIncomingRequest(request: JsonRpcRequest): Promise<void> {
- const { id, method, params } = request;
-
- // Special handling for permission requests
- if (method === 'session/request_permission') {
- if (this.callbacks.onPermissionRequest) {
- try {
- const response = await this.callbacks.onPermissionRequest(
- params as unknown as ACPPermissionRequest,
- );
- this.sendResponse(id, response);
- } catch (err) {
- this.sendErrorResponse(id, {
- code: -32000,
- message: err instanceof Error ? err.message : 'Permission request failed',
- });
- }
- } else {
- // Auto-allow if no handler
- const permReq = params as unknown as ACPPermissionRequest;
- const allowOption = permReq.options?.find((o) => o.kind === 'allow_once');
- this.sendResponse(id, {
- kind: 'selected',
- optionId: allowOption?.optionId || permReq.options?.[0]?.optionId,
- });
- }
- return;
- }
-
- // Delegate to registered client method handlers
- const handler = this.clientMethodHandlers.get(method);
- if (handler) {
- try {
- const result = await handler(params);
- this.sendResponse(id, result ?? null);
- } catch (err) {
- this.sendErrorResponse(id, {
- code: -32000,
- message: err instanceof Error ? err.message : 'Client method failed',
- });
- }
- } else {
- this.sendErrorResponse(id, {
- code: -32601,
- message: `Method not found: ${method}`,
- });
- }
- }
-}
diff --git a/apps/desktop/src/main/libs/acp/index.ts b/apps/desktop/src/main/libs/acp/index.ts
deleted file mode 100644
index 4b8488dc8ca..00000000000
--- a/apps/desktop/src/main/libs/acp/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export type { ACPClientCallbacks, ACPClientParams } from './client';
-export { ACPClient } from './client';
-export type * from './types';
diff --git a/apps/desktop/src/main/libs/acp/types.ts b/apps/desktop/src/main/libs/acp/types.ts
deleted file mode 100644
index 5993415908e..00000000000
--- a/apps/desktop/src/main/libs/acp/types.ts
+++ /dev/null
@@ -1,326 +0,0 @@
-/**
- * ACP (Agent Client Protocol) type definitions
- * Based on: https://agentclientprotocol.com/protocol/schema
- */
-
-// ============================================================
-// JSON-RPC 2.0 base types
-// ============================================================
-
-export interface JsonRpcRequest {
- id: number | string;
- jsonrpc: '2.0';
- method: string;
- params?: Record<string, unknown> | object;
-}
-
-export interface JsonRpcResponse {
- error?: JsonRpcError;
- id: number | string | null;
- jsonrpc: '2.0';
- result?: unknown;
-}
-
-export interface JsonRpcNotification {
- jsonrpc: '2.0';
- method: string;
- params?: Record<string, unknown>;
-}
-
-export interface JsonRpcError {
- code: number;
- data?: unknown;
- message: string;
-}
-
-// ============================================================
-// ACP Capabilities
-// ============================================================
-
-export interface ACPCapabilities {
- audio?: boolean;
- embeddedContext?: boolean;
- fs?: {
- readTextFile?: boolean;
- writeTextFile?: boolean;
- };
- image?: boolean;
- terminal?: boolean;
-}
-
-export interface ACPServerCapabilities {
- modes?: ACPMode[];
- name: string;
- protocolVersion: string;
- version?: string;
-}
-
-export interface ACPMode {
- description?: string;
- id: string;
- name: string;
-}
-
-// ============================================================
-// Session types
-// ============================================================
-
-export interface ACPSessionInfo {
- createdAt?: string;
- id: string;
- title?: string;
-}
-
-// ============================================================
-// Content block types (used in session/update)
-// ============================================================
-
-export type ACPContentBlock =
- | ACPTextContent
- | ACPImageContent
- | ACPAudioContent
- | ACPResourceContent
- | ACPResourceLinkContent;
-
-export interface ACPTextContent {
- annotations?: Record<string, unknown>;
- text: string;
- type: 'text';
-}
-
-export interface ACPImageContent {
- annotations?: Record<string, unknown>;
- data: string;
- mimeType: string;
- type: 'image';
- uri?: string;
-}
-
-export interface ACPAudioContent {
- annotations?: Record<string, unknown>;
- data: string;
- mimeType: string;
- type: 'audio';
-}
-
-export interface ACPResourceContent {
- annotations?: Record<string, unknown>;
- resource: {
- blob?: string;
- mimeType?: string;
- text?: string;
- uri: string;
- };
- type: 'resource';
-}
-
-export interface ACPResourceLinkContent {
- annotations?: Record<string, unknown>;
- description?: string;
- mimeType?: string;
- name: string;
- size?: number;
- title?: string;
- type: 'resource_link';
- uri: string;
-}
-
-// ============================================================
-// Tool call types
-// ============================================================
-
-export type ACPToolCallKind =
- | 'read'
- | 'edit'
- | 'delete'
- | 'move'
- | 'search'
- | 'execute'
- | 'think'
- | 'fetch'
- | 'other';
-
-export type ACPToolCallStatus = 'pending' | 'in_progress' | 'completed' | 'failed';
-
-export interface ACPToolCallDiffContent {
- newText: string;
- oldText: string;
- path: string;
- type: 'diff';
-}
-
-export interface ACPToolCallTerminalContent {
- command?: string;
- exitCode?: number;
- output: string;
- type: 'terminal';
-}
-
-export type ACPToolCallContent =
- | ACPTextContent
- | ACPImageContent
- | ACPToolCallDiffContent
- | ACPToolCallTerminalContent;
-
-export interface ACPToolCallLocation {
- endLine?: number;
- path: string;
- startLine?: number;
-}
-
-export interface ACPToolCallUpdate {
- content?: ACPToolCallContent[];
- kind?: ACPToolCallKind;
- locations?: ACPToolCallLocation[];
- rawInput?: string;
- rawOutput?: string;
- status?: ACPToolCallStatus;
- title: string;
- toolCallId: string;
-}
-
-// ============================================================
-// Session update notification
-// ============================================================
-
-export type ACPMessageRole = 'assistant' | 'user' | 'thought';
-
-export interface ACPMessageChunk {
- content: ACPContentBlock[];
- role: ACPMessageRole;
-}
-
-export interface ACPSessionUpdate {
- messageChunks?: ACPMessageChunk[];
- sessionId: string;
- toolCalls?: ACPToolCallUpdate[];
-}
-
-// ============================================================
-// Permission request types
-// ============================================================
-
-export interface ACPPermissionOption {
- kind: 'allow_once' | 'allow_always' | 'reject_once' | 'reject_always';
- name: string;
- optionId: string;
-}
-
-export interface ACPPermissionRequest {
- message?: string;
- options: ACPPermissionOption[];
- sessionId: string;
- toolCall?: ACPToolCallUpdate;
-}
-
-export interface ACPPermissionResponse {
- kind: 'selected' | 'cancelled';
- optionId?: string;
-}
-
-// ============================================================
-// Client method params (agent → client)
-// ============================================================
-
-export interface FSReadTextFileParams {
- path: string;
-}
-
-export interface FSReadTextFileResult {
- text: string;
-}
-
-export interface FSWriteTextFileParams {
- path: string;
- text: string;
-}
-
-export interface TerminalCreateParams {
- command: string;
- cwd?: string;
- env?: Record<string, string>;
-}
-
-export interface TerminalCreateResult {
- terminalId: string;
-}
-
-export interface TerminalOutputParams {
- terminalId: string;
-}
-
-export interface TerminalOutputResult {
- exitCode?: number;
- isRunning: boolean;
- output: string;
-}
-
-export interface TerminalWaitForExitParams {
- terminalId: string;
- timeout?: number;
-}
-
-export interface TerminalWaitForExitResult {
- exitCode: number;
- output: string;
-}
-
-export interface TerminalKillParams {
- terminalId: string;
-}
-
-export interface TerminalReleaseParams {
- terminalId: string;
-}
-
-// ============================================================
-// Agent method params (client → agent)
-// ============================================================
-
-export interface ACPInitializeParams {
- capabilities?: ACPCapabilities;
- clientInfo?: {
- name: string;
- version: string;
- };
- protocolVersion: string;
-}
-
-export interface ACPSessionNewParams {
- title?: string;
-}
-
-export interface ACPSessionPromptParams {
- content: ACPContentBlock[];
- sessionId: string;
-}
-
-export interface ACPSessionCancelParams {
- sessionId: string;
-}
-
-// ============================================================
-// Broadcast event types (main → renderer)
-// ============================================================
-
-export interface ACPSessionUpdateEvent {
- sessionId: string;
- update: ACPSessionUpdate;
-}
-
-export interface ACPPermissionRequestEvent {
- message?: string;
- options: ACPPermissionOption[];
- requestId: string;
- sessionId: string;
- toolCall?: ACPToolCallUpdate;
-}
-
-export interface ACPSessionErrorEvent {
- error: string;
- sessionId: string;
-}
-
-export interface ACPSessionCompleteEvent {
- sessionId: string;
-}
diff --git a/apps/desktop/src/main/locales/default/index.ts b/apps/desktop/src/main/locales/default/index.ts
deleted file mode 100644
index 21cf89c1c39..00000000000
--- a/apps/desktop/src/main/locales/default/index.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import common from './common';
-import dialog from './dialog';
-import menu from './menu';
-
-const resources = {
- common,
- dialog,
- menu,
-} as const;
-
-export default resources;
diff --git a/apps/desktop/src/main/utils/path.ts b/apps/desktop/src/main/utils/path.ts
deleted file mode 100644
index a345506282b..00000000000
--- a/apps/desktop/src/main/utils/path.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { pathToFileURL } from 'node:url';
-
-export const filePathToAppUrl = (filePath: string) => {
- return `app://lobehub.com${pathToFileURL(filePath).pathname}`;
-};
diff --git a/apps/server/src/routers/mobile/topic.ts b/apps/server/src/routers/mobile/topic.ts
deleted file mode 100644
index f5954cf32b2..00000000000
--- a/apps/server/src/routers/mobile/topic.ts
+++ /dev/null
@@ -1,163 +0,0 @@
-import { z } from 'zod';
-
-import { withScopedPermission } from '@/business/server/trpc-middlewares/rbacPermission';
-import { wsCompatProcedure } from '@/business/server/trpc-middlewares/workspaceAuth';
-import { TopicModel } from '@/database/models/topic';
-import { router } from '@/libs/trpc/lambda';
-import { serverDatabase } from '@/libs/trpc/lambda/middleware';
-import { type BatchTaskResult } from '@/types/service';
-
-const topicProcedure = wsCompatProcedure.use(serverDatabase).use(async (opts) => {
- const { ctx } = opts;
-
- return opts.next({
- ctx: {
- topicModel: new TopicModel(ctx.serverDB, ctx.userId, ctx.workspaceId ?? undefined),
- },
- });
-});
-
-const topicCreateProcedure = topicProcedure.use(withScopedPermission('topic:create'));
-const topicDeleteProcedure = topicProcedure.use(withScopedPermission('topic:delete'));
-const topicUpdateProcedure = topicProcedure.use(withScopedPermission('topic:update'));
-
-export const topicRouter = router({
- batchCreateTopics: topicCreateProcedure
- .input(
- z.array(
- z.object({
- favorite: z.boolean().optional(),
- id: z.string().optional(),
- messages: z.array(z.string()).optional(),
- sessionId: z.string().optional(),
- title: z.string(),
- }),
- ),
- )
- .mutation(async ({ input, ctx }): Promise<BatchTaskResult> => {
- const data = await ctx.topicModel.batchCreate(
- input.map((item) => ({
- ...item,
- })) as any,
- );
-
- return { added: data.length, ids: [], skips: [], success: true };
- }),
-
- batchDelete: topicDeleteProcedure
- .input(z.object({ ids: z.array(z.string()) }))
- .mutation(async ({ input, ctx }) => {
- return ctx.topicModel.batchDelete(input.ids);
- }),
-
- batchDeleteBySessionId: topicDeleteProcedure
- .input(z.object({ id: z.string().nullish() }))
- .mutation(async ({ input, ctx }) => {
- return ctx.topicModel.batchDeleteBySessionId(input.id);
- }),
-
- cloneTopic: topicCreateProcedure
- .input(z.object({ id: z.string(), newTitle: z.string().optional() }))
- .mutation(async ({ input, ctx }) => {
- const data = await ctx.topicModel.duplicate(input.id, input.newTitle);
-
- return data.topic.id;
- }),
-
- countTopics: topicProcedure
- .input(
- z
- .object({
- endDate: z.string().optional(),
- range: z.tuple([z.string(), z.string()]).optional(),
- startDate: z.string().optional(),
- })
- .optional(),
- )
- .query(async ({ ctx, input }) => {
- return ctx.topicModel.count(input);
- }),
-
- createTopic: topicCreateProcedure
- .input(
- z.object({
- favorite: z.boolean().optional(),
- groupId: z.string().nullish(),
- messages: z.array(z.string()).optional(),
- sessionId: z.string().nullish(),
- title: z.string(),
- }),
- )
- .mutation(async ({ input, ctx }) => {
- const data = await ctx.topicModel.create(input);
-
- return data.id;
- }),
-
- getTopics: topicProcedure
- .input(
- z.object({
- containerId: z.string().nullish(),
- current: z.number().optional(),
- pageSize: z.number().optional(),
- }),
- )
- .query(async ({ input, ctx }) => {
- return ctx.topicModel.query(input);
- }),
-
- hasTopics: topicProcedure.query(async ({ ctx }) => {
- return (await ctx.topicModel.count()) === 0;
- }),
-
- rankTopics: topicProcedure.input(z.number().optional()).query(async ({ ctx, input }) => {
- return ctx.topicModel.rank(input);
- }),
-
- removeAllTopics: topicDeleteProcedure.mutation(async ({ ctx }) => {
- return ctx.topicModel.deleteAll();
- }),
-
- removeTopic: topicDeleteProcedure
- .input(z.object({ id: z.string() }))
- .mutation(async ({ input, ctx }) => {
- return ctx.topicModel.delete(input.id);
- }),
-
- searchTopics: topicProcedure
- .input(
- z.object({
- groupId: z.string().nullish(),
- keywords: z.string(),
- sessionId: z.string().nullish(),
- }),
- )
- .query(async ({ input, ctx }) => {
- return ctx.topicModel.queryByKeyword(input.keywords, input.sessionId);
- }),
-
- updateTopic: topicUpdateProcedure
- .input(
- z.object({
- id: z.string(),
- value: z.object({
- favorite: z.boolean().optional(),
- historySummary: z.string().optional(),
- messages: z.array(z.string()).optional(),
- metadata: z
- .object({
- model: z.string().optional(),
- provider: z.string().optional(),
- })
- .optional(),
- sessionId: z.string().optional(),
- title: z.string().optional(),
- }),
- }),
- )
- .mutation(async ({ input, ctx }) => {
- return ctx.topicModel.update(input.id, input.value);
- }),
-});
-
-export type TopicRouter = typeof topicRouter;
diff --git a/apps/server/src/services/agentSignal/procedure/accumulators/index.ts b/apps/server/src/services/agentSignal/procedure/accumulators/index.ts
deleted file mode 100644
index c141132e75a..00000000000
--- a/apps/server/src/services/agentSignal/procedure/accumulators/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './procedure';
-export * from './selfReflection';
diff --git a/apps/server/src/services/agentSignal/services/selfIteration/tools/index.ts b/apps/server/src/services/agentSignal/services/selfIteration/tools/index.ts
deleted file mode 100644
index a76429d1df7..00000000000
--- a/apps/server/src/services/agentSignal/services/selfIteration/tools/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './reflection';
-export * from './review';
-export * from './shared';
diff --git a/apps/server/src/services/comfyui/workflows/index.ts b/apps/server/src/services/comfyui/workflows/index.ts
deleted file mode 100644
index aff5f181ba9..00000000000
--- a/apps/server/src/services/comfyui/workflows/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export { buildFluxDevWorkflow } from './flux-dev';
-export { buildFluxKontextWorkflow } from './flux-kontext';
-export { buildFluxSchnellWorkflow } from './flux-schnell';
-export { buildSD35Workflow } from './sd35';
-export { buildSimpleSDWorkflow } from './simple-sd';
diff --git a/apps/server/src/services/onboarding/nodeHandlers.ts b/apps/server/src/services/onboarding/nodeHandlers.ts
deleted file mode 100644
index 620baa10197..00000000000
--- a/apps/server/src/services/onboarding/nodeHandlers.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import type {
- UserAgentOnboarding,
- UserAgentOnboardingDraft,
- UserAgentOnboardingNode,
-} from '@lobechat/types';
-import { isRecord } from '@lobechat/utils';
-
-import { getScopedPatch, normalizeFromSchema } from './nodeSchema';
-
-type OnboardingPatchInput = Record<string, unknown>;
-type DraftKey = keyof UserAgentOnboardingDraft;
-
-interface CommitSideEffects {
- updateInterests?: string[];
- updateUserName?: string;
-}
-
-export interface NodeHandler {
- commitToState: (
- state: UserAgentOnboarding,
- draft: UserAgentOnboardingDraft,
- ) => { errorMessage?: string; sideEffects?: CommitSideEffects; success: boolean };
- readonly draftKey: DraftKey;
- extractDraft: (patch: OnboardingPatchInput) => Partial<UserAgentOnboardingDraft> | undefined;
- getDraftValue: (draft: UserAgentOnboardingDraft) => unknown;
- mergeDraft: (draft: UserAgentOnboardingDraft, patch: unknown) => UserAgentOnboardingDraft;
-}
-
-const makeProfileNodeHandler = (
- node: UserAgentOnboardingNode,
- draftKey: DraftKey,
- commitTarget:
- | { key: 'agentIdentity' }
- | {
- extraProfile?: (committed: Record<string, unknown>) => Record<string, unknown>;
- key: 'profile';
- profileKey: string;
- },
- sideEffectsFn?: (committed: Record<string, unknown>) => CommitSideEffects | undefined,
-): NodeHandler => ({
- draftKey,
- commitToState: (state, draft) => {
- const committed = normalizeFromSchema(node, draft[draftKey], 'committed') as
- | Record<string, unknown>
- | undefined;
- if (!committed) {
- return { errorMessage: `${node} has not been captured yet.`, success: false };
- }
-
- if (commitTarget.key === 'agentIdentity') {
- state.agentIdentity = committed as unknown as UserAgentOnboarding['agentIdentity'];
- } else {
- state.profile = {
- ...state.profile,
- [commitTarget.profileKey]: committed,
- ...commitTarget.extraProfile?.(committed),
- };
- }
-
- return {
- sideEffects: sideEffectsFn?.(committed),
- success: true,
- };
- },
- extractDraft: (patch) => {
- const scopedPatch = getScopedPatch(node, patch);
- const normalized = normalizeFromSchema(node, scopedPatch, 'draft');
- return normalized
- ? ({ [draftKey]: normalized } as Partial<UserAgentOnboardingDraft>)
- : undefined;
- },
- getDraftValue: (draft) => draft[draftKey],
- mergeDraft: (draft, patch) => {
- const patchRecord = isRecord(patch) ? patch : {};
- return { ...draft, [draftKey]: { ...draft[draftKey], ...patchRecord } };
- },
-});
-
-export const NODE_HANDLERS: Partial<Record<UserAgentOnboardingNode, NodeHandler>> = {
- agentIdentity: makeProfileNodeHandler('agentIdentity', 'agentIdentity', {
- key: 'agentIdentity',
- }),
- painPoints: makeProfileNodeHandler('painPoints', 'painPoints', {
- key: 'profile',
- profileKey: 'painPoints',
- }),
- userIdentity: makeProfileNodeHandler(
- 'userIdentity',
- 'userIdentity',
- {
- key: 'profile',
- profileKey: 'identity',
- },
- (committed) => (committed.name ? { updateUserName: committed.name as string } : undefined),
- ),
- workContext: makeProfileNodeHandler(
- 'workContext',
- 'workContext',
- {
- extraProfile: (committed) => ({
- ...(committed.currentFocus ||
- committed.thisWeek ||
- committed.thisQuarter ||
- committed.summary
- ? {
- currentFocus:
- (committed.currentFocus as string) ||
- (committed.thisWeek as string) ||
- (committed.thisQuarter as string) ||
- (committed.summary as string),
- }
- : {}),
- interests: Array.isArray(committed.interests)
- ? (committed.interests as string[])
- : undefined,
- }),
- key: 'profile',
- profileKey: 'workContext',
- },
- (committed) =>
- Array.isArray(committed.interests) && committed.interests.length > 0
- ? { updateInterests: committed.interests as string[] }
- : undefined,
- ),
- workStyle: makeProfileNodeHandler('workStyle', 'workStyle', {
- key: 'profile',
- profileKey: 'workStyle',
- }),
-};
-
-export const PROFILE_DOCUMENT_NODES = new Set<UserAgentOnboardingNode>([
- 'agentIdentity',
- 'userIdentity',
- 'workStyle',
- 'workContext',
- 'painPoints',
-]);
diff --git a/apps/server/src/services/riskControl/routerAlertNotification.ts b/apps/server/src/services/riskControl/routerAlertNotification.ts
deleted file mode 100644
index ba59299ff27..00000000000
--- a/apps/server/src/services/riskControl/routerAlertNotification.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-export interface ChannelStats {
- errorCount: number;
- successCount: number;
- totalCount: number;
-}
-
-export interface AlertThresholds {
- errorRateThreshold: number;
- minSampleSize: number;
-}
-
-export const shouldAlert = (_stats: ChannelStats, _thresholds: AlertThresholds): boolean => {
- return false;
-};
-
-export const sendRouterChannelAlertNotification = async (_params: {
- channelId: string;
- model: string;
- routerId: string;
- stats: ChannelStats;
-}): Promise<void> => {
- // Stub implementation
-};
-
-export const sendRouterModelAlertNotification = async (_params: {
- model: string;
- stats: ChannelStats;
-}): Promise<void> => {
- // Stub implementation
-};
diff --git a/packages/agent-mock/src/cases/generators/long-reasoning.ts b/packages/agent-mock/src/cases/generators/long-reasoning.ts
deleted file mode 100644
index 3c90be28183..00000000000
--- a/packages/agent-mock/src/cases/generators/long-reasoning.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { defineCase, llmStep } from '../../builders/defineCase';
-import { defineGenerator } from './registry';
-
-export interface LongReasoningParams {
- reasoningChars: number;
- textChars: number;
-}
-
-export const longReasoningGenerator = defineGenerator<LongReasoningParams>({
- id: 'long-reasoning',
- name: 'Long Reasoning',
- description: 'Reasoning of N chars before short answer',
- defaultParams: { reasoningChars: 5000, textChars: 200 },
- factory: ({ reasoningChars, textChars }) =>
- defineCase({
- id: `long-reasoning-${reasoningChars}`,
- name: `Long reasoning ${reasoningChars}c`,
- tags: ['reasoning', 'generated'],
- steps: [
- llmStep({
- reasoning: 'x'.repeat(reasoningChars),
- text: 'y'.repeat(textChars),
- durationMs: Math.max(1000, reasoningChars * 2),
- }),
- ],
- }),
-});
diff --git a/packages/agent-mock/src/cases/generators/subagent-tree.ts b/packages/agent-mock/src/cases/generators/subagent-tree.ts
deleted file mode 100644
index 7cbb1547a5c..00000000000
--- a/packages/agent-mock/src/cases/generators/subagent-tree.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { defineCase, llmStep, toolStep } from '../../builders/defineCase';
-import { defineGenerator } from './registry';
-
-export interface SubagentTreeParams {
- depth: number;
- fanout: number;
-}
-
-export const subagentTreeGenerator = defineGenerator<SubagentTreeParams>({
- id: 'subagent-tree',
- name: 'Subagent Tree',
- description: 'Nested callAgent tool calls of depth × fanout',
- defaultParams: { depth: 3, fanout: 2 },
- factory: ({ depth, fanout }) => {
- const calls = depth * fanout;
- return defineCase({
- id: `subagent-tree-d${depth}-f${fanout}`,
- name: `Subagent ${depth}×${fanout}`,
- tags: ['subagent', 'generated'],
- steps: [
- llmStep({ text: `Spawning ${calls} subagents.`, durationMs: 300 }),
- ...Array.from({ length: calls }, (_, i) =>
- toolStep({
- identifier: 'lobe-call-agent',
- apiName: 'callAgent',
- arguments: JSON.stringify({ agentId: `sub-${i}` }),
- result: { success: true, output: `子代理 ${i} 完成` },
- durationMs: 600,
- }),
- ),
- llmStep({ text: '所有子代理完成。', durationMs: 200 }),
- ],
- });
- },
-});
diff --git a/packages/agent-mock/src/cases/generators/tool-stress.ts b/packages/agent-mock/src/cases/generators/tool-stress.ts
deleted file mode 100644
index 00fda8c8dc4..00000000000
--- a/packages/agent-mock/src/cases/generators/tool-stress.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { defineCase, llmStep, toolStep } from '../../builders/defineCase';
-import { defineGenerator } from './registry';
-
-export interface ToolStressParams {
- count: number;
- durationPerToolMs?: number;
- toolMix?: Array<{ identifier: string; apiName: string; weight: number }>;
-}
-
-export const toolStressGenerator = defineGenerator<ToolStressParams>({
- id: 'tool-stress',
- name: 'Tool Stress',
- description: 'Generate N tool calls bracketed by LLM steps',
- defaultParams: { count: 50, durationPerToolMs: 120 },
- factory: (params) => {
- const mix = params.toolMix ?? [
- { identifier: 'lobe-todo-write', apiName: 'addTodo', weight: 1 },
- ];
- const totalWeight = mix.reduce((s, m) => s + m.weight, 0);
- const pickTool = () => {
- let r = Math.random() * totalWeight;
- for (const m of mix) {
- r -= m.weight;
- if (r <= 0) return m;
- }
- return mix[0];
- };
-
- const tools = Array.from({ length: params.count }, (_, i) => {
- const m = pickTool();
- return toolStep({
- identifier: m.identifier,
- apiName: m.apiName,
- arguments: JSON.stringify({ index: i }),
- result: { success: true, index: i },
- durationMs: params.durationPerToolMs ?? 120,
- });
- });
-
- return defineCase({
- id: `tool-stress-${params.count}`,
- name: `Tool Stress × ${params.count}`,
- tags: ['stress', 'generated'],
- steps: [
- llmStep({ text: `Stress run with ${params.count} tools.`, durationMs: 300 }),
- ...tools,
- llmStep({ text: 'Stress run complete.', durationMs: 200 }),
- ],
- });
- },
-});
diff --git a/packages/builtin-skills/src/find-skills/content.ts b/packages/builtin-skills/src/find-skills/content.ts
deleted file mode 100644
index 6caad233d04..00000000000
--- a/packages/builtin-skills/src/find-skills/content.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-export const systemPrompt = `# Find Skills
-
-This skill helps you discover and install skills from the open agent skills ecosystem.
-
-## When to Use This Skill
-
-Use this skill when the user:
-
-- Asks "how do I do X" where X might be a common task with an existing skill
-- Says "find a skill for X" or "is there a skill for X"
-- Asks "can you do X" where X is a specialized capability
-- Expresses interest in extending agent capabilities
-- Wants to search for tools, templates, or workflows
-- Mentions they wish they had help with a specific domain (design, testing, deployment, etc.)
-
-## What is the Skills CLI?
-
-The Skills CLI (\`npx skills\`) is the package manager for the open agent skills ecosystem. Skills are modular packages that extend agent capabilities with specialized knowledge, workflows, and tools.
-
-**Key commands:**
-
-- \`npx skills find [query]\` - Search for skills interactively or by keyword
-- \`npx skills add <package>\` - Install a skill from GitHub or other sources
-- \`npx skills check\` - Check for skill updates
-- \`npx skills update\` - Update all installed skills
-
-**Browse skills at:** https://skills.sh/
-
-## How to Help Users Find Skills
-
-### Step 1: Understand What They Need
-
-When a user asks for help with something, identify:
-
-1. The domain (e.g., React, testing, design, deployment)
-2. The specific task (e.g., writing tests, creating animations, reviewing PRs)
-3. Whether this is a common enough task that a skill likely exists
-
-### Step 2: Search for Skills
-
-Run the find command with a relevant query:
-
-\`\`\`bash
-npx skills find [query]
-\`\`\`
-
-For example:
-
-- User asks "how do I make my React app faster?" → \`npx skills find react performance\`
-- User asks "can you help me with PR reviews?" → \`npx skills find pr review\`
-- User asks "I need to create a changelog" → \`npx skills find changelog\`
-
-The command will return results like:
-
-\`\`\`
-Install with npx skills add <owner/repo@skill>
-
-vercel-labs/agent-skills@vercel-react-best-practices
-└ https://skills.sh/vercel-labs/agent-skills/vercel-react-best-practices
-\`\`\`
-
-### Step 3: Present Options to the User
-
-When you find relevant skills, present them to the user with:
-
-1. The skill name and what it does
-2. The install command they can run
-3. A link to learn more at skills.sh
-
-Example response:
-
-\`\`\`
-I found a skill that might help! The "vercel-react-best-practices" skill provides
-React and Next.js performance optimization guidelines from Vercel Engineering.
-
-To install it:
-npx skills add vercel-labs/agent-skills@vercel-react-best-practices
-
-Learn more: https://skills.sh/vercel-labs/agent-skills/vercel-react-best-practices
-\`\`\`
-
-### Step 4: Offer to Install
-
-If the user wants to proceed, you can install the skill for them:
-
-\`\`\`bash
-npx skills add <owner/repo@skill> -g -y
-\`\`\`
-
-The \`-g\` flag installs globally (user-level) and \`-y\` skips confirmation prompts.
-
-## Common Skill Categories
-
-When searching, consider these common categories:
-
-| Category | Example Queries |
-| --------------- | ---------------------------------------- |
-| Web Development | react, nextjs, typescript, css, tailwind |
-| Testing | testing, jest, playwright, e2e |
-| DevOps | deploy, docker, kubernetes, ci-cd |
-| Documentation | docs, readme, changelog, api-docs |
-| Code Quality | review, lint, refactor, best-practices |
-| Design | ui, ux, design-system, accessibility |
-| Productivity | workflow, automation, git |
-
-## Tips for Effective Searches
-
-1. **Use specific keywords**: "react testing" is better than just "testing"
-2. **Try alternative terms**: If "deploy" doesn't work, try "deployment" or "ci-cd"
-3. **Check popular sources**: Many skills come from \`vercel-labs/agent-skills\` or \`ComposioHQ/awesome-claude-skills\`
-
-## When No Skills Are Found
-
-If no relevant skills exist:
-
-1. Acknowledge that no existing skill was found
-2. Offer to help with the task directly using your general capabilities
-3. Suggest the user could create their own skill with \`npx skills init\`
-
-Example:
-
-\`\`\`
-I searched for skills related to "xyz" but didn't find any matches.
-I can still help you with this task directly! Would you like me to proceed?
-
-If this is something you do often, you could create your own skill:
-npx skills init my-xyz-skill
-\`\`\`
-`;
diff --git a/packages/builtin-skills/src/find-skills/index.ts b/packages/builtin-skills/src/find-skills/index.ts
deleted file mode 100644
index a76861e6345..00000000000
--- a/packages/builtin-skills/src/find-skills/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { type BuiltinSkill } from '@lobechat/types';
-
-import { systemPrompt } from './content';
-
-export const FindSkillsIdentifier = 'find-skills';
-
-export const FindSkillsSkill: BuiltinSkill = {
- content: systemPrompt,
- description:
- 'Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", or express interest in extending capabilities',
- identifier: FindSkillsIdentifier,
- name: 'find-skills',
- source: 'builtin',
-};
diff --git a/packages/builtin-tool-local-system/src/client/components/index.ts b/packages/builtin-tool-local-system/src/client/components/index.ts
deleted file mode 100644
index 296e1cf85ce..00000000000
--- a/packages/builtin-tool-local-system/src/client/components/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { default as FileItem } from './FileItem';
-export { FilePathDisplay } from './FilePathDisplay';
diff --git a/packages/database/src/models/userMemory/sources/index.ts b/packages/database/src/models/userMemory/sources/index.ts
deleted file mode 100644
index e2df6615388..00000000000
--- a/packages/database/src/models/userMemory/sources/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './benchmarkLoCoMo'
-export * from './shared';
diff --git a/packages/model-runtime/src/core/usageConverters/utils/index.ts b/packages/model-runtime/src/core/usageConverters/utils/index.ts
deleted file mode 100644
index 62f3ca03d69..00000000000
--- a/packages/model-runtime/src/core/usageConverters/utils/index.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-export {
- computeChatCost,
- type ComputeChatCostOptions,
- type PricingComputationResult,
-} from './computeChatCost';
-export {
- computeImageCost,
- type ImageCostResult,
- type ImageGenerationParams,
-} from './computeImageCost';
-export {
- computeVideoCost,
- type VideoCostResult,
- type VideoGenerationParams,
-} from './computeVideoCost';
-export {
- type ChatCostEstimate,
- type ChatInputTokenEstimate,
- estimateChatCostFromMessages,
- type EstimateChatCostFromMessagesOptions,
- estimateChatCostFromTokens,
- type EstimateChatCostFromTokensInput,
- estimateChatOutputTokens,
- estimateOpenAIChatInputTokens,
- type EstimateOpenAIChatInputTokensOptions,
-} from './estimateChatCost';
-export { withUsageCost } from './withUsageCost';
diff --git a/packages/model-runtime/src/providers/comfyui/auth/AuthManager.ts b/packages/model-runtime/src/providers/comfyui/auth/AuthManager.ts
deleted file mode 100644
index 1a0dc34a82c..00000000000
--- a/packages/model-runtime/src/providers/comfyui/auth/AuthManager.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import type { ComfyUIKeyVault } from '@lobechat/types';
-import { createBasicAuthCredentials } from '@lobechat/utils';
-
-export interface BasicCredentials {
- password: string;
- type: 'basic';
- username: string;
-}
-
-export interface BearerTokenCredentials {
- apiKey: string;
- type: 'bearer';
-}
-
-export interface CustomCredentials {
- customHeaders: Record<string, string>;
- type: 'custom';
-}
-
-/**
- * ComfyUI Authentication Manager
- * Handles authentication headers generation for ComfyUI requests
- */
-export class AuthManager {
- private credentials: BasicCredentials | BearerTokenCredentials | CustomCredentials | undefined;
- private authHeaders: Record<string, string> | undefined;
-
- constructor(options: ComfyUIKeyVault) {
- this.validateOptions(options);
- this.credentials = this.createCredentials(options);
- this.authHeaders = this.createAuthHeaders(options);
- }
-
- getAuthHeaders(): Record<string, string> | undefined {
- return this.authHeaders;
- }
-
- private validateOptions(options: ComfyUIKeyVault): void {
- const { authType = 'none', apiKey, username, password, customHeaders } = options;
-
- switch (authType) {
- case 'basic': {
- if (!username || !password) {
- throw new TypeError('Username and password are required for basic authentication');
- }
- break;
- }
- case 'bearer': {
- if (!apiKey) {
- throw new TypeError('API key is required for bearer token authentication');
- }
- break;
- }
- case 'custom': {
- if (!customHeaders || Object.keys(customHeaders).length === 0) {
- throw new TypeError('Custom headers are required for custom authentication');
- }
- break;
- }
- case 'none': {
- // No validation needed for none authentication
- break;
- }
- default: {
- throw new TypeError(`Unsupported authentication type: ${authType}`);
- }
- }
- }
-
- private createCredentials(
- options: ComfyUIKeyVault,
- ): BasicCredentials | BearerTokenCredentials | CustomCredentials | undefined {
- const { authType = 'none', apiKey, username, password, customHeaders } = options;
-
- switch (authType) {
- case 'basic': {
- return { password: password!, type: 'basic', username: username! };
- }
- case 'bearer': {
- return { apiKey: apiKey!, type: 'bearer' };
- }
- case 'custom': {
- return { customHeaders: customHeaders!, type: 'custom' };
- }
- case 'none': {
- return undefined;
- }
- }
- }
-
- private createAuthHeaders(options: ComfyUIKeyVault): Record<string, string> | undefined {
- const { authType = 'none', apiKey, username, password, customHeaders } = options;
-
- switch (authType) {
- case 'basic': {
- if (!username || !password) return undefined;
- const credentials = createBasicAuthCredentials(username, password);
- return { Authorization: `Basic ${credentials}` };
- }
-
- case 'bearer': {
- if (!apiKey) return undefined;
- return { Authorization: `Bearer ${apiKey}` };
- }
-
- case 'custom': {
- return customHeaders || undefined;
- }
-
- case 'none': {
- return undefined;
- }
- }
- }
-}
diff --git a/packages/observability-otel/src/modules/index.ts b/packages/observability-otel/src/modules/index.ts
deleted file mode 100644
index 4b785bfd12c..00000000000
--- a/packages/observability-otel/src/modules/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './memory-user-memory';
diff --git a/packages/types/src/exportConfig.ts b/packages/types/src/exportConfig.ts
deleted file mode 100644
index b30b2747a6e..00000000000
--- a/packages/types/src/exportConfig.ts
+++ /dev/null
@@ -1,132 +0,0 @@
-import type { UIChatMessage } from './message';
-import type { LobeSessions, SessionGroupItem } from './session';
-import type { ChatTopic } from './topic';
-import type { UserSettings } from './user/settings';
-
-// ---------- TODO: this file need to be deleted in V2 ---------- //
-
-/**
- * Export type
- * @enum ['agents', 'sessions', 'singleSession', 'settings', 'all']
- * @enumNames ['agents', 'sessions', 'singleSession', 'settings', 'all']
- */
-export type ExportType = 'agents' | 'sessions' | 'singleSession' | 'settings' | 'all';
-
-/**
- * Config model map
- */
-export interface ConfigModelMap {
- agents: {
- file: ConfigFileAgents;
- state: ConfigStateAgents;
- };
- all: {
- file: ConfigFileAll;
- state: ConfigStateAll;
- };
- sessions: {
- file: ConfigFileSessions;
- state: ConfigStateSessions;
- };
- settings: {
- file: ConfigFileSettings;
- state: ConfigStateSettings;
- };
- singleSession: {
- file: ConfigFileSingleSession;
- state: ConfigStateSingleSession;
- };
-}
-
-// ============= Config Data Structures ============= //
-
-/**
- * Config state: Sessions
- */
-export interface ConfigStateSessions {
- messages: UIChatMessage[];
- sessionGroups: SessionGroupItem[];
- sessions: LobeSessions;
- topics: ChatTopic[];
-}
-
-/**
- * Config state: Single session
- */
-export interface ConfigStateSingleSession {
- messages: UIChatMessage[];
- sessions: LobeSessions;
- topics: ChatTopic[];
-}
-
-/**
- * Config state: Agents
- */
-export interface ConfigStateAgents {
- sessionGroups: SessionGroupItem[];
- sessions: LobeSessions;
-}
-
-/**
- * Config state: Settings
- */
-export interface ConfigStateSettings {
- settings: UserSettings;
-}
-
-/**
- * Config state: All
- */
-export interface ConfigStateAll extends ConfigStateSessions, ConfigStateSettings {}
-
-// ============= Config File Types ============= //
-
-/**
- * Config file: Settings
- */
-export interface ConfigFileSettings {
- exportType: 'settings';
- state: ConfigStateSettings;
- version: number;
-}
-
-/**
- * Config file: Sessions
- */
-export interface ConfigFileSessions {
- exportType: 'sessions';
- state: ConfigStateSessions;
- version: number;
-}
-
-/**
- * Config file: Single session
- */
-export interface ConfigFileSingleSession {
- exportType: 'sessions';
- state: ConfigStateSingleSession;
- version: number;
-}
-
-/**
- * Config file: Agents
- */
-export interface ConfigFileAgents {
- exportType: 'agents';
- state: ConfigStateAgents;
- version: number;
-}
-
-/**
- * Config file: All
- */
-export interface ConfigFileAll {
- exportType: 'all';
- state: ConfigStateAll;
- version: number;
-}
-
-/**
- * Config file
- */
-export type ConfigFile = ConfigFileSettings | ConfigFileSessions | ConfigFileAll | ConfigFileAgents;
diff --git a/packages/types/src/openai/image.ts b/packages/types/src/openai/image.ts
deleted file mode 100644
index 822002ca784..00000000000
--- a/packages/types/src/openai/image.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { DallEImageQuality, DallEImageSize, DallEImageStyle } from '../tool/dalle';
-
-export interface OpenAIImagePayload {
- model: 'dall-e-2' | 'dall-e-3';
- /**
- * The number of images to generate. Must be between 1 and 10.
- */
- n?: number;
- /**
- * A text description of the desired image(s).
- * The maximum length is 1000 characters.
- */
- prompt: string;
- /**
- * The quality of the image that will be generated.
- * hd creates images with finer details and greater consistency across the image.
- * This param is only supported for dall-e-3.
- */
- quality?: DallEImageQuality;
- /**
- * The size of the generated images.
- * Must be one of '1792x1024' , '1024x1024' , '1024x1792'
- */
- size?: DallEImageSize;
-
- /**
- * The style of the generated images. Must be one of vivid or natural.
- * Vivid causes the model to lean towards generating hyper-real and dramatic images.
- * Natural causes the model to produce more natural, less hyper-real looking images.
- * This param is only supported for dall-e-3.
- * @default vivid
- */
- style?: DallEImageStyle;
-}
diff --git a/packages/types/src/plugins/protocol.ts b/packages/types/src/plugins/protocol.ts
deleted file mode 100644
index 2faef477002..00000000000
--- a/packages/types/src/plugins/protocol.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * Protocol source type
- */
-export enum ProtocolSource {
- /** Community contribution */
- COMMUNITY = 'community',
- /** Developer custom */
- DEVELOPER = 'developer',
- /** GitHub official */
- GITHUB_OFFICIAL = 'github_official',
- /** Official LobeHub marketplace */
- OFFICIAL = 'official',
- /** Third-party marketplace */
- THIRD_PARTY = 'third_party',
-}
-
-/**
- * MCP Schema - stdio configuration type
- */
-export interface McpStdioConfig {
- args?: string[];
- command: string;
- env?: Record<string, string>;
- type: 'stdio';
-}
-
-/**
- * MCP Schema - http configuration type
- */
-export interface McpHttpConfig {
- headers?: Record<string, string>;
- type: 'http';
- url: string;
-}
-
-/**
- * MCP Schema configuration type
- */
-export type McpConfig = McpStdioConfig | McpHttpConfig;
-
-/**
- * MCP Schema object
- * Conforms to RFC 0001 definition
- */
-export interface McpSchema {
- /** Plugin author */
- author: string;
- /** Plugin configuration */
- config: McpConfig;
- /** Plugin description */
- description: string;
- /** Plugin homepage */
- homepage?: string;
- /** Plugin icon */
- icon?: string;
- /** Plugin unique identifier, must match the id parameter in the URL */
- identifier: string;
- /** Plugin name */
- name: string;
- /** Plugin version (semver) */
- version: string;
-}
-
-/**
- * RFC 0001 protocol parameters
- * lobehub://plugin/install?id=xxx&schema=xxx&marketId=xxx&meta_*=xxx
- */
-export interface McpInstallProtocolParamsRFC {
- /** Optional UI display metadata, prefixed with meta_ */
- [key: `meta_${string}`]: string | undefined;
- /** Unique identifier of the plugin */
- id: string;
- /** Unique identifier of the Marketplace providing this plugin */
- marketId?: string;
- /** Base64URL encoded MCP Schema object */
- schema: string;
- /** Plugin type, fixed as 'mcp' for MCP */
- type: 'mcp';
-}
-
-/**
- * Protocol URL parsing result
- */
-export interface ProtocolUrlParsed {
- /** Action type (e.g.: 'install') */
- action: 'install' | 'configure' | 'update';
- /** Parsed parameters */
- params: {
- id: string;
- marketId?: string;
- type: string;
- };
- /** MCP Schema object */
- schema: McpSchema;
- /** Protocol source */
- source: ProtocolSource;
- /** Plugin type (e.g.: 'mcp') */
- type: 'mcp' | 'plugin';
- /** URL type (e.g.: 'plugin') */
- urlType: string;
-}
-
-/**
- * Installation confirmation dialog information
- */
-export interface InstallConfirmationInfo {
- dependencies?: string[];
- permissions?: {
- filesystem?: boolean;
- network?: boolean;
- system?: boolean;
- };
- pluginInfo: {
- author?: string;
- description: string;
- homepage?: string;
- icon?: string;
- identifier: string;
- name: string;
- version: string;
- };
- source: {
- platform?: {
- name: string;
- url?: string;
- };
- type: ProtocolSource;
- verified: boolean; // Whether it's a verified source
- };
-}
-
-/**
- * Protocol handler interface
- */
-export interface ProtocolHandler {
- /**
- * Handle protocol URL
- */
- handle: (
- parsed: ProtocolUrlParsed,
- ) => Promise<{ error?: string; success: boolean; targetWindow?: string }>;
-
- /**
- * Supported actions
- */
- readonly supportedActions: string[];
-
- /**
- * Protocol type
- */
- readonly type: string;
-}
-
-/**
- * Protocol routing configuration
- */
-export interface ProtocolRouteConfig {
- /** Action type */
- action: string;
- /** Target path (relative to window base path) */
- targetPath?: string;
- /** Target window */
- targetWindow: 'chat' | 'settings';
- /** Protocol type */
- type: string;
-}
diff --git a/packages/types/src/tool/dalle.ts b/packages/types/src/tool/dalle.ts
deleted file mode 100644
index 2b5ee0bd455..00000000000
--- a/packages/types/src/tool/dalle.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export type DallEImageQuality = 'standard' | 'hd';
-export type DallEImageStyle = 'vivid' | 'natural';
-export type DallEImageSize = '1792x1024' | '1024x1024' | '1024x1792';
-
-export interface DallEImageItem {
- imageId?: string;
- previewUrl?: string;
- prompt: string;
- quality: DallEImageQuality;
- size: DallEImageSize;
- style: DallEImageStyle;
-}
diff --git a/packages/types/src/userMemory/server.ts b/packages/types/src/userMemory/server.ts
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/src/components/BrowserIcon/types.ts b/src/components/BrowserIcon/types.ts
deleted file mode 100644
index 7fde65ae3bc..00000000000
--- a/src/components/BrowserIcon/types.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { type CSSProperties } from 'react';
-
-export interface SVGComponent {
- className?: string;
- height?: number | string;
- style?: CSSProperties;
- width?: number | string;
-}
diff --git a/src/components/mdx/constants.ts b/src/components/mdx/constants.ts
deleted file mode 100644
index 3114ff2ebea..00000000000
--- a/src/components/mdx/constants.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DEFAULT_IMAGE_WIDTH = 800;
diff --git a/src/features/AgentTasks/features/index.ts b/src/features/AgentTasks/features/index.ts
deleted file mode 100644
index 592dc86f091..00000000000
--- a/src/features/AgentTasks/features/index.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-export { default as AgentTaskCardList } from './AgentTaskCardList';
-export { default as AgentTaskItem } from './AgentTaskItem';
-export { default as AssigneeAvatar } from './AssigneeAvatar';
-export { default as PriorityHighIcon } from './icons/PriorityHighIcon';
-export { default as PriorityLowIcon } from './icons/PriorityLowIcon';
-export { default as PriorityMediumIcon } from './icons/PriorityMediumIcon';
-export { default as PriorityNoneIcon } from './icons/PriorityNoneIcon';
-export { default as PriorityUrgentIcon } from './icons/PriorityUrgentIcon';
-export { default as TaskListHeader } from './TaskListHeader';
-export { default as TaskPriorityTag } from './TaskPriorityTag';
-export { default as TaskStatusIcon } from './TaskStatusIcon';
-export { default as TaskSubtaskProgressTag } from './TaskSubtaskProgressTag';
-export { default as TaskTriggerTag } from './TaskTriggerTag';
-export { default as TaskVisibilityChipLabel } from './TaskVisibilityChipLabel';
-export { default as TaskVisibilityTag } from './TaskVisibilityTag';
diff --git a/src/features/ChatInput/ActionBar/styles.ts b/src/features/ChatInput/ActionBar/styles.ts
deleted file mode 100644
index 5caf04bd7b2..00000000000
--- a/src/features/ChatInput/ActionBar/styles.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { createStaticStyles } from 'antd-style';
-
-const prefixCls = 'ant';
-
-export const styles = createStaticStyles(({ css }) => ({
- dropdownMenu: css`
- &.${prefixCls}-dropdown-menu {
- .${prefixCls}-dropdown-menu-item-group-list {
- margin: 0;
- }
- .${prefixCls}-avatar {
- margin-inline-end: var(--ant-margin-xs);
- }
- }
- `,
-}));
diff --git a/src/features/ChatInput/Desktop/ContextItem/FileItem/utils.ts b/src/features/ChatInput/Desktop/ContextItem/FileItem/utils.ts
deleted file mode 100644
index cb8504edc9d..00000000000
--- a/src/features/ChatInput/Desktop/ContextItem/FileItem/utils.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-export const getFileBasename = (filename: string): string => {
- const lastDotIndex = filename.lastIndexOf('.');
- if (lastDotIndex <= 0) return filename;
- return filename.slice(0, lastDotIndex);
-};
-
-export const getHarmoniousSize = (
- inputWidth: number,
- inputHeight: number,
- {
- spacing = 24,
- containerWidth,
- containerHeight,
- }: { containerHeight: number; containerWidth: number; spacing: number },
-) => {
- let width = String(inputWidth);
- let height = String(inputHeight);
-
- const maxWidth = containerWidth - spacing;
- const maxHeight = containerHeight - spacing;
-
- if (inputHeight >= inputWidth && inputHeight >= maxHeight) {
- height = maxHeight + 'px';
- width = 'auto';
- } else if (inputWidth >= inputHeight && inputWidth >= maxWidth) {
- height = 'auto';
- width = maxWidth + 'px';
- } else {
- width = width + 'px';
- height = height + 'px';
- }
-
- return { height, width };
-};
diff --git a/src/features/ChatInput/Desktop/FilePreview/FileItem/utils.ts b/src/features/ChatInput/Desktop/FilePreview/FileItem/utils.ts
deleted file mode 100644
index 71d7ec5d015..00000000000
--- a/src/features/ChatInput/Desktop/FilePreview/FileItem/utils.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-export const getHarmoniousSize = (
- inputWidth: number,
- inputHeight: number,
- {
- spacing = 24,
- containerWidth,
- containerHeight,
- }: { containerHeight: number; containerWidth: number; spacing: number },
-) => {
- let width = String(inputWidth);
- let height = String(inputHeight);
-
- const maxWidth = containerWidth - spacing;
- const maxHeight = containerHeight - spacing;
-
- if (inputHeight >= inputWidth && inputHeight >= maxHeight) {
- height = maxHeight + 'px';
- width = 'auto';
- } else if (inputWidth >= inputHeight && inputWidth >= maxWidth) {
- height = 'auto';
- width = maxWidth + 'px';
- } else {
- width = width + 'px';
- height = height + 'px';
- }
-
- return { height, width };
-};
diff --git a/src/features/ChatInput/types.ts b/src/features/ChatInput/types.ts
deleted file mode 100644
index 755d6c687f2..00000000000
--- a/src/features/ChatInput/types.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type { ActionKeys } from './ActionBar/config';
diff --git a/src/features/Conversation/Markdown/plugins/remarkPlugins/createRemarkCustomTagWithAttributesPlugin.ts b/src/features/Conversation/Markdown/plugins/remarkPlugins/createRemarkCustomTagWithAttributesPlugin.ts
deleted file mode 100644
index e4e6106d08c..00000000000
--- a/src/features/Conversation/Markdown/plugins/remarkPlugins/createRemarkCustomTagWithAttributesPlugin.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { SKIP, visit } from 'unist-util-visit';
-
-import { treeNodeToString } from './getNodeContent';
-
-// Regex to parse attributes from a string
-// Handles keys, keys with quoted values (double or single), and boolean keys
-const attributeRegex = /([\w-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g;
-
-// Helper function to parse the attribute string into an object
-const parseAttributes = (attributeString: string): Record<string, string | boolean> => {
- const attributes: Record<string, string | boolean> = {};
- let match;
- while ((match = attributeRegex.exec(attributeString)) !== null) {
- const [, key, valueDouble, valueSingle, valueUnquoted] = match;
- // If any value group is captured, use it, otherwise treat as boolean true
- attributes[key] = valueDouble ?? valueSingle ?? valueUnquoted ?? true;
- }
- return attributes;
-};
-
-export const createRemarkCustomTagWithAttributesPlugin = (tag: string) => () => {
- return (tree: any) => {
- visit(tree, 'html', (node, index, parent) => {
- // Match opening tags with or without attributes
- const openTagRegex = new RegExp(`^<${tag}(\\s+[^>]+)?>$`);
- const match = node.value.match(openTagRegex);
-
- if (match) {
- const [, attributesString] = match;
- const startIndex = index as number;
- let endIndex = startIndex + 1;
- let hasCloseTag = false;
-
- // Find closing tag
- while (endIndex < parent.children.length) {
- const sibling = parent.children[endIndex];
- if (sibling.type === 'html' && sibling.value === `</${tag}>`) {
- hasCloseTag = true;
- break;
- }
- endIndex++;
- }
-
- // Calculate deletion range
- const deleteCount = hasCloseTag
- ? endIndex - startIndex + 1
- : parent.children.length - startIndex;
-
- // Extract content nodes
- const contentNodes = parent.children.slice(
- startIndex + 1,
- hasCloseTag ? endIndex : undefined,
- );
-
- // Convert to Markdown string
- const content = treeNodeToString(contentNodes);
-
- // Parse attributes
- const properties = attributesString ? parseAttributes(attributesString.trim()) : {};
-
- // Create custom node
- const customNode = {
- data: {
- hChildren: [{ type: 'text', value: content }],
- hName: tag,
- hProperties: properties,
- },
- position: node.position,
- type: tag,
- };
-
- // Replace original nodes
- parent.children.splice(startIndex, deleteCount, customNode);
-
- // Skip processed nodes
- return [SKIP, startIndex + 1];
- }
- });
- };
-};
diff --git a/src/features/Conversation/Messages/GroupTasks/TaskItem/useClientTaskStats.ts b/src/features/Conversation/Messages/GroupTasks/TaskItem/useClientTaskStats.ts
deleted file mode 100644
index a339b31ec9a..00000000000
--- a/src/features/Conversation/Messages/GroupTasks/TaskItem/useClientTaskStats.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-'use client';
-
-import { useMemo } from 'react';
-
-import { useChatStore } from '@/store/chat';
-import { displayMessageSelectors } from '@/store/chat/selectors';
-import { messageMapKey } from '@/store/chat/utils/messageMapKey';
-
-export interface ClientTaskStats {
- isLoading: boolean;
- startTime?: number;
- steps: number;
- toolCalls: number;
-}
-
-interface UseClientTaskStatsOptions {
- /** Agent ID from the task message (use task's agentId, not activeAgentId) */
- agentId?: string;
- enabled?: boolean;
- /** Group ID from the task message (use task's groupId, not activeGroupId) */
- groupId?: string;
- threadId?: string;
-}
-
-/**
- * Hook to fetch thread messages and compute task statistics for client mode tasks.
- * Used in TaskItem to display progress metrics (steps, tool calls, elapsed time).
- */
-export const useClientTaskStats = ({
- agentId: propAgentId,
- groupId,
- threadId,
- enabled = true,
-}: UseClientTaskStatsOptions): ClientTaskStats => {
- // Use task message's agentId to query with the correct SubAgent ID that created the thread
- // Fall back to activeAgentId if not provided
- const [activeAgentId, activeTopicId, useFetchMessages] = useChatStore((s) => [
- s.activeAgentId,
- s.activeTopicId,
- s.useFetchMessages,
- ]);
-
- const agentId = propAgentId || activeAgentId;
-
- const threadContext = useMemo(
- () => ({
- agentId,
- groupId,
- scope: 'thread' as const,
- threadId,
- topicId: activeTopicId,
- }),
- [agentId, groupId, activeTopicId, threadId],
- );
-
- const threadMessageKey = useMemo(
- () => (threadId ? messageMapKey(threadContext) : null),
- [threadId, threadContext],
- );
-
- // Fetch thread messages (skip when disabled or no threadId)
- useFetchMessages(threadContext, { skipFetch: !enabled || !threadId });
-
- // Get thread messages from store using selector
- const threadMessages = useChatStore((s) =>
- threadMessageKey
- ? displayMessageSelectors.getDisplayMessagesByKey(threadMessageKey)(s)
- : undefined,
- );
-
- // Compute stats from thread messages
- return useMemo(() => {
- if (!threadMessages || !enabled) {
- return { isLoading: true, steps: 0, toolCalls: 0 };
- }
-
- // Find the assistantGroup message which contains the children blocks
- const assistantGroupMessage = threadMessages.find((item) => item.role === 'assistantGroup');
- const blocks = assistantGroupMessage?.children ?? [];
-
- // Calculate stats
- const steps = blocks.length;
- const toolCalls = blocks.reduce((sum, block) => sum + (block.tools?.length || 0), 0);
- const startTime = assistantGroupMessage?.createdAt;
-
- return {
- isLoading: false,
- startTime,
- steps,
- toolCalls,
- };
- }, [threadMessages, enabled]);
-};
diff --git a/src/features/Conversation/Messages/Tasks/TaskItem/useClientTaskStats.ts b/src/features/Conversation/Messages/Tasks/TaskItem/useClientTaskStats.ts
deleted file mode 100644
index a339b31ec9a..00000000000
--- a/src/features/Conversation/Messages/Tasks/TaskItem/useClientTaskStats.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-'use client';
-
-import { useMemo } from 'react';
-
-import { useChatStore } from '@/store/chat';
-import { displayMessageSelectors } from '@/store/chat/selectors';
-import { messageMapKey } from '@/store/chat/utils/messageMapKey';
-
-export interface ClientTaskStats {
- isLoading: boolean;
- startTime?: number;
- steps: number;
- toolCalls: number;
-}
-
-interface UseClientTaskStatsOptions {
- /** Agent ID from the task message (use task's agentId, not activeAgentId) */
- agentId?: string;
- enabled?: boolean;
- /** Group ID from the task message (use task's groupId, not activeGroupId) */
- groupId?: string;
- threadId?: string;
-}
-
-/**
- * Hook to fetch thread messages and compute task statistics for client mode tasks.
- * Used in TaskItem to display progress metrics (steps, tool calls, elapsed time).
- */
-export const useClientTaskStats = ({
- agentId: propAgentId,
- groupId,
- threadId,
- enabled = true,
-}: UseClientTaskStatsOptions): ClientTaskStats => {
- // Use task message's agentId to query with the correct SubAgent ID that created the thread
- // Fall back to activeAgentId if not provided
- const [activeAgentId, activeTopicId, useFetchMessages] = useChatStore((s) => [
- s.activeAgentId,
- s.activeTopicId,
- s.useFetchMessages,
- ]);
-
- const agentId = propAgentId || activeAgentId;
-
- const threadContext = useMemo(
- () => ({
- agentId,
- groupId,
- scope: 'thread' as const,
- threadId,
- topicId: activeTopicId,
- }),
- [agentId, groupId, activeTopicId, threadId],
- );
-
- const threadMessageKey = useMemo(
- () => (threadId ? messageMapKey(threadContext) : null),
- [threadId, threadContext],
- );
-
- // Fetch thread messages (skip when disabled or no threadId)
- useFetchMessages(threadContext, { skipFetch: !enabled || !threadId });
-
- // Get thread messages from store using selector
- const threadMessages = useChatStore((s) =>
- threadMessageKey
- ? displayMessageSelectors.getDisplayMessagesByKey(threadMessageKey)(s)
- : undefined,
- );
-
- // Compute stats from thread messages
- return useMemo(() => {
- if (!threadMessages || !enabled) {
- return { isLoading: true, steps: 0, toolCalls: 0 };
- }
-
- // Find the assistantGroup message which contains the children blocks
- const assistantGroupMessage = threadMessages.find((item) => item.role === 'assistantGroup');
- const blocks = assistantGroupMessage?.children ?? [];
-
- // Calculate stats
- const steps = blocks.length;
- const toolCalls = blocks.reduce((sum, block) => sum + (block.tools?.length || 0), 0);
- const startTime = assistantGroupMessage?.createdAt;
-
- return {
- isLoading: false,
- startTime,
- steps,
- toolCalls,
- };
- }, [threadMessages, enabled]);
-};
diff --git a/src/features/Conversation/components/ShareMessageModal/ShareText/type.ts b/src/features/Conversation/components/ShareMessageModal/ShareText/type.ts
deleted file mode 100644
index 9fda376352c..00000000000
--- a/src/features/Conversation/components/ShareMessageModal/ShareText/type.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export type FieldType = {
- includeTool: boolean;
-};
diff --git a/src/features/DataImporter/style.ts b/src/features/DataImporter/style.ts
deleted file mode 100644
index 0d445cb1199..00000000000
--- a/src/features/DataImporter/style.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { createStaticStyles } from 'antd-style';
-
-export const styles = createStaticStyles(({ css }) => {
- return {
- children: css`
- &::before {
- content: '';
- position: absolute;
- inset: 0;
- background-color: transparent;
- }
- `,
- wrapper: css`
- font-size: inherit;
- `,
- };
-});
diff --git a/src/features/ModelParamsControl/index.ts b/src/features/ModelParamsControl/index.ts
deleted file mode 100644
index cf8ec641bf0..00000000000
--- a/src/features/ModelParamsControl/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as FrequencyPenalty } from './FrequencyPenalty';
-export { default as PresencePenalty } from './PresencePenalty';
-export { default as Temperature } from './Temperature';
-export { default as TopP } from './TopP';
diff --git a/src/features/ModelSwitchPanel/hooks/useCurrentModelName.ts b/src/features/ModelSwitchPanel/hooks/useCurrentModelName.ts
deleted file mode 100644
index 864303d1595..00000000000
--- a/src/features/ModelSwitchPanel/hooks/useCurrentModelName.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { useMemo } from 'react';
-
-import { type EnabledProviderWithModels } from '@/types/aiProvider';
-
-export const useCurrentModelName = (
- enabledList: EnabledProviderWithModels[],
- model: string,
-): string => {
- return useMemo(() => {
- for (const providerItem of enabledList) {
- const modelItem = providerItem.children.find((m) => m.id === model);
- if (modelItem) {
- return modelItem.displayName || modelItem.id;
- }
- }
- return model;
- }, [enabledList, model]);
-};
diff --git a/src/features/Pages/index.ts b/src/features/Pages/index.ts
deleted file mode 100644
index 2efcb297fe7..00000000000
--- a/src/features/Pages/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as PageLayout } from './PageLayout';
diff --git a/src/features/PluginsUI/Render/BuiltinType/useToolRenderCaps.ts b/src/features/PluginsUI/Render/BuiltinType/useToolRenderCaps.ts
deleted file mode 100644
index 940f644c2b8..00000000000
--- a/src/features/PluginsUI/Render/BuiltinType/useToolRenderCaps.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import type { ToolRenderCapabilities } from '@lobechat/shared-tool-ui';
-import { useMemo } from 'react';
-
-import { localFileService } from '@/services/electron/localFileService';
-import { useChatStore } from '@/store/chat';
-import { chatToolSelectors } from '@/store/chat/slices/builtinTool/selectors';
-import { useElectronStore } from '@/store/electron';
-import { desktopStateSelectors } from '@/store/electron/selectors';
-
-/**
- * Provides platform-aware capabilities for tool render components.
- * In Electron: provides file operations, loading state, relative paths.
- * In browser: provides only loading state (no file operations).
- */
-export const useToolRenderCaps = (): ToolRenderCapabilities => {
- const isElectron = typeof window !== 'undefined' && !!(window as any).__ELECTRON__;
-
- return useMemo<ToolRenderCapabilities>(() => {
- const caps: ToolRenderCapabilities = {
- isLoading: (messageId: string) => {
- return chatToolSelectors.isSearchingLocalFiles(messageId)(useChatStore.getState());
- },
- };
-
- if (isElectron) {
- caps.openFile = (path: string) => {
- localFileService.openLocalFile({ path });
- };
- caps.openFolder = (path: string) => {
- localFileService.openLocalFolder({ isDirectory: false, path });
- };
- caps.displayRelativePath = (path: string) => {
- return desktopStateSelectors.displayRelativePath(path)(useElectronStore.getState());
- };
- }
-
- return caps;
- }, [isElectron]);
-};
diff --git a/src/features/ResourceManager/components/LibraryHierarchy/types.ts b/src/features/ResourceManager/components/LibraryHierarchy/types.ts
deleted file mode 100644
index e4e51d660ab..00000000000
--- a/src/features/ResourceManager/components/LibraryHierarchy/types.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export interface TreeItem {
- children?: TreeItem[];
- fileType: string;
- id: string;
- isFolder: boolean;
- metadata?: Record<string, any>;
- name: string;
- slug?: string | null;
- sourceType?: string;
- url: string;
- userId?: string | null;
- visibility?: 'private' | 'public' | null;
-}
diff --git a/src/hooks/useAgentEnableSearch.ts b/src/hooks/useAgentEnableSearch.ts
deleted file mode 100644
index b502aad58f7..00000000000
--- a/src/hooks/useAgentEnableSearch.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { useAgentStore } from '@/store/agent';
-import { agentChatConfigSelectors, agentSelectors } from '@/store/agent/selectors';
-import { aiModelSelectors, useAiInfraStore } from '@/store/aiInfra';
-
-export const useAgentEnableSearch = () => {
- const [model, provider, agentSearchMode] = useAgentStore((s) => [
- agentSelectors.currentAgentModel(s),
- agentSelectors.currentAgentModelProvider(s),
- agentChatConfigSelectors.agentSearchMode(s),
- ]);
-
- const searchImpl = useAiInfraStore(aiModelSelectors.modelBuiltinSearchImpl(model, provider));
-
- // Built-in search implementations always support web search
- if (searchImpl === 'internal') return true;
-
- // If disabled, web search is not allowed
- return agentSearchMode !== 'off';
-};
diff --git a/src/hooks/useBidirectionalQuerySync.ts b/src/hooks/useBidirectionalQuerySync.ts
deleted file mode 100644
index 19a0c9997a3..00000000000
--- a/src/hooks/useBidirectionalQuerySync.ts
+++ /dev/null
@@ -1,112 +0,0 @@
-'use client';
-
-import { useEffect, useRef } from 'react';
-
-import { parseAsString, useQueryState } from '@/hooks/useQueryParam';
-
-interface UseBidirectionalQuerySyncOptions {
- /**
- * Default value when query is not present
- */
- defaultValue: string;
-}
-
-/**
- * Hook for bidirectional sync between URL query parameter and store state.
- * Prevents infinite loops by tracking the source of changes.
- *
- * @param queryKey - The URL query parameter key
- * @param storeValue - Current value from the store
- * @param setStoreValue - Function to update store value (setState or action)
- * @param options - Configuration with required defaultValue
- *
- * @example
- * ```tsx
- * // In a component
- * const activeTabId = useGroupProfileStore((s) => s.activeTabId);
- *
- * useBidirectionalQuerySync('tab', activeTabId, (value) => {
- * useGroupProfileStore.setState({ activeTabId: value });
- * }, { defaultValue: 'group' });
- * ```
- */
-export const useBidirectionalQuerySync = (
- queryKey: string,
- storeValue: string,
- setStoreValue: (value: string) => void,
- options: UseBidirectionalQuerySyncOptions,
-) => {
- const { defaultValue } = options;
-
- const [queryValue, setQueryValue] = useQueryState(
- queryKey,
- parseAsString.withDefault(defaultValue),
- );
-
- // Track if the change came from URL to prevent sync loops
- const isUrlChangeRef = useRef(false);
-
- // Sync URL → Store (when URL changes)
- useEffect(() => {
- if (queryValue !== storeValue) {
- isUrlChangeRef.current = true;
- setStoreValue(queryValue);
- }
- }, [queryValue, setStoreValue]);
-
- // Sync Store → URL (when store changes, but not from URL)
- useEffect(() => {
- if (isUrlChangeRef.current) {
- isUrlChangeRef.current = false;
- return;
- }
- if (storeValue !== queryValue) {
- setQueryValue(storeValue);
- }
- }, [storeValue, queryValue, setQueryValue]);
-};
-
-/**
- * Hook for bidirectional sync with optional/undefined store values.
- * Useful when the store value can be undefined (like activeTopicId).
- *
- * @example
- * ```tsx
- * const activeTopicId = useChatStore((s) => s.activeTopicId);
- *
- * useBidirectionalQuerySyncOptional('bt', activeTopicId, (value) => {
- * useChatStore.setState({ activeTopicId: value });
- * });
- * ```
- */
-export const useBidirectionalQuerySyncOptional = (
- queryKey: string,
- storeValue: string | undefined,
- setStoreValue: (value: string | undefined) => void,
-) => {
- const [queryValue, setQueryValue] = useQueryState(queryKey);
-
- // Track if the change came from URL to prevent sync loops
- const isUrlChangeRef = useRef(false);
-
- // Sync URL → Store (when URL changes)
- useEffect(() => {
- const urlValue = queryValue ?? undefined;
- if (urlValue !== storeValue) {
- isUrlChangeRef.current = true;
- setStoreValue(urlValue);
- }
- }, [queryValue, setStoreValue]);
-
- // Sync Store → URL (when store changes, but not from URL)
- useEffect(() => {
- if (isUrlChangeRef.current) {
- isUrlChangeRef.current = false;
- return;
- }
- const urlValue = queryValue ?? undefined;
- if (storeValue !== urlValue) {
- setQueryValue(storeValue ?? null);
- }
- }, [storeValue, queryValue, setQueryValue]);
-};
diff --git a/src/hooks/useDiscoverTab.ts b/src/hooks/useDiscoverTab.ts
deleted file mode 100644
index 2b909ef3f0f..00000000000
--- a/src/hooks/useDiscoverTab.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { DiscoverTab } from '@/types/discover';
-
-import { useQueryState } from './useQueryParam';
-
-export const useDiscoverTab = () => {
- const [type] = useQueryState('type', {
- clearOnDefault: true,
- defaultValue: DiscoverTab.Assistants,
- });
-
- return type as DiscoverTab;
-};
diff --git a/src/hooks/useFetchAgentDocuments.ts b/src/hooks/useFetchAgentDocuments.ts
deleted file mode 100644
index f63c4cd5cfd..00000000000
--- a/src/hooks/useFetchAgentDocuments.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { useAgentStore } from '@/store/agent';
-
-export const useFetchAgentDocuments = (agentId?: string | null) => {
- const useFetchAgentDocuments = useAgentStore((s) => s.useFetchAgentDocuments);
-
- useFetchAgentDocuments(agentId);
-};
diff --git a/src/hooks/useFetchGroups.ts b/src/hooks/useFetchGroups.ts
deleted file mode 100644
index a55997fc0c1..00000000000
--- a/src/hooks/useFetchGroups.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { useAgentGroupStore } from '@/store/agentGroup';
-import { useUserStore } from '@/store/user';
-import { authSelectors } from '@/store/user/slices/auth/selectors';
-
-export const useFetchGroups = () => {
- const isLogin = useUserStore(authSelectors.isLogin);
- const useFetchGroups = useAgentGroupStore((s) => s.useFetchGroups);
-
- useFetchGroups(true, isLogin ?? false);
-};
diff --git a/src/hooks/useGreeting/greetingTime.ts b/src/hooks/useGreeting/greetingTime.ts
deleted file mode 100644
index bf269706325..00000000000
--- a/src/hooks/useGreeting/greetingTime.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-export const parseGreetingTime = () => {
- const now = new Date();
- const hours = now.getHours();
-
- if (hours >= 4 && hours < 11) {
- return 'morning';
- } else if (hours >= 11 && hours < 14) {
- return 'noon';
- } else if (hours >= 14 && hours < 18) {
- return 'afternoon';
- } else {
- return 'night';
- }
-};
diff --git a/src/hooks/useGreeting/index.ts b/src/hooks/useGreeting/index.ts
deleted file mode 100644
index b536f0d661f..00000000000
--- a/src/hooks/useGreeting/index.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { useEffect, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { parseGreetingTime } from './greetingTime';
-
-export const useGreeting = () => {
- const { t } = useTranslation('welcome');
-
- const [greeting, setGreeting] = useState<'morning' | 'noon' | 'afternoon' | 'night'>();
-
- useEffect(() => {
- setGreeting(parseGreetingTime());
- }, []);
-
- return greeting && t(`guide.welcome.${greeting}`);
-};
diff --git a/src/hooks/useIsCloudActive.ts b/src/hooks/useIsCloudActive.ts
deleted file mode 100644
index 9752007e65f..00000000000
--- a/src/hooks/useIsCloudActive.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-'use client';
-
-import { isDesktop } from '@/const/version';
-import { useElectronStore } from '@/store/electron';
-import { electronSyncSelectors } from '@/store/electron/selectors';
-
-/**
- * Returns whether cloud sync is active (storage mode is cloud and sync is active).
- */
-export const useIsCloudActive = () => {
- if (!isDesktop) return false;
-
- const storageMode = useElectronStore(electronSyncSelectors.storageMode);
- const isSyncActive = useElectronStore(electronSyncSelectors.isSyncActive);
-
- return storageMode === 'cloud' && isSyncActive;
-};
diff --git a/src/hooks/useIsSubSlug.ts b/src/hooks/useIsSubSlug.ts
deleted file mode 100644
index 385a0a4b012..00000000000
--- a/src/hooks/useIsSubSlug.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { usePathname } from '@/libs/router/navigation';
-
-/**
- * Returns true if the current path has a sub slug (`/chat/mobile` or `/chat/settings`)
- * React Router version for SPA
- */
-export const useIsSubSlug = () => {
- const pathname = usePathname();
-
- const slugs = pathname.split('/').filter(Boolean);
-
- return slugs.length > 1;
-};
diff --git a/src/hooks/useModelSupportFiles.ts b/src/hooks/useModelSupportFiles.ts
deleted file mode 100644
index 4ee2acf89f2..00000000000
--- a/src/hooks/useModelSupportFiles.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { aiModelSelectors, useAiInfraStore } from '@/store/aiInfra';
-
-export const useModelSupportFiles = (model: string, provider: string) => {
- return useAiInfraStore(aiModelSelectors.isModelSupportFiles(model, provider));
-};
diff --git a/src/hooks/useModelSupportReasoning.ts b/src/hooks/useModelSupportReasoning.ts
deleted file mode 100644
index 2433f0dd2f5..00000000000
--- a/src/hooks/useModelSupportReasoning.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { aiModelSelectors, useAiInfraStore } from '@/store/aiInfra';
-
-export const useModelSupportReasoning = (model: string, provider: string) => {
- return useAiInfraStore(aiModelSelectors.isModelSupportReasoning(model, provider));
-};
diff --git a/src/hooks/usePrefetchResource.ts b/src/hooks/usePrefetchResource.ts
deleted file mode 100644
index b5d22951ffc..00000000000
--- a/src/hooks/usePrefetchResource.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { useCallback } from 'react';
-
-import { mutate } from '@/libs/swr';
-import { fileService } from '@/services/file';
-
-/**
- * Returns a callback to prefetch resource/file data into the SWR cache.
- * Call the returned function on mouseEnter to warm the cache before navigation.
- */
-export const usePrefetchResource = () => {
- return useCallback((fileId: string) => {
- if (!fileId) return;
-
- const key = ['useFetchKnowledgeItem', fileId] as const;
-
- mutate(key, fileService.getKnowledgeItem(fileId), {
- revalidate: false,
- });
- }, []);
-};
diff --git a/src/libs/next/index.ts b/src/libs/next/index.ts
deleted file mode 100644
index f29a70f0448..00000000000
--- a/src/libs/next/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * Next.js wrapper module — SPA implementation
- *
- * Provides unified interfaces that map to react-router-dom / vanilla React
- * so that consumer code does not need framework-specific imports.
- */
-
-// Navigation exports
-export * from './navigation';
-
-// Component exports
-export { default as dynamic } from './dynamic';
-export { default as Image } from './Image';
-export { default as Link } from './Link';
diff --git a/src/routes/(main)/(create)/image/_layout/type.ts b/src/routes/(main)/(create)/image/_layout/type.ts
deleted file mode 100644
index 56afe6afe04..00000000000
--- a/src/routes/(main)/(create)/image/_layout/type.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { type ReactNode } from 'react';
-
-export interface LayoutProps {
- children: ReactNode;
- menu: ReactNode;
- topic: ReactNode;
-}
diff --git a/src/routes/(main)/(create)/video/features/ConfigPanel/index.ts b/src/routes/(main)/(create)/video/features/ConfigPanel/index.ts
deleted file mode 100644
index e7a745a354f..00000000000
--- a/src/routes/(main)/(create)/video/features/ConfigPanel/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { default as FrameUpload } from '@/routes/(main)/(create)/video/features/ConfigPanel/components/FrameUpload';
-export { default as VideoModelItem } from '@/routes/(main)/(create)/video/features/ConfigPanel/components/ModelSelect/VideoModelItem';
diff --git a/src/routes/(main)/community/(list)/model/features/const.ts b/src/routes/(main)/community/(list)/model/features/const.ts
deleted file mode 100644
index 0a1edec23b2..00000000000
--- a/src/routes/(main)/community/(list)/model/features/const.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { DEFAULT_MODEL_PROVIDER_LIST } from 'model-bank/modelProviders';
-
-const providerMap: { [key: string]: string } = {};
-
-DEFAULT_MODEL_PROVIDER_LIST.filter((item) => item.chatModels.length > 0).forEach((item) => {
- providerMap[item.id] = item.name;
-});
-
-export { providerMap };
diff --git a/src/routes/(main)/community/_layout/Header/style.ts b/src/routes/(main)/community/_layout/Header/style.ts
deleted file mode 100644
index 27fa20fc9a4..00000000000
--- a/src/routes/(main)/community/_layout/Header/style.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { createStaticStyles } from 'antd-style';
-
-export const styles = createStaticStyles(({ css, cssVar }) => ({
- // Header container
- headerContainer: css`
- position: relative;
- z-index: 10;
- border-block-end: 1px solid var(--header-border-color, ${cssVar.colorBorderSecondary});
- background: var(--header-bg, ${cssVar.colorBgContainer});
- `,
-}));
diff --git a/src/routes/(main)/community/components/VirtuosoGridList/useScrollParent.ts b/src/routes/(main)/community/components/VirtuosoGridList/useScrollParent.ts
deleted file mode 100644
index 87352531817..00000000000
--- a/src/routes/(main)/community/components/VirtuosoGridList/useScrollParent.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { useEffect, useState } from 'react';
-
-import { isOnServerSide } from '@/utils/env';
-
-import { SCROLL_PARENT_ID } from '../../features/const';
-
-export const useScrollParent = () => {
- const [parent, setParent] = useState<HTMLDivElement>();
-
- useEffect(() => {
- if (isOnServerSide) return;
- const scrollParent = document.querySelector(`#${SCROLL_PARENT_ID}`);
- if (scrollParent) {
- setParent(scrollParent as HTMLDivElement);
- }
- }, []);
-
- return parent;
-};
diff --git a/src/routes/(main)/group/_layout/Sidebar/GroupConfig/style.ts b/src/routes/(main)/group/_layout/Sidebar/GroupConfig/style.ts
deleted file mode 100644
index 7a6d6b1d45b..00000000000
--- a/src/routes/(main)/group/_layout/Sidebar/GroupConfig/style.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { createStaticStyles } from 'antd-style';
-
-export const styles = createStaticStyles(({ css, cssVar }) => ({
- memberItem: css`
- cursor: pointer;
-
- display: flex;
- flex-direction: row;
- gap: 4px;
- align-items: center;
-
- width: 100%;
- min-height: 36px;
- max-height: 36px;
- padding-block: 0 !important;
- padding-inline: 4px !important;
- border-radius: ${cssVar.borderRadius};
-
- transition: all 0.2s ease;
-
- .show-on-hover {
- opacity: 0;
- }
-
- &:hover {
- background: ${cssVar.colorFillTertiary};
-
- .show-on-hover {
- opacity: 1;
- }
- }
- `,
- prompt: css`
- opacity: 0.75;
- transition: opacity 200ms ${cssVar.motionEaseOut};
-
- &:hover {
- opacity: 1;
- }
- `,
-}));
diff --git a/src/routes/(main)/group/features/Conversation/useGroupHooks.ts b/src/routes/(main)/group/features/Conversation/useGroupHooks.ts
deleted file mode 100644
index 0334f87c44e..00000000000
--- a/src/routes/(main)/group/features/Conversation/useGroupHooks.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-'use client';
-
-import { type ConversationContext, type SendMessageParams } from '@lobechat/types';
-import { useMemo } from 'react';
-
-import { type ConversationHooks } from '@/features/Conversation';
-import { useChatStore } from '@/store/chat';
-
-/**
- * Hook to create ConversationHooks for Group chat
- *
- * Intercepts the default send flow and routes to Group-specific logic:
- * - Uses sendGroupMessage from ChatStore (aiAgent/agentGroup slice)
- * - Supports supervisor decision mode or direct @mentions
- * - Future: will integrate with backend Agent mode (aiAgent.execAgent)
- *
- * @param context - The group conversation context
- * @returns ConversationHooks for use with ConversationProvider
- */
-export function useGroupHooks(context: ConversationContext): ConversationHooks {
- const sendGroupMessage = useChatStore((s) => s.sendGroupMessage);
-
- return useMemo(
- (): ConversationHooks => ({
- /**
- * Intercept send and route to Group-specific logic
- *
- * Returns false to prevent the default ChatStore.sendMessage flow.
- * Instead, we use sendGroupMessage which handles:
- * - Supervisor decision (if enabled)
- * - Direct @mentions (if supervisor disabled)
- * - Future: backend Agent execution
- */
- onBeforeSendMessage: async (params: SendMessageParams) => {
- const { groupId } = context;
-
- if (!groupId) {
- console.warn('[useGroupHooks] No groupId in context, falling back to default send');
- return true; // Allow default flow
- }
-
- // Route to Group-specific send logic
- await sendGroupMessage({ context, files: params.files, message: params.message });
-
- // Return false to prevent default ChatStore.sendMessage
- return false;
- },
- }),
- [context],
- );
-}
diff --git a/src/routes/(main)/hooks/useActiveTabKey.ts b/src/routes/(main)/hooks/useActiveTabKey.ts
deleted file mode 100644
index 259f30bd7a4..00000000000
--- a/src/routes/(main)/hooks/useActiveTabKey.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { usePathname, useSearchParams } from '@/libs/router/navigation';
-import { type SidebarTabKey } from '@/store/global/initialState';
-import { ProfileTabs, SettingsTabs } from '@/store/global/initialState';
-
-/**
- * Returns the active tab key (chat/discover/settings/...)
- * Uses React Router via @/libs/router
- */
-export const useActiveTabKey = () => {
- const pathname = usePathname();
- return pathname.split('/').find(Boolean) as SidebarTabKey;
-};
-
-/**
- * Returns the active setting page key (?active=common/sync/agent/...)
- * Uses React Router via @/libs/router
- */
-export const useActiveSettingsKey = () => {
- const [searchParams] = useSearchParams();
- const tabs = searchParams.get('active');
- if (!tabs) return SettingsTabs.Appearance;
- return tabs as SettingsTabs;
-};
-
-/**
- * Returns the active profile page key (profile/security/stats/...)
- * Uses React Router via @/libs/router
- */
-export const useActiveProfileKey = () => {
- const pathname = usePathname();
- const tabs = pathname.split('/').findLast(Boolean);
-
- if (tabs === 'profile') return ProfileTabs.Profile;
-
- return tabs as ProfileTabs;
-};
diff --git a/src/routes/(main)/resource/features/hooks/useFileQueryParam.ts b/src/routes/(main)/resource/features/hooks/useFileQueryParam.ts
deleted file mode 100644
index 498c9d9f621..00000000000
--- a/src/routes/(main)/resource/features/hooks/useFileQueryParam.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { useSearchParams } from 'react-router';
-
-/**
- * Query parameter key for file modal
- * Changed from 'files' to 'file' for better semantics
- */
-export const FILE_MODAL_QUERY_KEY = 'file';
-
-/**
- * Hook to get and set the file modal ID from URL query parameters
- * Uses react-router-dom's useSearchParams for MemoryRouter compatibility
- * Supports both ?file=[id] and legacy ?files=[id]
- */
-export const useFileModalId = (): string | undefined => {
- const [searchParams] = useSearchParams();
-
- // Support both 'file' and legacy 'files' for backwards compatibility
- return searchParams.get(FILE_MODAL_QUERY_KEY) ?? searchParams.get('files') ?? undefined;
-};
-
-/**
- * Hook to set the file modal ID in the URL query parameters
- * Uses ?file=[id] format for the new knowledge routes
- */
-export const useSetFileModalId = () => {
- const [searchParams, setSearchParams] = useSearchParams();
-
- return (id?: string) => {
- const newParams = new URLSearchParams(searchParams);
-
- // Remove both new and legacy query params
- newParams.delete(FILE_MODAL_QUERY_KEY);
- newParams.delete('files');
-
- if (id) {
- newParams.set(FILE_MODAL_QUERY_KEY, id);
- }
-
- setSearchParams(newParams, { replace: true });
- };
-};
-
-/**
- * Standalone function to set file modal ID (for use outside hooks)
- * This creates a callback that can be passed to components
- */
-export const createSetFileModalId = (setSearchParams: ReturnType<typeof useSearchParams>[1]) => {
- return (id?: string) => {
- setSearchParams(
- (prev) => {
- const newParams = new URLSearchParams(prev);
-
- // Remove both new and legacy query params
- newParams.delete(FILE_MODAL_QUERY_KEY);
- newParams.delete('files');
-
- if (id) {
- newParams.set(FILE_MODAL_QUERY_KEY, id);
- }
-
- return newParams;
- },
- { replace: true },
- );
- };
-};
diff --git a/src/routes/(main)/resource/features/modal/useFilesQueryParam.ts b/src/routes/(main)/resource/features/modal/useFilesQueryParam.ts
deleted file mode 100644
index 899effceda2..00000000000
--- a/src/routes/(main)/resource/features/modal/useFilesQueryParam.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { useEffect, useState } from 'react';
-
-export const FILE_MODAL_QUERY_KEY = 'files';
-const FILE_MODAL_QUERY_EVENT = 'lobe-files-querychange';
-
-const getCurrentSearch = () => {
- if (typeof window === 'undefined') return '';
- return window.location.search;
-};
-
-export const getCurrentFileModalId = () => {
- const search = getCurrentSearch();
- if (!search) return undefined;
-
- const params = new URLSearchParams(search);
- return params.get(FILE_MODAL_QUERY_KEY) ?? undefined;
-};
-
-const pushStateWithParams = (params: URLSearchParams) => {
- if (typeof window === 'undefined') return;
-
- const search = params.toString();
- const hash = window.location.hash;
- const pathname = window.location.pathname;
- const url = `${pathname}${search ? `?${search}` : ''}${hash}`;
-
- window.history.pushState({}, '', url);
- window.dispatchEvent(new Event(FILE_MODAL_QUERY_EVENT));
-};
-
-export const setFileModalId = (id?: string) => {
- if (typeof window === 'undefined') return;
-
- const params = new URLSearchParams(getCurrentSearch());
-
- if (!id) {
- params.delete(FILE_MODAL_QUERY_KEY);
- } else {
- params.set(FILE_MODAL_QUERY_KEY, id);
- }
-
- pushStateWithParams(params);
-};
-
-export const useFileModalId = (): string | undefined => {
- const [fileId, setFileId] = useState<string | undefined>(() => getCurrentFileModalId());
-
- useEffect(() => {
- if (typeof window === 'undefined') return;
-
- const handler = () => {
- setFileId(getCurrentFileModalId());
- };
-
- window.addEventListener('popstate', handler);
- window.addEventListener(FILE_MODAL_QUERY_EVENT, handler);
-
- return () => {
- window.removeEventListener('popstate', handler);
- window.removeEventListener(FILE_MODAL_QUERY_EVENT, handler);
- };
- }, []);
-
- return fileId;
-};
diff --git a/src/routes/(main)/resource/store/action.ts b/src/routes/(main)/resource/store/action.ts
deleted file mode 100644
index cd96dfd25dc..00000000000
--- a/src/routes/(main)/resource/store/action.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import type { StateCreator } from 'zustand/vanilla';
-
-import type { ResourceManagerMode } from '@/features/ResourceManager';
-import type { StoreSetter } from '@/store/types';
-import { flattenActions } from '@/store/utils/flattenActions';
-
-import type { State } from './initialState';
-import { initialState } from './initialState';
-
-export type Store = Action & State;
-
-type Setter = StoreSetter<Store>;
-
-export class ResourceStoreActionImpl {
- readonly #set: Setter;
-
- constructor(set: Setter, _get: () => Store, _api?: unknown) {
- void _api;
- void _get;
- this.#set = set;
- }
-
- setCurrentViewItemId = (currentViewItemId?: string): void => {
- this.#set({ currentViewItemId });
- };
-
- setMode = (mode: ResourceManagerMode): void => {
- this.#set({ mode });
- };
-
- setSelectedFileIds = (selectedFileIds: string[]): void => {
- this.#set({ selectedFileIds });
- };
-}
-
-export type Action = Pick<ResourceStoreActionImpl, keyof ResourceStoreActionImpl>;
-
-export const createResourceStoreSlice = (set: Setter, get: () => Store, _api?: unknown) =>
- new ResourceStoreActionImpl(set, get, _api);
-
-type CreateStore = (
- initState?: Partial<State>,
-) => StateCreator<Store, [['zustand/devtools', never]]>;
-
-export const store: CreateStore =
- (publicState) =>
- (...params) => ({
- ...initialState,
- ...publicState,
- ...flattenActions<Action>([createResourceStoreSlice(...params)]),
- });
diff --git a/src/routes/(main)/resource/store/initialState.ts b/src/routes/(main)/resource/store/initialState.ts
deleted file mode 100644
index 5e9fb215df3..00000000000
--- a/src/routes/(main)/resource/store/initialState.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { type ResourceManagerMode } from '@/features/ResourceManager';
-
-export interface State {
- currentViewItemId?: string;
- mode: ResourceManagerMode;
- selectedFileIds: string[];
-}
-
-export const initialState: State = {
- currentViewItemId: undefined,
- mode: 'explorer',
- selectedFileIds: [],
-};
diff --git a/src/routes/(main)/settings/agent/features/useSync.ts b/src/routes/(main)/settings/agent/features/useSync.ts
deleted file mode 100644
index 2537379aebf..00000000000
--- a/src/routes/(main)/settings/agent/features/useSync.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { type FormInstance } from 'antd';
-import { useLayoutEffect } from 'react';
-
-import { useUserStore } from '@/store/user';
-
-export const useSyncSystemAgent = (form: FormInstance, settings: any) => {
- useLayoutEffect(() => {
- // Set initial form values
- form.setFieldsValue(settings);
-
- // Sync form values with updated settings
- const unsubscribe = useUserStore.subscribe(
- (s) => s.settings.systemAgent,
- (newSettings) => {
- form.setFieldsValue(newSettings);
- },
- );
-
- return () => {
- unsubscribe();
- };
- }, [form, settings]);
-};
diff --git a/src/routes/(main)/settings/creds/features/index.ts b/src/routes/(main)/settings/creds/features/index.ts
deleted file mode 100644
index 3f206787265..00000000000
--- a/src/routes/(main)/settings/creds/features/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export { createCreateCredModal } from './CreateCredModal';
-export { default as CredDisplay } from './CredDisplay';
-export { default as CredItem } from './CredItem';
-export { default as CredsList } from './CredsList';
-export { createEditCredModal } from './EditCredModal';
-export { createViewCredModal } from './ViewCredModal';
diff --git a/src/routes/(main)/settings/hooks/useSyncSettings.ts b/src/routes/(main)/settings/hooks/useSyncSettings.ts
deleted file mode 100644
index adcd59847a7..00000000000
--- a/src/routes/(main)/settings/hooks/useSyncSettings.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { type FormInstance } from 'antd/es/form/hooks/useForm';
-import { useLayoutEffect } from 'react';
-
-import { useUserStore } from '@/store/user';
-
-export const useSyncSettings = (form: FormInstance) => {
- useLayoutEffect(() => {
- // set the first time
- form.setFieldsValue(useUserStore.getState().settings);
-
- // sync with later updated settings
- const unsubscribe = useUserStore.subscribe(
- (s) => s.settings,
- (settings) => {
- form.setFieldsValue(settings);
- },
- );
-
- return () => {
- unsubscribe();
- };
- }, []);
-};
diff --git a/src/services/debug.ts b/src/services/debug.ts
deleted file mode 100644
index 5fc42ee40b6..00000000000
--- a/src/services/debug.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-class DebugService {
- async insertLargeDataToDB() {}
-}
-
-export const debugService = new DebugService();
diff --git a/src/services/tableViewer/client.ts b/src/services/tableViewer/client.ts
deleted file mode 100644
index b89ced8df3b..00000000000
--- a/src/services/tableViewer/client.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-export class ClientService {
- getAllTables = async () => [
- { count: 0, name: 'test' },
- { count: 0, name: 'test2' },
- ];
-
- getTableDetails = async (tableName: string) => {
- console.info('getTableDetails:', tableName);
- return [{ name: 'test' }];
- };
-
- getTableData = async (tableName: string) => {
- console.info('getTableData:', tableName);
- return [{ name: 'test' }];
- };
-}
diff --git a/src/services/tableViewer/index.ts b/src/services/tableViewer/index.ts
deleted file mode 100644
index 53b1177762c..00000000000
--- a/src/services/tableViewer/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { ClientService } from './client';
-
-export const tableViewerService = new ClientService();
diff --git a/src/services/tool.ts b/src/services/tool.ts
deleted file mode 100644
index c699c90fbd9..00000000000
--- a/src/services/tool.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { lambdaClient } from '@/libs/trpc/client';
-import { globalHelpers } from '@/store/global/helpers';
-import { type PluginQueryParams } from '@/types/discover';
-
-class ToolService {
- getOldPluginList = async (params: PluginQueryParams): Promise<any> => {
- const locale = globalHelpers.getCurrentLanguage();
-
- return lambdaClient.market.getPluginList.query({
- ...params,
- locale,
- page: params.page ? Number(params.page) : 1,
- pageSize: params.pageSize ? Number(params.pageSize) : 20,
- });
- };
-}
-
-export const toolService = new ToolService();
diff --git a/src/store/agentGroup/helpers.ts b/src/store/agentGroup/helpers.ts
deleted file mode 100644
index 66d710579c1..00000000000
--- a/src/store/agentGroup/helpers.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { devtools } from 'zustand/middleware';
-
-import { isDev } from '@/utils/env';
-
-export const chatGroupDevtools = (name: string) =>
- devtools<any, any, any, any>(
- (store) =>
- (...a: Parameters<typeof store>) => {
- const res = store(...a);
-
- if (isDev && res && typeof res === 'object' && 'internal_dispatchChatGroup' in res) {
- // @ts-ignore
- window.dispatchChatGroup = res.internal_dispatchChatGroup;
- }
- return res;
- },
- { name: `LOBE_CHAT_CHAT_GROUP_STORE_${name}` },
- );
diff --git a/src/store/agentGroup/slices/index.ts b/src/store/agentGroup/slices/index.ts
deleted file mode 100644
index 028bcf1b69a..00000000000
--- a/src/store/agentGroup/slices/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './curd';
-export * from './lifecycle';
-export * from './member';
diff --git a/src/store/brief/slices/list/index.ts b/src/store/brief/slices/list/index.ts
deleted file mode 100644
index 6bdd1f4b2ef..00000000000
--- a/src/store/brief/slices/list/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './action';
-export * from './initialState';
-export * from './selectors';
diff --git a/src/store/discover/slices/assistant/index.ts b/src/store/discover/slices/assistant/index.ts
deleted file mode 100644
index 2c0622fbb9c..00000000000
--- a/src/store/discover/slices/assistant/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './action';
diff --git a/src/store/discover/slices/model/index.ts b/src/store/discover/slices/model/index.ts
deleted file mode 100644
index 2c0622fbb9c..00000000000
--- a/src/store/discover/slices/model/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './action';
diff --git a/src/store/discover/slices/plugin/index.ts b/src/store/discover/slices/plugin/index.ts
deleted file mode 100644
index 2c0622fbb9c..00000000000
--- a/src/store/discover/slices/plugin/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './action';
diff --git a/src/store/discover/slices/provider/index.ts b/src/store/discover/slices/provider/index.ts
deleted file mode 100644
index 2c0622fbb9c..00000000000
--- a/src/store/discover/slices/provider/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './action';
diff --git a/src/store/home/slices/agentList/index.ts b/src/store/home/slices/agentList/index.ts
deleted file mode 100644
index 6bdd1f4b2ef..00000000000
--- a/src/store/home/slices/agentList/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './action';
-export * from './initialState';
-export * from './selectors';
diff --git a/src/store/home/slices/group/index.ts b/src/store/home/slices/group/index.ts
deleted file mode 100644
index 279e5868539..00000000000
--- a/src/store/home/slices/group/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './action';
-export * from './initialState';
diff --git a/src/store/home/slices/group/initialState.ts b/src/store/home/slices/group/initialState.ts
deleted file mode 100644
index 33d85122827..00000000000
--- a/src/store/home/slices/group/initialState.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export interface GroupState {
- // if you want to add new state, just remove next line
- _groupEmptyPlaceholder?: boolean;
-}
-
-export const initialGroupState: GroupState = {};
diff --git a/src/store/home/slices/recent/index.ts b/src/store/home/slices/recent/index.ts
deleted file mode 100644
index 6bdd1f4b2ef..00000000000
--- a/src/store/home/slices/recent/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './action';
-export * from './initialState';
-export * from './selectors';
diff --git a/src/store/home/slices/sidebarUI/index.ts b/src/store/home/slices/sidebarUI/index.ts
deleted file mode 100644
index 279e5868539..00000000000
--- a/src/store/home/slices/sidebarUI/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './action';
-export * from './initialState';
diff --git a/src/store/image/slices/generationConfig/index.ts b/src/store/image/slices/generationConfig/index.ts
deleted file mode 100644
index 2c0622fbb9c..00000000000
--- a/src/store/image/slices/generationConfig/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './action';
diff --git a/src/store/tool/slices/customPlugin/reducers/customPluginList.ts b/src/store/tool/slices/customPlugin/reducers/customPluginList.ts
deleted file mode 100644
index adebffacf3b..00000000000
--- a/src/store/tool/slices/customPlugin/reducers/customPluginList.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-import { produce } from 'immer';
-
-import { type LobeToolCustomPlugin } from '@/types/tool/plugin';
-
-export type DevListState = LobeToolCustomPlugin[];
-
-export type AddPluginAction = {
- plugin: LobeToolCustomPlugin;
- type: 'addItem';
-};
-
-export type DeletePluginAction = {
- id: string;
- type: 'deleteItem';
-};
-
-export type UpdatePluginAction = {
- id: string;
- plugin: LobeToolCustomPlugin;
- type: 'updateItem';
-};
-
-export type CustomPluginListDispatch = AddPluginAction | DeletePluginAction | UpdatePluginAction;
-
-export const devPluginListReducer = (
- state: DevListState,
- payload: CustomPluginListDispatch,
-): DevListState => {
- switch (payload.type) {
- case 'addItem': {
- return [...state, payload.plugin];
- }
-
- case 'deleteItem': {
- return produce(state, (draftState) => {
- const deleteIndex = state.findIndex((plugin) => plugin.identifier === payload.id);
- if (deleteIndex !== -1) {
- draftState.splice(deleteIndex, 1);
- }
- });
- }
-
- case 'updateItem': {
- return produce(state, (draftState) => {
- const updateIndex = state.findIndex((plugin) => plugin.identifier === payload.id);
- if (updateIndex !== -1) {
- draftState[updateIndex] = payload.plugin;
- }
- });
- }
-
- default: {
- return state;
- }
- }
-};
diff --git a/src/store/tool/slices/plugin/reducers/manifest.ts b/src/store/tool/slices/plugin/reducers/manifest.ts
deleted file mode 100644
index c0dbe341376..00000000000
--- a/src/store/tool/slices/plugin/reducers/manifest.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { type ToolManifest } from '@lobechat/types';
-import { produce } from 'immer';
-
-import { type PluginManifestMap } from '@/types/tool/plugin';
-
-type AddManifestDispatch = { id: string; plugin: ToolManifest; type: 'addManifest' };
-type DeleteManifestDispatch = { id: string; type: 'deleteManifest' };
-// type UpdateManifestDispatch = {
-// id: string;
-// plugin: LobeChatPlugin;
-// type: 'updateManifest';
-// version: string;
-// };
-
-export type PluginDispatch = AddManifestDispatch | DeleteManifestDispatch;
-// | UpdateManifestDispatch;
-
-export const pluginManifestReducer = (
- state: PluginManifestMap,
- payload: PluginDispatch,
-): PluginManifestMap => {
- switch (payload.type) {
- case 'addManifest': {
- return produce(state, (draftState) => {
- draftState[payload.id] = payload.plugin;
- });
- }
-
- case 'deleteManifest': {
- return produce(state, (draftState) => {
- delete draftState[payload.id];
- });
- }
- // case 'updateManifest'
- }
-};
diff --git a/src/store/user/slices/agentOnboarding/index.ts b/src/store/user/slices/agentOnboarding/index.ts
deleted file mode 100644
index 10cfd681f36..00000000000
--- a/src/store/user/slices/agentOnboarding/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { type AgentOnboardingAction, createAgentOnboardingSlice } from './action';
-export { type AgentOnboardingState, initialAgentOnboardingState } from './initialState';
diff --git a/src/store/utils/createStoreUpdater.ts b/src/store/utils/createStoreUpdater.ts
deleted file mode 100644
index f2754426014..00000000000
--- a/src/store/utils/createStoreUpdater.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { type StoreApi } from 'zustand';
-import { createStoreUpdater as upstream } from 'zustand-utils';
-
-/**
- * Local wrapper around `zustand-utils`'s `createStoreUpdater`.
- *
- * The upstream signature types the `value` argument as exactly `T[Key]`, so
- * passing `string | undefined` to a `string`-typed key fails the TS check —
- * even though the upstream implementation already guards with
- * `typeof value !== 'undefined'` and skips the `setState` call in that case.
- *
- * This wrapper loosens the value type to `T[Key] | null | undefined`, which
- * matches the runtime behavior and lets callers feed optional sources (URL
- * params, selectors that may return undefined, etc.) directly without a
- * lossy `?? ''` fallback that would accidentally write a sentinel into the
- * store.
- */
-type LooseStoreUpdater<T> = <Key extends keyof T>(
- key: Key,
- value: T[Key] | null | undefined,
- deps?: any[],
- setStateFn?: StoreApi<T>['setState'],
-) => void;
-
-type StoreApiLike<T> = {
- [K in keyof StoreApi<T>]: StoreApi<T>[K];
-};
-
-export const createStoreUpdater = <T>(storeApi: StoreApiLike<T>): LooseStoreUpdater<T> =>
- upstream(storeApi) as unknown as LooseStoreUpdater<T>;
diff --git a/src/utils/platform.ts b/src/utils/platform.ts
deleted file mode 100644
index a15cb940923..00000000000
--- a/src/utils/platform.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-// Re-export platform utilities from packages/utils
-export * from '../../packages/utils/src/platform';
diff --git a/src/utils/server/pageProps.ts b/src/utils/server/pageProps.ts
deleted file mode 100644
index 82bec564571..00000000000
--- a/src/utils/server/pageProps.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { translation } from '@/server/translation';
-import { type DynamicLayoutProps } from '@/types/next';
-
-import { RouteVariants } from './routeVariants';
-
-export const parsePageMetaProps = async (props: DynamicLayoutProps) => {
- const { locale: hl, isMobile } = await RouteVariants.getVariantsFromProps(props);
- const { t, locale } = await translation('metadata', hl);
- return { isMobile, locale, t };
-};