feat: port source-first ingestion to os repo

- make source the canonical field across os routes, tools, ui, and mcp
- align fresh-install schema, search, and embedding flows with source-first ingestion

Generated with Claude Code
This commit is contained in:
“BeeRad”
2026-03-20 12:36:26 +11:00
parent 41f8498d4a
commit 28e570696c
34 changed files with 588 additions and 521 deletions
+2 -4
View File
@@ -57,10 +57,8 @@ export async function POST(request: NextRequest) {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
title,
// Give the description generator and UI a readable summary plus a short excerpt.
notes: `Imported PDF document: ${file.name} (${extraction.metadata.pages} pages, ${Math.round(extraction.metadata.text_length / 1000)}k characters).\n\nPreview:\n${extraction.chunk.slice(0, 1200)}`,
// Full extracted text goes in chunk for universal chunking/embedding
chunk: extraction.chunk,
description: `PDF document imported from ${file.name}${extraction.metadata.pages} pages of extracted text. Useful as a searchable local source.`,
source: extraction.chunk,
metadata: {
source: 'pdf_upload',
original_filename: file.name,