Files
ChatLab/apps/desktop/main/parser/index.ts
T
diguaandCursor 9421662a52 feat(import): support unified directory import for Electron and Web
Add directory import support for multi-file formats (e.g. shuakami chunked-jsonl).
Users can select or drag-and-drop a directory via the "Import Folder" checkbox.

- Add `findEntryFileInDirectory()` to parser layer for format-agnostic entry file discovery
- Add `importDirectory` method to ImportAdapter interface
- Implement FetchImportAdapter.importDirectory with multi-file FormData upload
- Add `POST /_web/import-directory` CLI route with directory reconstruction
- Add `chat:importDirectory` IPC handler in Electron main process
- Enhance FileDropZone with `directory` prop and drag-and-drop directory support
- Refactor FetchImportAdapter to extract reusable `consumeSseStream` helper

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 10:20:39 +08:00

44 lines
801 B
TypeScript

/**
* 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'