chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase
This commit is contained in:
parent
970e08c466
commit
1f7e365a4e
237 changed files with 1951 additions and 49413 deletions
|
|
@ -31,6 +31,13 @@ export interface ImportOptions {
|
|||
importId?: string // Unique import identifier (auto-generated if not provided)
|
||||
projectId?: string // Project identifier grouping related imports
|
||||
customMetadata?: Record<string, any> // Custom metadata to attach
|
||||
|
||||
/**
|
||||
* Internal: per-import tracking metadata (importIds, projectId, importedAt,
|
||||
* importSource, plus customMetadata) threaded from `import()` into the
|
||||
* directory/file helpers. Not intended to be set by callers.
|
||||
*/
|
||||
_trackingMetadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface ImportResult {
|
||||
|
|
@ -96,7 +103,7 @@ export class DirectoryImporter {
|
|||
if (stats.isFile()) {
|
||||
await this.importFile(sourcePath, options.targetPath || '/', result)
|
||||
} else if (stats.isDirectory()) {
|
||||
await this.importDirectory(sourcePath, enhancedOptions as any, result)
|
||||
await this.importDirectory(sourcePath, enhancedOptions, result)
|
||||
}
|
||||
} catch (error) {
|
||||
result.failed.push({
|
||||
|
|
@ -220,7 +227,7 @@ export class DirectoryImporter {
|
|||
await collectDirs(sourcePath, targetPath)
|
||||
|
||||
// Create all directories
|
||||
const trackingMetadata = (options as any)._trackingMetadata || {}
|
||||
const trackingMetadata = options._trackingMetadata || {}
|
||||
for (const dirPath of dirsToCreate) {
|
||||
try {
|
||||
await this.vfs.mkdir(dirPath, {
|
||||
|
|
@ -324,7 +331,7 @@ export class DirectoryImporter {
|
|||
}
|
||||
|
||||
// Write to VFS
|
||||
const trackingMetadata = (options as any)._trackingMetadata || {}
|
||||
const trackingMetadata = options._trackingMetadata || {}
|
||||
await this.vfs.writeFile(vfsPath, content, {
|
||||
generateEmbedding: options.generateEmbeddings,
|
||||
extractMetadata: options.extractMetadata,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue