featur(codec): universal file handler and uploading #27
Open
featur(codec): universal file handler and uploading #27
Conversation
- Add AnyDocument enum with UniversalLoader for format-agnostic decoding using infer (magic bytes), MIME types, and heuristic content analysis - Add AnyAudio (Wav/Mp3) and AnyImage (Png/Jpeg) handler enums that implement Handler with shared associated types for category-level dispatch - AnyDocument uses AnyAudio/AnyImage instead of per-format variants - Move streams to dedicated src/stream module (SpanStream, SpanEditStream) - Rename handler/document/ to handler/rich/ for pdf/docx stubs - Add Document::map_handler for handler type conversion preserving source - Add Deref/DerefMut on Document<H> into H for ergonomic handler access - Simplify Loader::decode to return single Document instead of Vec - Add DocumentType::from_mime() in nvisy-core for centralized MIME mapping - Make audio handlers functional (SpanData=Bytes, view/edit spans) - Rewrite HTML handler encode to use DOM mutation via scraper/ego-tree - Add TextHandler impl for CsvHandler - Use derive_more::From on AnyAudio/AnyImage enums - Complete prelude with all public types - Add tests across all new and modified modules (99 total) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Make handler request/response modules private, re-export ServerError
- Add ContentRegistry::delete(Uuid) and delete_all() with tests
- Add DELETE /api/v1/ingest/{id} and DELETE /api/v1/ingest endpoints
with OpenAPI docs via aide
- Create extract module with Version extractor (Accept-Version header,
FromRequestParts, FromStr/Display, unit tests)
- Improve handler module documentation with endpoint tables and
multipart upload field reference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ErrorKind::NotFound and map it to HTTP 404 in ServerError - ContentRegistry::delete now returns NotFound for missing content instead of InternalError (500) - Move Health response struct from handler/check.rs to response/check.rs for consistency with other response types - Move base64::Engine import to module top in execute.rs; import both base64::Engine and nvisy Engine traits as `_` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge 8 subdirectories into 3 (apply/, compiler/, engine/) to reduce fragmentation. Absorb executor, runs, connections, ontology, and policy runtime functions into engine/. Move RetryPolicy into compiler/retry.rs since it's owned by GraphNode. Replace StubEngine with DefaultEngine in the server service layer, deriving Debug/Clone/Copy on DefaultEngine and adding it to impl_di!. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement apply_audio_doc with time-range silence/remove via WavHandler, add audio_output_from_spec mapping, and delete the superseded single-file engine.rs (now engine/ directory). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add newtype Json<T> and Path<T> extractors in extract/ that convert axum rejections into our ErrorResponse JSON shape. Migrate Version extractor rejection from (StatusCode, String) to Error<'static>. Move error types into handler/error/ module, replace ServerError with Error/ErrorKind/Result, and simplify handler return types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…config Add JsonSchema derives to Entity, DetectionOutput, Location variants (ontology) and PolicyEvaluation (identify) so ExecuteResponse can use the real types instead of lossy serde_json::Value round-trips. Re-export DetectionOutput from nvisy-engine for downstream access. Server improvements: - Upload endpoint now uses api_route + post_with for OpenAPI visibility - Crate root re-exports routes, ServiceState, Error, ErrorKind, Result - CORS origins configurable via SecurityConfig::cors_allowed_origins - REQUEST_ID_HEADER constant replaces hardcoded "x-request-id" strings - Multipart extractor warns on nameless fields instead of silent default - Expanded MIME map with audio, video, and additional image formats - Doc comments on recovery middleware functions; fix stale handler docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge split `#[derive(schemars::JsonSchema)]` lines into single derive attributes using the short-form `JsonSchema` with proper imports across all crates. Add missing `cors_allowed_origins` field to CLI config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…re modules - Reduce nvisy-core ErrorKind from 12 to 9 variants: remove Python, InternalError, InvalidInput, Other; add Internal; rename all callers - Split monolithic Provider enum into domain-specific types: AgentProvider, TranscribeProvider, AudioGenProvider, ImageGenProvider - Rename synthesize/synthesis modules to generate, transcription to transcribe for consistent verb-form naming - Convert flat files to directory modules for future extensibility - Move client-building free functions to methods on AuthenticatedProvider/UnauthenticatedProvider - Extract build_http_client into backend/http_client.rs - Move ContextWindow from backend to agent/base (sole consumer) - Add Debug impls to all provider types (api_key redacted) - Remove all re-exports from lib.rs, use pub mod only Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
No description provided.