kreuzberg 4.1.1 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c1c0519fb3a58c45ec553994bd982b4f284835bd35ea0758461f6f381accfd6
4
- data.tar.gz: 161c18cfabdd20bdaa520abda521cb16072dcc00f5fd2e41152d9da4acdb9d08
3
+ metadata.gz: 6550daabf58e5e396576e5a83c6a53f226e677f9c129920c9990bba309fbd7ba
4
+ data.tar.gz: 9595aa468666391d08a0962db589bbbc50d5bd1c8532e101efa234f6c523d7c5
5
5
  SHA512:
6
- metadata.gz: 7c6e1768022dcfdef5eaaaa3557a8388e8ad45158a69ed022d852b07f7658cbb885ca7860fa32eda8f29b5f7ea4216f93033aad77614afb82578b9157ed92710
7
- data.tar.gz: 96ca3f1f3c6d6f9ea6dc826f7704c1d741ffaab24f524f099c4eb294652211ac6b9f324874974bb24d417193e76b1bce951315330d6f1ccd8eb5b014fa7fc71f
6
+ metadata.gz: 0dea911deebe061515dd4cbff2b76b3a7947c68f196fcc576001d42d80386f6c53f8ed63e0e4acb8e719ad6f95c21e689df7aef5f6cbbbc0d1c92ef96ddb673c
7
+ data.tar.gz: 0df091f80f7c73dda0c17d89d4aa0571cd01f0f2b697b187fd9bae28f8dbcf96cd2e3a269f9831a442b8cf46ce40608586d3d6a242d84bb394fe6056cba3b492
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kreuzberg (4.1.1)
4
+ kreuzberg (4.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -121,7 +121,7 @@ GEM
121
121
  rubocop (~> 1.81)
122
122
  ruby-progressbar (1.13.0)
123
123
  securerandom (0.4.1)
124
- sorbet-runtime (0.6.12894)
124
+ sorbet-runtime (0.6.12897)
125
125
  steep (1.10.0)
126
126
  activesupport (>= 5.1)
127
127
  concurrent-ruby (>= 1.1.10)
@@ -207,7 +207,7 @@ CHECKSUMS
207
207
  i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
208
208
  io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
209
209
  json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
210
- kreuzberg (4.1.1)
210
+ kreuzberg (4.1.2)
211
211
  language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
212
212
  lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
213
213
  listen (3.10.0) sha256=c6e182db62143aeccc2e1960033bebe7445309c7272061979bb098d03760c9d2
@@ -242,7 +242,7 @@ CHECKSUMS
242
242
  rubocop-rspec (3.9.0) sha256=8fa70a3619408237d789aeecfb9beef40576acc855173e60939d63332fdb55e2
243
243
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
244
244
  securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
245
- sorbet-runtime (0.6.12894) sha256=4f0cbe041d80dac973ec3a5a848679922074dd77cc19f46384b27a8b9ff4a90c
245
+ sorbet-runtime (0.6.12897) sha256=0348ab8803c4c3646977fee298083ded9b7e74d5b34b50c567c63eb7e36eb286
246
246
  steep (1.10.0) sha256=1b295b55f9aaff1b8d3ee42453ee55bc2a1078fda0268f288edb2dc014f4d7d1
247
247
  strscan (3.1.7) sha256=5f76462b94a3ea50b44973225b7d75b2cb96d4e1bee9ef1319b99ca117b72c8c
248
248
  terminal-table (4.0.0) sha256=f504793203f8251b2ea7c7068333053f0beeea26093ec9962e62ea79f94301d2
data/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
  <img src="https://img.shields.io/maven-central/v/dev.kreuzberg/kreuzberg?label=Java&color=007ec6" alt="Java">
23
23
  </a>
24
24
  <a href="https://github.com/kreuzberg-dev/kreuzberg/releases">
25
- <img src="https://img.shields.io/github/v/tag/kreuzberg-dev/kreuzberg?label=Go&color=007ec6&filter=v4.1.1" alt="Go">
25
+ <img src="https://img.shields.io/github/v/tag/kreuzberg-dev/kreuzberg?label=Go&color=007ec6&filter=v4.1.2" alt="Go">
26
26
  </a>
27
27
  <a href="https://www.nuget.org/packages/Kreuzberg/">
28
28
  <img src="https://img.shields.io/nuget/v/Kreuzberg?label=C%23&color=007ec6" alt="C#">
@@ -86,10 +86,13 @@ gem 'kreuzberg'
86
86
 
87
87
  ### System Requirements
88
88
 
89
- - **Ruby 2.7+** required
89
+ - **Ruby 3.2.0 or higher** required (including Ruby 4.x)
90
+ - Ruby 4.0+ is fully supported with no code changes required
90
91
  - Optional: [ONNX Runtime](https://github.com/microsoft/onnxruntime/releases) version 1.22.x for embeddings support
91
92
  - Optional: [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) for OCR functionality
92
93
 
94
+ **Ruby 4.0 Compatibility:** Kreuzberg is fully compatible with Ruby 4.0 (released December 25, 2025) and all Ruby 4.x versions. All tests pass with 100% compatibility. The gem compiles without any breaking changes. Key Ruby 4.0 features like Ruby Box, ZJIT compiler, and Ractor improvements work seamlessly with Kreuzberg.
95
+
93
96
 
94
97
 
95
98
  ## Quick Start
@@ -202,9 +205,9 @@ puts "Processing time: #{result.metadata&.dig('processing_time')}ms"
202
205
 
203
206
  ## Features
204
207
 
205
- ### Supported File Formats (56+)
208
+ ### Supported File Formats (57+)
206
209
 
207
- 56 file formats across 8 major categories with intelligent format detection and comprehensive metadata extraction.
210
+ 57 file formats across 8 major categories with intelligent format detection and comprehensive metadata extraction.
208
211
 
209
212
  #### Office Documents
210
213
 
@@ -230,7 +233,7 @@ puts "Processing time: #{result.metadata&.dig('processing_time')}ms"
230
233
  |----------|---------|----------|
231
234
  | **Markup** | `.html`, `.htm`, `.xhtml`, `.xml`, `.svg` | DOM parsing, metadata (Open Graph, Twitter Card), link extraction |
232
235
  | **Structured Data** | `.json`, `.yaml`, `.yml`, `.toml`, `.csv`, `.tsv` | Schema detection, nested structures, validation |
233
- | **Text & Markdown** | `.txt`, `.md`, `.markdown`, `.rst`, `.org`, `.rtf` | CommonMark, GFM, reStructuredText, Org Mode |
236
+ | **Text & Markdown** | `.txt`, `.md`, `.markdown`, `.djot`, `.rst`, `.org`, `.rtf` | CommonMark, GFM, Djot, reStructuredText, Org Mode |
234
237
 
235
238
  #### Email & Archives
236
239
 
@@ -31,7 +31,7 @@ embeddings = ["kreuzberg/embeddings"]
31
31
 
32
32
  [dependencies]
33
33
  async-trait = "0.1.89"
34
- kreuzberg = { path = "../../../../../crates/kreuzberg", default-features = false, features = [
34
+ kreuzberg = { path = "../../../vendor/kreuzberg", default-features = false, features = [
35
35
  "pdf",
36
36
  "excel",
37
37
  "office",
@@ -51,7 +51,7 @@ kreuzberg = { path = "../../../../../crates/kreuzberg", default-features = false
51
51
  "bundled-pdfium",
52
52
  "tokio-runtime",
53
53
  ] }
54
- kreuzberg-ffi = { path = "../../../../../crates/kreuzberg-ffi" }
54
+ kreuzberg-ffi = { path = "../../../vendor/kreuzberg-ffi" }
55
55
  magnus = { git = "https://github.com/matsadler/magnus", rev = "f6db11769efb517427bf7f121f9c32e18b059b38", features = [
56
56
  "rb-sys",
57
57
  ] }
@@ -1025,8 +1025,10 @@ pub fn config_from_file(path: String) -> Result<RHash, Error> {
1025
1025
  .and_then(|v| magnus::RHash::try_convert(v).map_err(|_| validation_error("Config must be a Hash")))
1026
1026
  }
1027
1027
 
1028
- /// Discover extraction config from current directory
1028
+ /// Discover extraction config from current directory or parent directories
1029
1029
  pub fn config_discover() -> Result<Value, Error> {
1030
+ use std::path::PathBuf;
1031
+
1030
1032
  let ruby = Ruby::get().expect("Ruby not initialized");
1031
1033
 
1032
1034
  // Search for config files in order of precedence
@@ -1038,19 +1040,27 @@ pub fn config_discover() -> Result<Value, Error> {
1038
1040
  (".kreuzbergrc", "json"),
1039
1041
  ];
1040
1042
 
1041
- for (name, format) in config_files {
1042
- if let Ok(content) = fs::read_to_string(name) {
1043
- let json_value: serde_json::Value = match format {
1044
- "toml" => toml::from_str(&content)
1045
- .map_err(|e| validation_error(format!("Invalid TOML in {}: {}", name, e)))?,
1046
- "yaml" => serde_yaml_ng::from_str(&content)
1047
- .map_err(|e| validation_error(format!("Invalid YAML in {}: {}", name, e)))?,
1048
- "json" => serde_json::from_str(&content)
1049
- .map_err(|e| validation_error(format!("Invalid JSON in {}: {}", name, e)))?,
1050
- _ => unreachable!(),
1051
- };
1052
- return json_value_to_ruby(&ruby, &json_value);
1043
+ // Start from current directory and search up to parent directories
1044
+ let mut current_dir: Option<PathBuf> = std::env::current_dir().ok();
1045
+
1046
+ while let Some(dir) = current_dir {
1047
+ for (name, format) in &config_files {
1048
+ let config_path = dir.join(name);
1049
+ if let Ok(content) = fs::read_to_string(&config_path) {
1050
+ let json_value: serde_json::Value = match *format {
1051
+ "toml" => toml::from_str(&content)
1052
+ .map_err(|e| validation_error(format!("Invalid TOML in {}: {}", config_path.display(), e)))?,
1053
+ "yaml" => serde_yaml_ng::from_str(&content)
1054
+ .map_err(|e| validation_error(format!("Invalid YAML in {}: {}", config_path.display(), e)))?,
1055
+ "json" => serde_json::from_str(&content)
1056
+ .map_err(|e| validation_error(format!("Invalid JSON in {}: {}", config_path.display(), e)))?,
1057
+ _ => unreachable!(),
1058
+ };
1059
+ return json_value_to_ruby(&ruby, &json_value);
1060
+ }
1053
1061
  }
1062
+ // Move to parent directory
1063
+ current_dir = dir.parent().map(|p| p.to_path_buf());
1054
1064
  }
1055
1065
 
1056
1066
  // Return nil if no config found
data/kreuzberg.gemspec CHANGED
@@ -165,7 +165,7 @@ Gem::Specification.new do |spec|
165
165
  DESC
166
166
  spec.homepage = 'https://github.com/kreuzberg-dev/kreuzberg'
167
167
  spec.license = 'MIT'
168
- spec.required_ruby_version = '>= 3.2.0'
168
+ spec.required_ruby_version = '>= 3.2.0', '< 5.0'
169
169
 
170
170
  spec.metadata = {
171
171
  'homepage_uri' => spec.homepage,
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'open3'
4
- require 'pathname'
5
4
 
6
5
  module Kreuzberg
7
6
  # @example Start the server
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'open3'
4
- require 'pathname'
5
4
 
6
5
  module Kreuzberg
7
6
  # @example
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'open3'
4
- require 'pathname'
5
4
  require 'json'
6
5
 
7
6
  module Kreuzberg
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kreuzberg
4
- VERSION = '4.1.1'
4
+ VERSION = '4.1.2'
5
5
  end
data/vendor/Cargo.toml CHANGED
@@ -3,7 +3,7 @@ members = ["kreuzberg", "kreuzberg-tesseract", "kreuzberg-ffi"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "4.1.1"
6
+ version = "4.1.2"
7
7
  edition = "2024"
8
8
  rust-version = "1.91"
9
9
  authors = ["Na'aman Hirschfeld <nhirschfeld@gmail.com>"]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "kreuzberg"
3
- version = "4.1.1"
3
+ version = "4.1.2"
4
4
  edition = "2024"
5
5
  rust-version = "1.91"
6
6
  authors = ["Na'aman Hirschfeld <nhirschfeld@gmail.com>"]
@@ -142,7 +142,7 @@ mime_guess = "2.0"
142
142
  rmp-serde = "1.3"
143
143
  thiserror = { workspace = true }
144
144
  tokio = { workspace = true, optional = true }
145
- uuid = { version = "1.19.0", features = ["v4", "js"] }
145
+ uuid = { version = "1.20.0", features = ["v4", "js"] }
146
146
  indexmap = "2.13.0"
147
147
  tracing = { workspace = true }
148
148
  pdfium-render = { package = "kreuzberg-pdfium-render", version = "0.9.0", features = [
@@ -198,7 +198,7 @@ rake = { version = "0.3.6", optional = true }
198
198
  axum = { version = "0.8", features = ["macros", "json", "multipart"], optional = true }
199
199
  tower = { version = "0.5", optional = true }
200
200
  tower-http = { version = "0.6", features = ["cors", "trace", "limit"], optional = true }
201
- rmcp = { version = "0.13.0", features = [
201
+ rmcp = { version = "0.14.0", features = [
202
202
  "server",
203
203
  "macros",
204
204
  "base64",
@@ -17,7 +17,7 @@ High-performance document intelligence library for Rust. Extract text, metadata,
17
17
 
18
18
  This is the core Rust library that powers the Python, TypeScript, and Ruby bindings.
19
19
 
20
- > **🚀 Version 4.1.1 Release**
20
+ > **🚀 Version 4.1.2 Release**
21
21
  > This is a pre-release version. We invite you to test the library and [report any issues](https://github.com/kreuzberg-dev/kreuzberg/issues) you encounter.
22
22
  >
23
23
  > **Note**: The Rust crate is not currently published to crates.io for this RC. Use git dependencies or language bindings (Python, TypeScript, Ruby) instead.
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "kreuzberg-tesseract"
3
- version = "4.1.1"
3
+ version = "4.1.2"
4
4
  edition = "2024"
5
5
  rust-version = "1.91"
6
6
  authors = ["Na'aman Hirschfeld <nhirschfeld@gmail.com>"]
@@ -21,10 +21,10 @@ libc = { workspace = true }
21
21
  thiserror = { workspace = true }
22
22
 
23
23
  [dev-dependencies]
24
- image = { workspace = true }
24
+ image = { workspace = true, features = ["png"] }
25
25
 
26
26
  [build-dependencies]
27
- cc = { version = "^1.2.53", optional = true }
27
+ cc = { version = "^1.2.54", optional = true }
28
28
  cmake = { version = "0.1.57", optional = true }
29
29
  zip = { version = "7.2.0", optional = true }
30
30
 
@@ -38,7 +38,7 @@ mod build_tesseract {
38
38
  return None;
39
39
  }
40
40
  }
41
- Some(path.join("tesseract-rs-cache"))
41
+ Some(path.join("kreuzberg-tesseract-cache"))
42
42
  }
43
43
 
44
44
  fn get_preferred_out_dir() -> PathBuf {
@@ -63,14 +63,14 @@ mod build_tesseract {
63
63
  PathBuf::from(home_dir)
64
64
  .join("Library")
65
65
  .join("Application Support")
66
- .join("tesseract-rs")
66
+ .join("kreuzberg-tesseract")
67
67
  } else if cfg!(target_os = "linux") {
68
68
  let home_dir = env::var("HOME").unwrap_or_else(|_| {
69
69
  env::var("USER")
70
70
  .map(|user| format!("/home/{}", user))
71
71
  .expect("Neither HOME nor USER environment variable set")
72
72
  });
73
- PathBuf::from(home_dir).join(".tesseract-rs")
73
+ PathBuf::from(home_dir).join(".kreuzberg-tesseract")
74
74
  } else {
75
75
  panic!("Unsupported operating system");
76
76
  }
@@ -117,7 +117,7 @@ mod build_tesseract {
117
117
  "cargo:warning=Failed to create cache dir {:?}: {}. Falling back to temp dir.",
118
118
  preferred, err
119
119
  );
120
- let fallback = env::temp_dir().join("tesseract-rs-cache");
120
+ let fallback = env::temp_dir().join("kreuzberg-tesseract-cache");
121
121
  fs::create_dir_all(&fallback).expect("Failed to create fallback cache directory in temp dir");
122
122
  fallback
123
123
  }
@@ -6,16 +6,16 @@
6
6
  #![allow(clippy::not_unsafe_ptr_arg_deref)]
7
7
  #![allow(clippy::cmp_null)]
8
8
 
9
- //! # tesseract-rs
9
+ //! # kreuzberg-tesseract
10
10
  //!
11
- //! `tesseract-rs` provides safe Rust bindings for Tesseract OCR with built-in compilation
11
+ //! `kreuzberg-tesseract` provides safe Rust bindings for Tesseract OCR with built-in compilation
12
12
  //! of Tesseract and Leptonica libraries. This crate aims to make OCR functionality
13
13
  //! easily accessible in Rust projects while handling the complexity of interfacing
14
14
  //! with the underlying C++ libraries.
15
15
  //!
16
16
  //! ## Usage
17
17
  //!
18
- //! Here's a basic example of how to use `tesseract-rs`:
18
+ //! Here's a basic example of how to use `kreuzberg-tesseract`:
19
19
  //!
20
20
  //! ```rust
21
21
  //! use std::path::PathBuf;
@@ -28,16 +28,16 @@
28
28
  //! PathBuf::from(home_dir)
29
29
  //! .join("Library")
30
30
  //! .join("Application Support")
31
- //! .join("tesseract-rs")
31
+ //! .join("kreuzberg-tesseract")
32
32
  //! .join("tessdata")
33
33
  //! } else if cfg!(target_os = "linux") {
34
34
  //! let home_dir = std::env::var("HOME").expect("HOME environment variable not set");
35
35
  //! PathBuf::from(home_dir)
36
- //! .join(".tesseract-rs")
36
+ //! .join(".kreuzberg-tesseract")
37
37
  //! .join("tessdata")
38
38
  //! } else if cfg!(target_os = "windows") {
39
39
  //! PathBuf::from(std::env::var("APPDATA").expect("APPDATA environment variable not set"))
40
- //! .join("tesseract-rs")
40
+ //! .join("kreuzberg-tesseract")
41
41
  //! .join("tessdata")
42
42
  //! } else {
43
43
  //! panic!("Unsupported operating system");
@@ -7,7 +7,7 @@ fn get_default_tessdata_dir() -> PathBuf {
7
7
  PathBuf::from(home_dir)
8
8
  .join("Library")
9
9
  .join("Application Support")
10
- .join("tesseract-rs")
10
+ .join("kreuzberg-tesseract")
11
11
  .join("tessdata")
12
12
  } else if cfg!(target_os = "linux") {
13
13
  let system_paths = [
@@ -20,10 +20,10 @@ fn get_default_tessdata_dir() -> PathBuf {
20
20
  }
21
21
  }
22
22
  let home_dir = std::env::var("HOME").expect("HOME environment variable not set");
23
- PathBuf::from(home_dir).join(".tesseract-rs").join("tessdata")
23
+ PathBuf::from(home_dir).join(".kreuzberg-tesseract").join("tessdata")
24
24
  } else if cfg!(target_os = "windows") {
25
25
  PathBuf::from(std::env::var("APPDATA").expect("APPDATA environment variable not set"))
26
- .join("tesseract-rs")
26
+ .join("kreuzberg-tesseract")
27
27
  .join("tessdata")
28
28
  } else {
29
29
  panic!("Unsupported operating system");
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kreuzberg
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-01-23 00:00:00.000000000 Z
11
+ date: 2026-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -791,6 +791,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
791
791
  - - ">="
792
792
  - !ruby/object:Gem::Version
793
793
  version: 3.2.0
794
+ - - "<"
795
+ - !ruby/object:Gem::Version
796
+ version: '5.0'
794
797
  required_rubygems_version: !ruby/object:Gem::Requirement
795
798
  requirements:
796
799
  - - ">="