kreuzberg 4.3.5-aarch64-linux

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.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yaml +1 -0
  5. data/.rubocop.yml +543 -0
  6. data/Gemfile +8 -0
  7. data/Gemfile.lock +260 -0
  8. data/README.md +399 -0
  9. data/Rakefile +34 -0
  10. data/Steepfile +51 -0
  11. data/examples/async_patterns.rb +283 -0
  12. data/extconf.rb +60 -0
  13. data/kreuzberg.gemspec +253 -0
  14. data/lib/kreuzberg/api_proxy.rb +125 -0
  15. data/lib/kreuzberg/cache_api.rb +67 -0
  16. data/lib/kreuzberg/cli.rb +57 -0
  17. data/lib/kreuzberg/cli_proxy.rb +118 -0
  18. data/lib/kreuzberg/config.rb +1241 -0
  19. data/lib/kreuzberg/djot_content.rb +225 -0
  20. data/lib/kreuzberg/document_structure.rb +204 -0
  21. data/lib/kreuzberg/error_context.rb +136 -0
  22. data/lib/kreuzberg/errors.rb +116 -0
  23. data/lib/kreuzberg/extraction_api.rb +329 -0
  24. data/lib/kreuzberg/mcp_proxy.rb +176 -0
  25. data/lib/kreuzberg/ocr_backend_protocol.rb +40 -0
  26. data/lib/kreuzberg/post_processor_protocol.rb +15 -0
  27. data/lib/kreuzberg/result.rb +712 -0
  28. data/lib/kreuzberg/setup_lib_path.rb +99 -0
  29. data/lib/kreuzberg/types.rb +414 -0
  30. data/lib/kreuzberg/validator_protocol.rb +16 -0
  31. data/lib/kreuzberg/version.rb +5 -0
  32. data/lib/kreuzberg.rb +102 -0
  33. data/lib/kreuzberg_rb.so +0 -0
  34. data/lib/libpdfium.so +0 -0
  35. data/sig/kreuzberg/internal.rbs +184 -0
  36. data/sig/kreuzberg.rbs +1337 -0
  37. data/spec/binding/async_operations_spec.rb +473 -0
  38. data/spec/binding/batch_operations_spec.rb +677 -0
  39. data/spec/binding/batch_spec.rb +360 -0
  40. data/spec/binding/cache_spec.rb +227 -0
  41. data/spec/binding/cli_proxy_spec.rb +85 -0
  42. data/spec/binding/cli_spec.rb +55 -0
  43. data/spec/binding/config_result_spec.rb +377 -0
  44. data/spec/binding/config_spec.rb +419 -0
  45. data/spec/binding/config_validation_spec.rb +377 -0
  46. data/spec/binding/embeddings_spec.rb +816 -0
  47. data/spec/binding/error_handling_spec.rb +399 -0
  48. data/spec/binding/error_recovery_spec.rb +488 -0
  49. data/spec/binding/errors_spec.rb +66 -0
  50. data/spec/binding/font_config_spec.rb +220 -0
  51. data/spec/binding/images_spec.rb +732 -0
  52. data/spec/binding/keywords_extraction_spec.rb +600 -0
  53. data/spec/binding/metadata_types_spec.rb +1253 -0
  54. data/spec/binding/pages_extraction_spec.rb +550 -0
  55. data/spec/binding/plugins/ocr_backend_spec.rb +307 -0
  56. data/spec/binding/plugins/postprocessor_spec.rb +269 -0
  57. data/spec/binding/plugins/validator_spec.rb +273 -0
  58. data/spec/binding/tables_spec.rb +650 -0
  59. data/spec/fixtures/config.toml +38 -0
  60. data/spec/fixtures/config.yaml +41 -0
  61. data/spec/fixtures/invalid_config.toml +3 -0
  62. data/spec/serialization_spec.rb +134 -0
  63. data/spec/smoke/package_spec.rb +177 -0
  64. data/spec/spec_helper.rb +40 -0
  65. data/spec/unit/config/chunking_config_spec.rb +213 -0
  66. data/spec/unit/config/embedding_config_spec.rb +343 -0
  67. data/spec/unit/config/extraction_config_spec.rb +434 -0
  68. data/spec/unit/config/font_config_spec.rb +285 -0
  69. data/spec/unit/config/hierarchy_config_spec.rb +314 -0
  70. data/spec/unit/config/image_extraction_config_spec.rb +209 -0
  71. data/spec/unit/config/image_preprocessing_config_spec.rb +230 -0
  72. data/spec/unit/config/keyword_config_spec.rb +229 -0
  73. data/spec/unit/config/language_detection_config_spec.rb +258 -0
  74. data/spec/unit/config/ocr_config_spec.rb +171 -0
  75. data/spec/unit/config/output_format_spec.rb +380 -0
  76. data/spec/unit/config/page_config_spec.rb +221 -0
  77. data/spec/unit/config/pdf_config_spec.rb +267 -0
  78. data/spec/unit/config/postprocessor_config_spec.rb +290 -0
  79. data/spec/unit/config/tesseract_config_spec.rb +181 -0
  80. data/spec/unit/config/token_reduction_config_spec.rb +251 -0
  81. data/test/metadata_types_test.rb +959 -0
  82. metadata +292 -0
@@ -0,0 +1,184 @@
1
+ # Internal modules - not part of public API but fully typed
2
+
3
+ module Kreuzberg
4
+ module SetupLibPath
5
+ # Public method
6
+ def configure: () -> void
7
+ def self.configure: () -> void
8
+
9
+ # Private methods (module_function makes them both instance and class methods)
10
+ def prepend_env: (String key, String value, ?separator: String) -> void
11
+ def self.prepend_env: (String key, String value, ?separator: String) -> void
12
+ def fix_macos_install_name: (String lib_dir) -> void
13
+ def self.fix_macos_install_name: (String lib_dir) -> void
14
+ def macos_bundle: (String lib_dir) -> String?
15
+ def self.macos_bundle: (String lib_dir) -> String?
16
+ def ensure_install_name: (String bundle) -> void
17
+ def self.ensure_install_name: (String bundle) -> void
18
+ def ensure_loader_rpath: (String bundle) -> void
19
+ def self.ensure_loader_rpath: (String bundle) -> void
20
+ end
21
+
22
+ module CLI
23
+ # All methods are both instance and class methods due to module_function
24
+ def extract: (String path, ?output: String, ?ocr: bool) -> String
25
+ def self.extract: (String path, ?output: String, ?ocr: bool) -> String
26
+ def detect: (String path) -> String
27
+ def self.detect: (String path) -> String
28
+ def version: () -> String
29
+ def self.version: () -> String
30
+ def help: () -> String
31
+ def self.help: () -> String
32
+ end
33
+
34
+ module CLIProxy
35
+ class Error < Kreuzberg::Errors::Error
36
+ end
37
+
38
+ class MissingBinaryError < Error
39
+ end
40
+
41
+ class CLIExecutionError < Error
42
+ attr_reader stderr: String
43
+ attr_reader status: Integer
44
+
45
+ def initialize: (String message, stderr: String, status: Integer) -> void
46
+ end
47
+
48
+ # All methods are both instance and class methods due to module_function
49
+ def call: (Array[String] argv) -> String
50
+ def self.call: (Array[String] argv) -> String
51
+ def find_cli_binary: () -> Pathname
52
+ def self.find_cli_binary: () -> Pathname
53
+ def root_path: () -> Pathname
54
+ def self.root_path: () -> Pathname
55
+ def lib_path: () -> Pathname
56
+ def self.lib_path: () -> Pathname
57
+ def search_paths: (String binary_name) -> Array[Pathname]
58
+ def self.search_paths: (String binary_name) -> Array[Pathname]
59
+ def missing_binary_message: () -> String
60
+ def self.missing_binary_message: () -> String
61
+ end
62
+
63
+ module APIProxy
64
+ class Error < Kreuzberg::Errors::Error
65
+ end
66
+
67
+ class MissingBinaryError < Error
68
+ end
69
+
70
+ class ServerError < Error
71
+ end
72
+
73
+ class Server
74
+ attr_reader port: Integer
75
+ attr_reader host: String
76
+ attr_reader process: Process::Status?
77
+
78
+ def initialize: (?port: Integer, ?host: String) -> void
79
+ def start: () -> void
80
+ def stop: () -> void
81
+ def running?: () -> bool
82
+ def health_check: () -> bool
83
+ end
84
+
85
+ # Module function methods are both instance and class methods
86
+ def run: (?port: Integer, ?host: String) { (Server) -> untyped } -> untyped
87
+ def self.run: (?port: Integer, ?host: String) { (Server) -> untyped } -> untyped
88
+ def start_server: (?port: Integer?) -> Server
89
+ def self.start_server: (?port: Integer?) -> Server
90
+ def extract_file: (String path, ?mime_type: String?, ?config: Hash[Symbol, untyped]?, ?server: Server?) -> Kreuzberg::Result
91
+ def self.extract_file: (String path, ?mime_type: String?, ?config: Hash[Symbol, untyped]?, ?server: Server?) -> Kreuzberg::Result
92
+ def batch_extract: (Array[String] paths, ?config: Hash[Symbol, untyped]?, ?server: Server?) -> Array[Kreuzberg::Result]
93
+ def self.batch_extract: (Array[String] paths, ?config: Hash[Symbol, untyped]?, ?server: Server?) -> Array[Kreuzberg::Result]
94
+ def find_api_binary: () -> Pathname
95
+ def self.find_api_binary: () -> Pathname
96
+ def missing_binary_message: () -> String
97
+ def self.missing_binary_message: () -> String
98
+ end
99
+
100
+ module MCPProxy
101
+ class Error < Kreuzberg::Errors::Error
102
+ end
103
+
104
+ class MissingBinaryError < Error
105
+ end
106
+
107
+ class ServerError < Error
108
+ end
109
+
110
+ class Server
111
+ attr_reader pid: Integer?
112
+ attr_reader transport: String
113
+
114
+ def initialize: (?transport: String) -> void
115
+ def start: () -> (Integer | nil)
116
+ def stop: () -> void
117
+ def running?: () -> bool
118
+ def send_message: (Hash[untyped, untyped] message) -> void
119
+ def read_message: () -> (Hash[untyped, untyped] | nil)
120
+
121
+ private
122
+
123
+ def start_stdio: (Pathname binary) -> nil
124
+ def start_sse: (Pathname binary) -> (Integer | nil)
125
+ def close_pipes: () -> void
126
+ end
127
+
128
+ # Module function methods are both instance and class methods
129
+ def run: (?transport: String) { (Server) -> untyped } -> untyped
130
+ def self.run: (?transport: String) { (Server) -> untyped } -> untyped
131
+ def extract_file: (String path, ?mime_type: String?, ?config: Hash[Symbol, untyped]?) -> Kreuzberg::Result
132
+ def self.extract_file: (String path, ?mime_type: String?, ?config: Hash[Symbol, untyped]?) -> Kreuzberg::Result
133
+ def batch_extract: (Array[String] paths, ?config: Hash[Symbol, untyped]?) -> Array[Kreuzberg::Result]
134
+ def self.batch_extract: (Array[String] paths, ?config: Hash[Symbol, untyped]?) -> Array[Kreuzberg::Result]
135
+ def find_mcp_binary: () -> Pathname
136
+ def self.find_mcp_binary: () -> Pathname
137
+ def missing_binary_message: () -> String
138
+ def self.missing_binary_message: () -> String
139
+ end
140
+
141
+ # Cache API module (prepended to Kreuzberg singleton class)
142
+ module CacheAPI
143
+ @__cache_tracker: Hash[Symbol, Integer]
144
+
145
+ def clear_cache: () -> void
146
+ def cache_stats: () -> Hash[Symbol | String, Integer]
147
+
148
+ private
149
+
150
+ def record_cache_entry!: (Kreuzberg::Result | Array[Kreuzberg::Result] results, Hash[Symbol, untyped] opts) -> void
151
+ def reset_cache_tracker!: () -> nil
152
+
153
+ # Native methods (defined in Rust)
154
+ def native_clear_cache: () -> void
155
+ def native_cache_stats: () -> Hash[Symbol | String, Integer]
156
+ end
157
+
158
+ # Extraction API module (prepended to Kreuzberg singleton class)
159
+ module ExtractionAPI
160
+ def extract_file_sync: (String | Pathname path, ?mime_type: String?, ?config: config_input?) -> Result
161
+ def extract_bytes_sync: (String data, String mime_type, ?config: config_input?) -> Result
162
+ def batch_extract_files_sync: (Array[String | Pathname] paths, ?config: config_input?) -> Array[Result]
163
+ def extract_file: (String | Pathname path, ?mime_type: String?, ?config: config_input?) -> Result
164
+ def extract_bytes: (String data, String mime_type, ?config: config_input?) -> Result
165
+ def batch_extract_files: (Array[String | Pathname] paths, ?config: config_input?) -> Array[Result]
166
+ def batch_extract_bytes_sync: (Array[String] data_array, Array[String] mime_types, ?config: config_input?) -> Array[Result]
167
+ def batch_extract_bytes: (Array[String] data_array, Array[String] mime_types, ?config: config_input?) -> Array[Result]
168
+
169
+ def normalize_config: (config_input? config) -> Hash[Symbol, untyped]
170
+
171
+ # Native methods (defined in Rust)
172
+ def native_extract_file_sync: (String path, ?String? mime_type, **untyped opts) -> extraction_result_hash
173
+ def native_extract_bytes_sync: (String data, String mime_type, **untyped opts) -> extraction_result_hash
174
+ def native_batch_extract_files_sync: (Array[String] paths, **untyped opts) -> Array[extraction_result_hash]
175
+ def native_extract_file: (String path, ?String? mime_type, **untyped opts) -> extraction_result_hash
176
+ def native_extract_bytes: (String data, String mime_type, **untyped opts) -> extraction_result_hash
177
+ def native_batch_extract_files: (Array[String] paths, **untyped opts) -> Array[extraction_result_hash]
178
+ def native_batch_extract_bytes_sync: (Array[String] data_array, Array[String] mime_types, **untyped opts) -> Array[extraction_result_hash]
179
+ def native_batch_extract_bytes: (Array[String] data_array, Array[String] mime_types, **untyped opts) -> Array[extraction_result_hash]
180
+
181
+ # Cache API methods (from prepended CacheAPI module)
182
+ def record_cache_entry!: (Kreuzberg::Result | Array[Kreuzberg::Result] results, Hash[Symbol, untyped] opts) -> void
183
+ end
184
+ end