Add parsed-document storage model to SDK and MCP#111
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces the shared parsed-document storage model consumed by the CLI, MCP, and Notebook, plus page-citation asset support.
SDK (
src/)ParsedDocumentStorageinterface +DiskParsedDocumentStoragereference impl (src/storage/): manifest / chunk pages / assets / resumable sync-progress, keyed bydocumentId+revisionKey(revisionKey = jobResultId ?? jobId).knowledge.withParsedStorage({storage, scheduler?, limits?})— reads try configured storage first (fresh iffmanifest.revisionKey === revisionKey), fall back to remotedocuments.listChunks, return the bounded result immediately, and schedule a background sync on a miss.readChunks(paged display +assetUrlPolicy:"none"|"durable"),grepChunks(single-document, with continuation cursor),getDocumentOutline.syncParsedDocument— resumable, bounded by limits, commits the manifest only after all pages are present.assetUrlPolicy:"durable"+ configured storage, visible chunk asset URLs (primary +metadata.pageAssets[]) are written into storage and rewritten; on failure the URL is omitted rather than exposing a presigned Knowhere URL.importJobResult(replaces deprecatedcacheJobResult),loadJobResultsync-to-storage, page-citation asset generation + Piscina-backed PDF page renderer.MCP (
packages/mcp/)readChunks/grepChunks/getDocumentOutlinewith storage-first, remote-fallback behavior; descriptions and tests updated.Testing
readChunks+ invalid param combinations, single-document bounded grep with truncation, and outline fallback.documents.listChunkssnake→camel transform, remote read → scheduler fire →syncParsedDocument→ storage-hit fast path,getDocumentOutline, andgrepChunks.🤖 Generated with Claude Code
Companion PRs (coordinated parsed-storage rollout):