1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
"""
FFI (Foreign Function Interface) layer for KYA Validator.
This module provides thin wrappers over PyO3-exposed Rust functions
from the _core module, handling type conversions and error mapping.
"""
"""Validate a manifest JSON string using default configuration.
This is a thin wrapper around the Rust validate_manifest_json function.
Parameters
----------
manifest_json : str
Manifest JSON string to validate.
Returns
-------
str
JSON string of validation report.
Raises
------
InvalidInputError
If manifest JSON is invalid.
CoreError
If Rust core validation fails.
"""
return
# Check if it's a PyO3 exception
=
"""Validate a manifest JSON string with custom configuration.
This is a thin wrapper around the Rust
validate_manifest_json_with_config function.
Parameters
----------
manifest_json : str
Manifest JSON string to validate.
config_json : str
Configuration JSON string.
Returns
-------
str
JSON string of validation report.
Raises
------
InvalidInputError
If manifest or config JSON is invalid.
CoreError
If Rust core validation fails.
"""
return
=
"""Check if a string is valid JSON.
Parameters
----------
json_str : str
String to validate.
Returns
-------
bool
True if string is valid JSON, False otherwise.
"""
return True
return False
"""Format JSON string with pretty printing.
Parameters
----------
json_str : str
JSON string to format.
indent : int, optional
Number of spaces for indentation. Default is 2.
Returns
-------
str
Formatted JSON string.
Raises
------
InvalidInputError
If input is not valid JSON.
"""
=
return
"""Get the validator version from Rust core.
Returns
-------
str
Version string.
"""
return
# Fallback if not available
return
"""Get the validator name from Rust core.
Returns
-------
str
Name string.
"""
return
# Fallback if not available
return
# Check for additional functions that may be exposed by PyO3
# These will be added as we expand the Rust bindings
=
"""Check if a function is available in the Rust core.
Parameters
----------
name : str
Function name to check.
Returns
-------
bool
True if function is available.
"""
return in