mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
refactor: remove redundant re-export proxies
This commit is contained in:
1 parent
35c696b1a4
commit
5a5fae880a
19 files changed
+25
-128
No files matched your search
@@ -1,12 +0,0 @@
|
||||
/**
|
||||
* Server-side remote LLM API operations.
|
||||
* Thin wrapper over @openchatlab/node-runtime shared implementation.
|
||||
*/
|
||||
|
||||
export {
|
||||
fetchRemoteModels,
|
||||
validateApiKey,
|
||||
type RemoteModel,
|
||||
type FetchRemoteModelsResult,
|
||||
type RemoteApiOptions,
|
||||
} from '@openchatlab/node-runtime'
|
||||
@@ -38,11 +38,11 @@ import {
|
||||
getDefaultNodeUserDataDir,
|
||||
getPendingNodeDataDirMigration,
|
||||
AnalyticsService,
|
||||
MergeSessionCache,
|
||||
type SemanticIndexRuntime,
|
||||
} from '@openchatlab/node-runtime'
|
||||
import { registerSharedRoutes } from '@openchatlab/http-routes'
|
||||
import type { HttpRouteContext } from '@openchatlab/http-routes'
|
||||
import { MergeSessionCache } from '../../../merger/merge-cache'
|
||||
import { registerImportRoutes } from './import'
|
||||
import { openDirectoryPath, showPathInFolder } from './cache'
|
||||
import { getVersion } from '../../../version'
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { MergeSessionCache } from '@openchatlab/node-runtime'
|
||||
@@ -10,9 +10,9 @@ import { PreferencesManager, createDatabaseManagerAdapter, ownerProfileService }
|
||||
import type { PathProvider } from '@openchatlab/core'
|
||||
import { DataSourceManager, PullEngine, initScheduler, stopAllTimers, reloadTimer, stopTimer } from '@openchatlab/sync'
|
||||
import type { SyncLogger } from '@openchatlab/sync'
|
||||
import { NodeFetcher, DirectImporter, NoopNotifier } from './adapters'
|
||||
import { registerAutomationRoutes } from './routes'
|
||||
import { registerAutomationRoutes } from '@openchatlab/http-routes'
|
||||
import type { AutomationRouteContext } from '@openchatlab/http-routes'
|
||||
import { NodeFetcher, DirectImporter, NoopNotifier } from './adapters'
|
||||
|
||||
export interface SyncRouteContext {
|
||||
automation: AutomationRouteContext
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { registerAutomationRoutes } from '@openchatlab/http-routes'
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* 内置工具目录查询 — 从 @openchatlab/core 重导出
|
||||
*/
|
||||
|
||||
import { BUILTIN_TOOL_CATALOG as _CATALOG } from '@openchatlab/core'
|
||||
|
||||
export type { BuiltinToolCatalogEntry } from '@openchatlab/core'
|
||||
|
||||
/**
|
||||
* 获取所有内置工具的目录(含分类),供前端展示
|
||||
*/
|
||||
export function getBuiltinToolCatalog() {
|
||||
return _CATALOG
|
||||
}
|
||||
@@ -19,4 +19,3 @@ export {
|
||||
isGeneralAssistant,
|
||||
} from './manager'
|
||||
export { parseAssistantFile, serializeAssistant } from '@openchatlab/node-runtime'
|
||||
export { getBuiltinToolCatalog, type BuiltinToolCatalogEntry } from './builtinTools'
|
||||
@@ -9,8 +9,13 @@
|
||||
import { ipcMain, app, dialog } from 'electron'
|
||||
import * as databaseCore from '../database/core'
|
||||
import * as worker from '../worker/workerManager'
|
||||
import { detectFormat, findEntryFileInDirectory, scanMultiChatFile, type ParseProgress } from '../parser'
|
||||
import * as parser from '../parser'
|
||||
import {
|
||||
detectFormat,
|
||||
findEntryFileInDirectory,
|
||||
getSupportedFormats,
|
||||
scanMultiChatFile,
|
||||
type ParseProgress,
|
||||
} from '@openchatlab/parser'
|
||||
import type { IpcContext } from './types'
|
||||
import { CURRENT_SCHEMA_VERSION, getPendingMigrationInfos } from '../database/migrations'
|
||||
import { t } from '../i18n'
|
||||
@@ -121,7 +126,7 @@ export function registerChatHandlers(ctx: IpcContext): void {
|
||||
})
|
||||
|
||||
ipcMain.handle('chat:getSupportedFormats', async () => {
|
||||
return parser.getSupportedFormats()
|
||||
return getSupportedFormats()
|
||||
})
|
||||
|
||||
ipcMain.handle('chat:prepareImportSource', async (_, filePath: string) => {
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* 网络模块入口
|
||||
* 导出代理配置功能
|
||||
*/
|
||||
|
||||
export * from './proxy'
|
||||
@@ -1,43 +0,0 @@
|
||||
/**
|
||||
* Parser V2 - 模块入口(薄封装)
|
||||
* 实际实现已迁移到 @openchatlab/parser 共享包
|
||||
*/
|
||||
export {
|
||||
detectFormat,
|
||||
detectAllFormats,
|
||||
getParser,
|
||||
getSupportedFormats,
|
||||
getFormatFeatureById,
|
||||
getPreprocessor,
|
||||
scanMultiChatFile,
|
||||
needsPreprocess,
|
||||
parseFile,
|
||||
parseFileWithFormat,
|
||||
parseFileSync,
|
||||
parseFileInfo,
|
||||
streamParseFile,
|
||||
findEntryFileInDirectory,
|
||||
FormatSniffer,
|
||||
createSniffer,
|
||||
getFileSize,
|
||||
formatFileSize,
|
||||
parseTimestamp,
|
||||
isValidYear,
|
||||
createProgress,
|
||||
readFileHeadBytes,
|
||||
} from '@openchatlab/parser'
|
||||
|
||||
export type {
|
||||
ParseOptions,
|
||||
ParseEvent,
|
||||
ParseResult,
|
||||
ParseProgress,
|
||||
FormatFeature,
|
||||
Parser,
|
||||
ParsedMeta,
|
||||
ParsedMember,
|
||||
ParsedMessage,
|
||||
MultiChatInfo,
|
||||
StreamParseCallbacks,
|
||||
StreamParseOptions,
|
||||
} from '@openchatlab/parser'
|
||||
@@ -26,6 +26,14 @@ import * as fs from 'fs'
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
import { loadConfig, writeConfigField } from '@openchatlab/config'
|
||||
import {
|
||||
createPendingDataDirMigration,
|
||||
isDirectoryEmptyOrMissing,
|
||||
isExistingUserDataDir,
|
||||
isUserDataDirSafeToUse,
|
||||
runPendingDataDirMigration,
|
||||
type PendingDataDirMigration,
|
||||
} from '@openchatlab/node-runtime'
|
||||
import {
|
||||
copyDirMerge,
|
||||
copyDirRecursive,
|
||||
@@ -36,14 +44,6 @@ import {
|
||||
writeMigrationLog,
|
||||
} from './utils/pathUtils'
|
||||
import { shouldMarkUnifiedDirMigrationDone } from './utils/unifiedDirMigration'
|
||||
import {
|
||||
createPendingDataDirMigration,
|
||||
isDirectoryEmptyOrMissing,
|
||||
isExistingUserDataDir,
|
||||
isUserDataDirSafeToUse,
|
||||
runPendingDataDirMigration,
|
||||
type PendingDataDirMigration,
|
||||
} from './utils/dataDirSwitch'
|
||||
|
||||
// 缓存路径,避免重复计算
|
||||
let _systemDataDir: string | null = null
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
export {
|
||||
createPendingDataDirMigration,
|
||||
isDirectoryEmptyOrMissing,
|
||||
isExistingUserDataDir,
|
||||
isUserDataDirSafeToUse,
|
||||
runPendingDataDirMigration,
|
||||
} from '@openchatlab/node-runtime'
|
||||
export type { PendingDataDirMigration } from '@openchatlab/node-runtime'
|
||||
@@ -8,7 +8,7 @@ import * as path from 'path'
|
||||
import { parentPort } from 'worker_threads'
|
||||
import { getDbDir, openRawDatabase } from '../core'
|
||||
import { CHAT_DB_TABLES, CHAT_DB_INDEXES } from '@openchatlab/core'
|
||||
import type { ParseProgress } from '../../parser'
|
||||
import type { ParseProgress } from '@openchatlab/parser'
|
||||
|
||||
export function sendProgress(requestId: string, progress: ParseProgress): void {
|
||||
parentPort?.postMessage({
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* 提供会话索引管理、AI 工具查询、自定义筛选和导出等功能
|
||||
*/
|
||||
|
||||
// Types — core types re-exported via ./types, Electron-only types kept there
|
||||
export type { ChatSessionItem, SessionIndexStats, SessionMessagesResult } from './types'
|
||||
|
||||
export { DEFAULT_SESSION_GAP_THRESHOLD } from './types'
|
||||
export type { ChatSessionItem, SessionIndexStats } from './sessionIndex'
|
||||
export type { SessionMessagesResult } from './aiTools'
|
||||
export { DEFAULT_SESSION_GAP_THRESHOLD } from '@openchatlab/core'
|
||||
|
||||
// 会话索引管理
|
||||
export {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/**
|
||||
* Session module type definitions.
|
||||
* Core types (ChatSessionItem, DEFAULT_SESSION_GAP_THRESHOLD) are re-exported
|
||||
* from @openchatlab/core; Electron-only types remain here.
|
||||
*/
|
||||
|
||||
export { DEFAULT_SESSION_GAP_THRESHOLD } from '@openchatlab/core'
|
||||
export type { ChatSessionItem, SessionIndexStats } from '@openchatlab/core'
|
||||
|
||||
// AI tool types — re-exported from core via aiTools.ts
|
||||
export type { SessionMessagesResult } from './aiTools'
|
||||
@@ -7,7 +7,7 @@ import { Worker } from 'worker_threads'
|
||||
import { app } from 'electron'
|
||||
import * as path from 'path'
|
||||
import * as fs from 'fs'
|
||||
import type { ParseProgress } from '../parser'
|
||||
import type { ParseProgress } from '@openchatlab/parser'
|
||||
import type { AutoImportResult, StreamImportResult } from './import'
|
||||
|
||||
import { getDatabaseDir, getCacheDir, getTempDir, getLogsDir, ensureDir } from '../paths'
|
||||
|
||||
@@ -2,7 +2,7 @@ import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { CHART_CAPABILITY_SKILL_ID } from '@openchatlab/core'
|
||||
|
||||
import { buildSkillMenuWithBuiltinChart, getSkillConfigWithBuiltinChart } from '../builtin-chart-skill'
|
||||
import { buildSkillMenuWithBuiltinChart, getSkillConfigWithBuiltinChart } from '../chart-runtime'
|
||||
import { buildSkillMenuText, formatSkillMenuLine } from '../skill-menu'
|
||||
|
||||
function requireMenu(menu: string | null): string {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export {
|
||||
buildSkillMenuWithBuiltinChart,
|
||||
getChartCapabilitySkill as getBuiltinChartSkill,
|
||||
getSkillConfigWithBuiltinChart,
|
||||
} from './chart-runtime'
|
||||
@@ -1,5 +0,0 @@
|
||||
/**
|
||||
* 声明式 SQL 工具类型定义
|
||||
*/
|
||||
|
||||
export { type SqlToolDef, type SqlToolExecution, type JsonSchema } from '../types'
|
||||
Reference in new issue
Block a user