Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions crates/nvisy-cli/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ mod server;
use std::path::PathBuf;

use clap::Parser;
pub use file::MiddlewareSection;
use nvisy_engine::RuntimeConfig;
pub use server::{ResolvedServer, ServerConfig};
use tracing_subscriber::EnvFilter;

pub use self::file::MiddlewareSection;
pub use self::server::{ResolvedServer, ServerConfig};

/// Top-level CLI entry point.
///
/// Parses command-line arguments and loads the TOML configuration file.
Expand Down
2 changes: 1 addition & 1 deletion crates/nvisy-cli/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
mod listen;
mod shutdown;

pub use listen::run;
pub use self::listen::run;
4 changes: 2 additions & 2 deletions crates/nvisy-codec/src/document/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use nvisy_core::content::{ContentData, ContentSource};
use nvisy_core::media::{
AudioFormat, DocumentType, ImageFormat, SpreadsheetFormat, TextFormat, WordFormat,
};
pub use span::Span;
pub use stream::SpanStream;

pub use self::span::Span;
pub use self::stream::SpanStream;
use crate::handler::{
BoxedAudioHandler, BoxedImageHandler, BoxedRichHandler, BoxedTextHandler, CsvLoader, CsvParams,
Handler, HtmlLoader, HtmlParams, JpegLoader, JpegParams, JsonLoader, JsonParams, Loader,
Expand Down
16 changes: 8 additions & 8 deletions crates/nvisy-codec/src/handler/audio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ mod mp3_loader;
mod wav_handler;
mod wav_loader;

pub use audio_data::AudioData;
pub use audio_handler::BoxedAudioHandler;
use audio_handler_macro::impl_audio_handler;
pub use audio_span_id::AudioSpanId;
pub use mp3_handler::Mp3Handler;
pub use mp3_loader::{Mp3Loader, Mp3Params};
pub use wav_handler::WavHandler;
pub use wav_loader::{WavLoader, WavParams};
pub use self::audio_data::AudioData;
pub use self::audio_handler::BoxedAudioHandler;
use self::audio_handler_macro::impl_audio_handler;
pub use self::audio_span_id::AudioSpanId;
pub use self::mp3_handler::Mp3Handler;
pub use self::mp3_loader::{Mp3Loader, Mp3Params};
pub use self::wav_handler::WavHandler;
pub use self::wav_loader::{WavLoader, WavParams};

/// Capability trait for handlers that expose audio content.
///
Expand Down
16 changes: 8 additions & 8 deletions crates/nvisy-codec/src/handler/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ mod jpeg_loader;
mod png_handler;
mod png_loader;

pub use image_data::ImageData;
pub use image_handler::BoxedImageHandler;
pub(crate) use image_handler_macro::impl_image_handler;
pub use image_span_id::ImageSpanId;
pub use jpeg_handler::JpegHandler;
pub use jpeg_loader::{JpegLoader, JpegParams};
pub use png_handler::PngHandler;
pub use png_loader::{PngLoader, PngParams};
pub use self::image_data::ImageData;
pub use self::image_handler::BoxedImageHandler;
pub(crate) use self::image_handler_macro::impl_image_handler;
pub use self::image_span_id::ImageSpanId;
pub use self::jpeg_handler::JpegHandler;
pub use self::jpeg_loader::{JpegLoader, JpegParams};
pub use self::png_handler::PngHandler;
pub use self::png_loader::{PngLoader, PngParams};

/// Capability trait for handlers that expose image content.
///
Expand Down
9 changes: 5 additions & 4 deletions crates/nvisy-codec/src/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ mod image;
mod rich;
mod text;

pub use audio::*;
pub use image::*;
use nvisy_core::content::ContentSource;
pub use rich::*;
pub use text::*;

pub use self::audio::*;
pub use self::image::*;
pub use self::rich::*;
pub use self::text::*;

/// Base trait implemented by all format handlers.
///
Expand Down
8 changes: 4 additions & 4 deletions crates/nvisy-codec/src/handler/rich/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ mod docx_loader;
mod rich_handler;

#[cfg(feature = "docx")]
pub use docx_loader::{DocxLoader, DocxParams};
pub use self::docx_loader::{DocxLoader, DocxParams};
#[cfg(feature = "pdf")]
pub use pdf_handler::{RichTextHandler, RichTextSpan};
pub use self::pdf_handler::{RichTextHandler, RichTextSpan};
#[cfg(feature = "pdf")]
pub use pdf_loader::{PdfLoader, PdfParams};
pub use rich_handler::BoxedRichHandler;
pub use self::pdf_loader::{PdfLoader, PdfParams};
pub use self::rich_handler::BoxedRichHandler;
24 changes: 12 additions & 12 deletions crates/nvisy-codec/src/handler/text/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ mod xlsx_handler;
#[cfg(feature = "xlsx")]
mod xlsx_loader;

pub use csv_handler::{CsvData, CsvHandler, CsvSpan};
pub use csv_loader::{CsvLoader, CsvParams};
pub use self::csv_handler::{CsvData, CsvHandler, CsvSpan};
pub use self::csv_loader::{CsvLoader, CsvParams};
#[cfg(feature = "html")]
pub use html_handler::{HtmlData, HtmlHandler, HtmlSpan};
pub use self::html_handler::{HtmlData, HtmlHandler, HtmlSpan};
#[cfg(feature = "html")]
pub use html_loader::{HtmlLoader, HtmlParams};
pub use json_handler::{JsonData, JsonHandler, JsonIndent, JsonPath};
pub use json_loader::{JsonLoader, JsonParams};
pub use text_data::TextData;
pub use text_handler::BoxedTextHandler;
pub use txt_handler::{TxtHandler, TxtSpan};
pub use txt_loader::{TxtLoader, TxtParams};
pub use self::html_loader::{HtmlLoader, HtmlParams};
pub use self::json_handler::{JsonData, JsonHandler, JsonIndent, JsonPath};
pub use self::json_loader::{JsonLoader, JsonParams};
pub use self::text_data::TextData;
pub use self::text_handler::BoxedTextHandler;
pub use self::txt_handler::{TxtHandler, TxtSpan};
pub use self::txt_loader::{TxtLoader, TxtParams};
#[cfg(feature = "xlsx")]
pub use xlsx_handler::XlsxHandler;
pub use self::xlsx_handler::XlsxHandler;
#[cfg(feature = "xlsx")]
pub use xlsx_loader::{XlsxLoader, XlsxParams};
pub use self::xlsx_loader::{XlsxLoader, XlsxParams};

/// Capability trait for handlers that expose text content.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/nvisy-codec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod document;
pub mod handler;
pub mod transform;

pub use document::{Document, Span, SpanStream};
pub use self::document::{Document, Span, SpanStream};

#[doc(hidden)]
pub mod prelude;
4 changes: 2 additions & 2 deletions crates/nvisy-codec/src/transform/audio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
mod instruction;
mod transform;

pub use instruction::{AudioOutput, AudioRedaction};
pub use transform::AudioTransform;
pub use self::instruction::{AudioOutput, AudioRedaction};
pub use self::transform::AudioTransform;
4 changes: 2 additions & 2 deletions crates/nvisy-codec/src/transform/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ mod instruction;
mod ops;
mod transform;

pub use instruction::{ImageOutput, ImageRedaction};
pub use transform::ImageTransform;
pub use self::instruction::{ImageOutput, ImageRedaction};
pub use self::transform::ImageTransform;
6 changes: 3 additions & 3 deletions crates/nvisy-codec/src/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ mod audio;
mod image;
mod text;

pub use audio::{AudioOutput, AudioRedaction, AudioTransform};
pub use image::{ImageOutput, ImageRedaction, ImageTransform};
pub use text::{TextOutput, TextRedaction, TextTransform};
pub use self::audio::{AudioOutput, AudioRedaction, AudioTransform};
pub use self::image::{ImageOutput, ImageRedaction, ImageTransform};
pub use self::text::{TextOutput, TextRedaction, TextTransform};
4 changes: 2 additions & 2 deletions crates/nvisy-codec/src/transform/text/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
mod instruction;
mod transform;

pub use instruction::{TextOutput, TextRedaction};
pub use transform::TextTransform;
pub use self::instruction::{TextOutput, TextRedaction};
pub use self::transform::TextTransform;
14 changes: 7 additions & 7 deletions crates/nvisy-core/src/content/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ mod data_reference;
mod encoding;
mod source;

pub use bundle::Content;
pub use content_bytes::ContentBytes;
pub use content_data::ContentData;
pub use content_metadata::ContentMetadata;
pub use data_reference::DataReference;
pub use encoding::TextEncoding;
pub use source::ContentSource;
pub use self::bundle::Content;
pub use self::content_bytes::ContentBytes;
pub use self::content_data::ContentData;
pub use self::content_metadata::ContentMetadata;
pub use self::data_reference::DataReference;
pub use self::encoding::TextEncoding;
pub use self::source::ContentSource;
6 changes: 3 additions & 3 deletions crates/nvisy-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Error {
/// Human-readable description of what went wrong.
pub message: String,
/// Name of the component that produced this error (e.g. `"s3-read"`, `"detect-regex"`).
pub source_component: Option<String>,
pub component: Option<String>,
/// Whether the operation that failed can be safely retried.
pub retryable: bool,
/// The underlying cause, if any.
Expand All @@ -58,7 +58,7 @@ impl Error {
Self {
kind,
message: message.into(),
source_component: None,
component: None,
retryable: false,
source: None,
}
Expand All @@ -72,7 +72,7 @@ impl Error {

/// Tag this error with the name of the component that produced it.
pub fn with_component(mut self, component: impl Into<String>) -> Self {
self.source_component = Some(component.into());
self.component = Some(component.into());
self
}

Expand Down
2 changes: 1 addition & 1 deletion crates/nvisy-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub mod math;
pub mod media;

mod error;
pub use error::{Error, ErrorKind, Result};
pub use self::error::{Error, ErrorKind, Result};

#[doc(hidden)]
pub mod prelude;
8 changes: 4 additions & 4 deletions crates/nvisy-core/src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod dpi;
mod polygon;
mod time_span;

pub use bounding_box::{BoundingBox, BoundingBoxPixel};
pub use dpi::Dpi;
pub use polygon::{Polygon, Vertex};
pub use time_span::TimeSpan;
pub use self::bounding_box::{BoundingBox, BoundingBoxPixel};
pub use self::dpi::Dpi;
pub use self::polygon::{Polygon, Vertex};
pub use self::time_span::TimeSpan;
4 changes: 2 additions & 2 deletions crates/nvisy-core/src/media/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
mod content_kind;
mod document_type;

pub use content_kind::ContentKind;
pub use document_type::{
pub use self::content_kind::ContentKind;
pub use self::document_type::{
AudioFormat, DocumentType, ImageFormat, PresentationFormat, SpreadsheetFormat, TextFormat,
WordFormat,
};
6 changes: 3 additions & 3 deletions crates/nvisy-engine/src/compiler/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ mod target;

use std::collections::HashSet;

pub use action::{ActionKind, ActionNode};
use nvisy_core::Error;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
pub use source::SourceNode;
pub use target::TargetNode;
use uuid::Uuid;
use validator::Validate;

pub use self::action::{ActionKind, ActionNode};
pub use self::source::SourceNode;
pub use self::target::TargetNode;
use super::policy::{RetryPolicy, TimeoutPolicy};

/// A node in the pipeline graph.
Expand Down
11 changes: 6 additions & 5 deletions crates/nvisy-engine/src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ mod policy;

use std::collections::HashMap;

pub use graph::{
ActionKind, ActionNode, Graph, GraphEdge, GraphNode, GraphNodeKind, SourceNode, TargetNode,
};
use nvisy_core::Error;
use petgraph::algo::{is_cyclic_directed, toposort};
use petgraph::graph::{DiGraph, NodeIndex};
pub(crate) use plan::{ExecutionPlan, ResolvedNode};
pub use policy::{BackoffStrategy, RetryPolicy, TimeoutBehavior, TimeoutPolicy};
use uuid::Uuid;

pub use self::graph::{
ActionKind, ActionNode, Graph, GraphEdge, GraphNode, GraphNodeKind, SourceNode, TargetNode,
};
pub(crate) use self::plan::{ExecutionPlan, ResolvedNode};
pub use self::policy::{BackoffStrategy, RetryPolicy, TimeoutBehavior, TimeoutPolicy};

/// Pipeline compiler with optional default policies.
///
/// Nodes that don't carry their own retry or timeout policy will inherit
Expand Down
4 changes: 2 additions & 2 deletions crates/nvisy-engine/src/compiler/policy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
mod retry;
mod timeout;

pub use retry::{BackoffStrategy, RetryPolicy};
pub use timeout::{TimeoutBehavior, TimeoutPolicy};
pub use self::retry::{BackoffStrategy, RetryPolicy};
pub use self::timeout::{TimeoutBehavior, TimeoutPolicy};
6 changes: 3 additions & 3 deletions crates/nvisy-engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ pub mod pipeline;
pub mod provenance;

// Re-export graph data model for pipeline definitions.
pub use compiler::{
pub use self::compiler::{
ActionKind, ActionNode, Graph, GraphEdge, GraphNode, GraphNodeKind, SourceNode, TargetNode,
};
// Re-export retry and timeout policies for pipeline nodes.
pub use compiler::{BackoffStrategy, RetryPolicy, TimeoutBehavior, TimeoutPolicy};
pub use pipeline::{
pub use self::compiler::{BackoffStrategy, RetryPolicy, TimeoutBehavior, TimeoutPolicy};
pub use self::pipeline::{
DefaultEngine, EngineSection, LlmSection, OcrSection, RuntimeConfig, SttSection, TtsSection,
};
8 changes: 3 additions & 5 deletions crates/nvisy-engine/src/operation/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
//! [`Operation::Input`]: crate::operation::Operation::Input
//! [`Operation::Output`]: crate::operation::Operation::Output

mod envelope;
mod parallel;
mod sequential;
mod shared;

pub use envelope::DocumentEnvelope;
pub use parallel::ParallelContext;
pub use sequential::SequentialContext;
pub use shared::SharedContext;
pub use self::parallel::ParallelContext;
pub use self::sequential::SequentialContext;
pub use self::shared::SharedContext;

pub(crate) mod private {
pub trait Sealed {}
Expand Down
Loading