refactor(KB): move FileWarning to shared types/rag following existing convention

This commit is contained in:
Jake Turner 2026-05-17 04:11:17 +00:00 committed by Jake Turner
parent 563f86a22b
commit 102998ec96
3 changed files with 9 additions and 6 deletions

View File

@ -12,9 +12,9 @@
* stall (which the binary "any chunks ⇒ embedded" check
* used to mask). Surfaces a Retry affordance.
*/
export type FileWarning =
| { kind: 'zero_chunks'; fileSizeBytes: number }
| { kind: 'partial_stall'; chunksEmbedded: number; chunksExpected: number }
import type { FileWarning } from '../../types/rag.js'
export type { FileWarning }
/** Files smaller than this are too small to flag as suspicious zero-chunk
* cases a 5 KB upload that produces 0 chunks is much more likely to be a

View File

@ -5,8 +5,7 @@ import { FileEntry } from '../../types/files'
import { CheckLatestVersionResult, SystemInformationResponse, SystemUpdateStatus } from '../../types/system'
import { DownloadJobWithProgress, WikipediaState } from '../../types/downloads'
import type { Country, CountryCode, CountryGroup, MapExtractPreflight } from '../../types/maps'
import { EmbedJobWithProgress } from '../../types/rag'
import type { FileWarning } from '../../app/utils/kb_warning_decision.js'
import { EmbedJobWithProgress, FileWarning } from '../../types/rag'
import type { CategoryWithStatus, CollectionWithStatus, ContentUpdateCheckResult, ResourceUpdateInfo } from '../../types/collections'
import { catchInternal } from './util'
import { NomadChatResponse, NomadInstalledModel, NomadOllamaModel, OllamaChatRequest } from '../../types/ollama'

View File

@ -40,4 +40,8 @@ export type RAGResult = {
export type RerankedRAGResult = Omit<RAGResult, 'keywords'> & {
finalScore: number
}
}
export type FileWarning =
| { kind: 'zero_chunks'; fileSizeBytes: number }
| { kind: 'partial_stall'; chunksEmbedded: number; chunksExpected: number }