agent-tool-parser 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1 @@
1
+ # Marker file for PEP 561.
@@ -0,0 +1,432 @@
1
+ Metadata-Version: 2.5
2
+ Name: agent-tool-parser
3
+ Version: 0.1.0
4
+ Summary: High-performance dual-engine (Rust + Python) tool call parser for DeepSeek R1/V3, Claude 3.7, Qwen 2.5, Llama 3, OpenAI & ReAct formats with auto-repair and zero dependencies.
5
+ Project-URL: Homepage, https://github.com/inboost-dev/agent-tool-parser
6
+ Project-URL: Documentation, https://inboost-dev.github.io/agent-tool-parser/
7
+ Project-URL: Repository, https://github.com/inboost-dev/agent-tool-parser.git
8
+ Project-URL: Issues, https://github.com/inboost-dev/agent-tool-parser/issues
9
+ Project-URL: Changelog, https://github.com/inboost-dev/agent-tool-parser/blob/main/CHANGELOG.md
10
+ Author: InBoost Team
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ Keywords: agent,claude,deepseek,dsml,function-calling,inboost,json-repair,llama,llm,qwen,tool-calling,zero-dependencies
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Requires-Python: >=3.9
26
+ Provides-Extra: all
27
+ Requires-Dist: json-repair>=0.30.0; extra == 'all'
28
+ Requires-Dist: orjson>=3.9.0; extra == 'all'
29
+ Provides-Extra: dev
30
+ Requires-Dist: json-repair>=0.30.0; extra == 'dev'
31
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
32
+ Requires-Dist: orjson>=3.9.0; extra == 'dev'
33
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
34
+ Requires-Dist: ruff>=0.5.0; extra == 'dev'
35
+ Provides-Extra: fast
36
+ Requires-Dist: orjson>=3.9.0; extra == 'fast'
37
+ Provides-Extra: repair
38
+ Requires-Dist: json-repair>=0.30.0; extra == 'repair'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # agent-tool-parser ⚡
42
+
43
+ [![Documentation](https://img.shields.io/badge/docs-interactive%20playground-blueviolet.svg)](https://inboost-dev.github.io/agent-tool-parser/)
44
+ [![PyPI version](https://img.shields.io/badge/pypi-v0.1.0-blue.svg)](https://pypi.org/project/agent-tool-parser/)
45
+ [![Python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://pypi.org/)
46
+ [![Crates.io](https://img.shields.io/badge/crates.io-v0.1.0-orange.svg)](https://crates.io/crates/agent-tool-parser-core)
47
+ [![Rust](https://img.shields.io/badge/rust-1.75%2B-red.svg)](https://www.rust-lang.org/)
48
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
49
+ [![Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)]()
50
+ [![Speed](https://img.shields.io/badge/latency-%3C0.05ms-orange.svg)]()
51
+
52
+ **High-performance, dual-engine (Rust + Python) parser and cleaner for heterogeneous LLM tool calls and structured outputs.**
53
+ [**Interactive Documentation & Live Playground ↗**](https://inboost-dev.github.io/agent-tool-parser/)
54
+
55
+ `agent-tool-parser` is a high-performance library with a dual-engine architecture (compiled Rust core with PyO3 acceleration + pure-Python universal fallback) designed to extract, normalize, and repair tool calls from large language model outputs. It processes standard OpenAI schemas, Anthropic Claude XML, DeepSeek DSML and native tokens, Qwen tokens, Llama AST syntax, and truncated JSON payloads with sub-0.05 millisecond latency and zero required runtime dependencies. Cross-language bindings are available for Python, Rust, Go, C/C++, and WebAssembly.
56
+
57
+ ---
58
+
59
+ ## Design Rationale & Architectural Context
60
+
61
+ ### Scope and Applicability
62
+ When integrating exclusively with closed-source APIs (such as OpenAI or Anthropic) via their native client SDKs, server-side infrastructure typically frames tool calls into structured protocol objects prior to delivery. In such architectures, an external parser is generally unnecessary.
63
+
64
+ However, in systems integrating open-weights models, local inference engines (e.g., vLLM, SGLang, Ollama), or third-party inference aggregators (e.g., OpenRouter, Together AI, Groq), tool invocations are frequently delivered within the unsegmented text stream (`message.content`). Common integration challenges include:
65
+
66
+ 1. **Delimiter Heterogeneity**: Models output diverse serialization schemes, including XML tags (`<tool_use>`), DSML blocks (`<|DSML|invoke>`), native tokens (`<|tool call begin|>`), or AST function calls (`call:tool(arg=val)`).
67
+ 2. **Co-occurring Chain-of-Thought Blocks**: Reasoning models output internal deliberation traces (such as `<think>...</think>`) in the same stream as the final tool invocation.
68
+ 3. **Code Payload Escaping**: Serializing multi-line scripts, shell commands, or unified diffs inside standard JSON strings frequently leads to escape sequence errors with quotes and whitespace.
69
+ 4. **Parameter Name Variations**: Minor model deviations in argument naming (e.g., `cmd` instead of `command`, `file` instead of `path`) can cause downstream schema validation failures.
70
+ 5. **Stream Truncation**: When generation terminates prematurely due to token budget limits, partial JSON structures fail standard deserialization.
71
+
72
+ `agent-tool-parser` provides a deterministic, zero-dependency processing layer to normalize these outputs before execution.
73
+
74
+ ---
75
+
76
+ ## Comparative Analysis
77
+
78
+ | Approach | Design Focus | Execution Characteristics | Scope & Constraints |
79
+ | :--- | :--- | :--- | :--- |
80
+ | **`agent-tool-parser`** | Tool invocation extraction & normalization | Sub-0.05 ms latency; zero dependencies; dual-engine (Rust + Python). | Specialized for tool calling; supports XML, DSML, AST, and JSON repair. |
81
+ | **`json-repair`** | General-purpose JSON syntax repair | Lightweight; standard JSON normalization. | Restricted to JSON grammar; does not process markup tags, thinking blocks, or argument schemas. |
82
+ | **`LangChain` / `LlamaIndex`** | Full-stack application frameworks | Comprehensive multi-package ecosystem. | Higher memory footprint and dependency tree for pipelines requiring only output parsing. |
83
+ | **`Instructor`** | Pydantic validation via function calling | Enforces structured types against server schemas. | Requires provider-level schema support; does not extract delimiter-based markup from message text. |
84
+ | **Guided Decoding (`vLLM / SGLang`)** | Constrained token generation | Enforces grammar during sampling. | Can restrict intermediate reasoning steps in CoT models; inapplicable when calling third-party API endpoints. |
85
+ | **Ad-Hoc Regular Expressions** | Project-specific pattern matching | Zero external dependencies. | Brittle against unquoted attributes, nested tags, and varying model formatting conventions. |
86
+
87
+ ### Architectural Trade-offs: Post-Parsing vs. Server-Side Alternatives
88
+
89
+ In production agent architectures, extracting structured tool invocations is typically approached at one of three system boundaries:
90
+
91
+ | Architectural Dimension | Client-Side Post-Parsing (`agent-tool-parser`) | Logit-Level Constrained Decoding (e.g., XGrammar, Outlines) | Secondary Model Pass (Neural Re-Parser) |
92
+ | :--- | :--- | :--- | :--- |
93
+ | **Execution Boundary** | Client runtime (post-generation) | Inference engine sampling loop | Secondary inference endpoint or worker |
94
+ | **Inference Engine Access** | Engine-agnostic (processes standard HTTP / REST text streams) | Requires direct access to logits and the sampling pipeline | Requires secondary model invocation or separate service deployment |
95
+ | **Runtime Dependencies** | Python standard library (zero external dependencies) | Inference runtime stack (e.g., PyTorch, CUDA, Triton) | Model inference framework or API client |
96
+ | **Provider API Support** | Compatible with any endpoint returning text (OpenRouter, Groq, Together, etc.) | Incompatible with third-party APIs lacking custom sampler controls | Compatible via sequential API round-trip |
97
+ | **Grammar Enforcement Mechanism** | Deterministic lexical parsing and structural repair | Logit masking via finite-state machine (FSM) during token sampling | Probabilistic generation guided by system prompt |
98
+ | **Format Scope** | Multi-format: XML, DSML, Markdown JSON, Python AST, CDATA blocks | Strictly defined JSON Schemas or context-free grammars (EBNF) | Unconstrained (dependent on secondary model training distribution) |
99
+
100
+ #### Architectural Trade-offs
101
+
102
+ - **API Boundary & Sampler Control:** Logit masking operates inside the autoregressive generation loop on the inference host. When utilizing managed or third-party inference providers (such as OpenRouter, DeepSeek API, or Groq), clients receive serialized text rather than sampler-level logit access, making server-side grammar constraints unavailable.
103
+ - **Intermediate Reasoning Tokens:** When reasoning architectures emit unconstrained chain-of-thought blocks (such as `<think>...</think>`), logit-level grammars must support dynamic transitions between free-form text and structured output schemas. Client-side extraction isolates the deliberation trace from the structured invocation payload after generation completes.
104
+ - **Payload Heterogeneity:** Tool calls frequently involve non-JSON payloads, such as multi-line shell scripts, unified diffs, or XML CDATA blocks. Client-side parsers process these alternative delimiters directly without requiring JSON string escaping.
105
+
106
+ ---
107
+
108
+ ## Architectural Reference Patterns
109
+
110
+ ### Pattern 1: Autonomous Agent Loop (ReAct / Task Execution)
111
+ Standard ReAct loops require resilient extraction when alternating between reasoning and tool execution:
112
+
113
+ ```python
114
+ from agent_tool_parser import try_parse_tool_calls
115
+
116
+
117
+ def run_agent_turn(model_output: str) -> list[dict]:
118
+ # Extracts all valid tool calls, removing any <think> blocks
119
+ calls = try_parse_tool_calls(model_output)
120
+
121
+ results = []
122
+ for call in calls:
123
+ execution_result = dispatch_tool(call.name, call.args)
124
+ results.append({"tool": call.name, "result": execution_result})
125
+
126
+ return results
127
+ ```
128
+
129
+ ### Pattern 2: API Gateway & Proxy Normalization (LiteLLM / FastAPI Middleware)
130
+ When proxying multi-provider models into standard OpenAI-compatible endpoints:
131
+
132
+ ```python
133
+ from agent_tool_parser import try_parse_tool_calls
134
+
135
+
136
+ def normalize_completion_response(response_dict: dict) -> dict:
137
+ choice = response_dict["choices"][0]
138
+ message = choice["message"]
139
+
140
+ # If the provider omitted tool_calls but returned markup in content:
141
+ if not message.get("tool_calls") and message.get("content"):
142
+ extracted = try_parse_tool_calls(message["content"])
143
+ if extracted:
144
+ message["tool_calls"] = [
145
+ {
146
+ "id": f"call_{i}",
147
+ "type": "function",
148
+ "function": {"name": c.name, "arguments": json.dumps(c.args)},
149
+ }
150
+ for i, c in enumerate(extracted)
151
+ ]
152
+ return response_dict
153
+ ```
154
+
155
+ ### Pattern 3: Control Plane & Fleet Worker Ingress (Mission Control / Paperclip / Dify)
156
+ In multi-agent environments managing autonomous background workers, normalizing arguments prior to approval gates prevents stalled task queues:
157
+
158
+ ```python
159
+ from agent_tool_parser import ToolParser, ToolError
160
+
161
+ parser = ToolParser(
162
+ allowed_tools={"read_file", "write_file", "execute_command"},
163
+ param_aliases={"cmd": "command", "filepath": "path"},
164
+ )
165
+
166
+
167
+ def process_worker_step(raw_step_output: str) -> dict:
168
+ try:
169
+ call = parser.parse(raw_step_output)
170
+ return {"status": "ready_for_approval", "call": call}
171
+ except ToolError as error:
172
+ return {"status": "rejected", "error": str(error)}
173
+ ```
174
+
175
+ ### Pattern 4: Asynchronous Parallel Tool Dispatch
176
+ Processing multiple tool calls from a single model generation step:
177
+
178
+ ```python
179
+ import asyncio
180
+ from agent_tool_parser import parse_tool_calls
181
+
182
+
183
+ async def handle_parallel_generation(model_output: str):
184
+ calls = parse_tool_calls(model_output)
185
+ tasks = [async_execute(call.name, call.args) for call in calls]
186
+ return await asyncio.gather(*tasks, return_exceptions=True)
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Installation
192
+
193
+ ```bash
194
+ # Standard Python installation (zero required dependencies, pure Python fallback by default)
195
+ pip install agent-tool-parser
196
+
197
+ # With optional performance and advanced JSON repair extras:
198
+ pip install "agent-tool-parser[all]" # installs orjson and json-repair
199
+ pip install "agent-tool-parser[fast]" # installs orjson for accelerated pure-Python JSON
200
+ pip install "agent-tool-parser[repair]" # installs json-repair for advanced corrupt JSON
201
+
202
+ # Go module
203
+ go get github.com/inboost-dev/agent-tool-parser/bindings/go/agenttoolparser
204
+ ```
205
+
206
+ ---
207
+
208
+ ## Quickstart
209
+
210
+ ### Python
211
+
212
+ ```python
213
+ from agent_tool_parser import parse_tool_call, ACCELERATED
214
+
215
+ print(f"Accelerated native core active: {ACCELERATED}")
216
+
217
+ # Example response containing reasoning tokens, DSML markup, and unquoted parameters:
218
+ raw_output = """
219
+ <think>
220
+ Evaluating dependency versions before test execution.
221
+ </think>
222
+ <|DSML|tool_calls>
223
+ <|DSML|invoke name="run_tests">
224
+ <|DSML|parameter name="suite">unit</|DSML|parameter>
225
+ <|DSML|parameter name="verbose">true</|DSML|parameter>
226
+ </|DSML|invoke>
227
+ </|DSML|tool_calls>
228
+ """
229
+
230
+ call = parse_tool_call(raw_output)
231
+
232
+ print(call.name) # 'run_tests'
233
+ print(call.args) # {'suite': 'unit', 'verbose': True}
234
+ print(call.raw_source) # Raw matched substring
235
+ ```
236
+
237
+ ### Go (`cgo`)
238
+
239
+ ```go
240
+ package main
241
+
242
+ import (
243
+ "fmt"
244
+ "log"
245
+ agenttoolparser "github.com/inboost-dev/agent-tool-parser/bindings/go/agenttoolparser"
246
+ )
247
+
248
+ func main() {
249
+ raw := `<|tool calls begin|><|tool call begin|>function=search<|tool sep|>{"pattern": "parse", "path": "."}<|tool call end|><|tool calls end|>`
250
+ call, err := agenttoolparser.ParseToolCall(raw)
251
+ if err != nil {
252
+ log.Fatal(err)
253
+ }
254
+ fmt.Printf("Tool: %s, Args: %v\n", call.Name, call.Args)
255
+ }
256
+ ```
257
+
258
+ ### Rust (Native Crate)
259
+
260
+ ```rust
261
+ use agent_tool_parser_core::parse_tool_call;
262
+
263
+ fn main() {
264
+ let raw = "<invoke name=\"bash\"><parameter name=\"cmd\">git status</parameter></invoke>";
265
+ let call = parse_tool_call(raw).expect("Valid tool invocation");
266
+ println!("Tool: {}, Args: {:?}", call.name, call.args);
267
+ }
268
+ ```
269
+
270
+ ### C / C++ (`agent_tool_parser.h`)
271
+
272
+ ```c
273
+ #include "agent_tool_parser.h"
274
+ #include <stdio.h>
275
+
276
+ int main() {
277
+ const char* raw = "<invoke name=\"bash\"><parameter name=\"cmd\">pwd</parameter></invoke>";
278
+ ATPToolCall* call = atp_parse_tool_call(raw);
279
+ if (call) {
280
+ printf("Tool: %s\nArguments: %s\n", call->name, call->args_json);
281
+ atp_free_tool_call(call);
282
+ }
283
+ return 0;
284
+ }
285
+ ```
286
+
287
+ ---
288
+
289
+ ## Dual-Engine Architecture & Multi-Language Core
290
+
291
+ `agent-tool-parser` is structured with a modular, dual-engine design:
292
+
293
+ ```
294
+ agent-tool-parser/
295
+ ├── src/agent_tool_parser/ # Pure-Python engine (zero-dependency, no compiler required)
296
+ │ ├── _accelerated.so # Optional PyO3 compiled native extension
297
+ │ └── __init__.py # Transparent runtime dispatch (ACCELERATED flag)
298
+ ├── crates/
299
+ │ ├── agent-tool-parser-core/ # High-performance Rust core extraction engine
300
+ │ ├── agent-tool-parser-c/ # C-ABI export & standard C header (agent_tool_parser.h)
301
+ │ ├── agent-tool-parser-py/ # PyO3 bindings with pythonize zero-copy deserialization
302
+ │ └── agent-tool-parser-wasm/ # WebAssembly bindings (wasm-bindgen) for Node.js & browser
303
+ └── bindings/
304
+ └── go/agenttoolparser/ # Native Go module wrapping C-ABI via cgo
305
+ ```
306
+
307
+ ### Engine Dispatch & Synchronization
308
+
309
+ - **Parity Guarantee**: Both the pure-Python and Rust core engines pass the exact same validation suite (104 Python unit tests, 58 Rust unit/integration/benchmark tests, and 240+ differential parity assertions) covering all supported formats, error handling, parameter aliases, and degenerate/adversarial input texts.
310
+ - **Zero-Compile Fallback**: If the compiled native extension is not present (or when `AGENT_TOOL_PARSER_NO_EXT=1` is set in the environment), the package operates in pure Python with zero external dependencies.
311
+ - **Compiled Acceleration**: When the compiled extension is available, parsing execution occurs entirely in compiled native code with sub-millisecond execution times.
312
+
313
+ ## Supported Formats
314
+
315
+ | Format Specification | Representative Input | Extraction Status |
316
+ | :--- | :--- | :---: |
317
+ | **Anthropic Claude XML** | `<tool_use><name>read_file</name><arguments>{"path": "src/core.py"}</arguments></tool_use>` | Supported |
318
+ | **OpenAI Function Format** | `{"tool_calls": [{"type": "function", "function": {"name": "search", "arguments": "{...}"}}]}` | Supported |
319
+ | **DeepSeek Native Tokens** | `<|tool call begin|>function=bash<|tool sep|>{"command": "pytest"}<|tool call end|>` | Supported |
320
+ | **DeepSeek DSML** | `<|DSML|tool name=search><|DSML|parameter name=query>vector</|DSML|parameter>` | Supported |
321
+ | **Qwen-Agent Tokens** | `<\|action_start\|><\|action_name\|>run<\|action_args\|>{"script": "main.py"}<\|action_end\|>` | Supported |
322
+ | **Llama 3.1+ Python Tag** | `<\|python_tag\|>bash.call(command="pytest")` | Supported |
323
+ | **Mistral Tool Syntax** | `[TOOL_CALLS] [{"name": "search", "arguments": {"query": "vector"}}]` | Supported |
324
+ | **Python Expression Syntax** | `read_file(path="src/main.py", offset=10)` | Supported |
325
+ | **ReAct Action Notation** | `Action: bash\nAction Input: pytest` | Supported |
326
+ | **Hermes 2/3 XML Markup** | `<tool_call>{"name": "search", "arguments": {"query": "vector"}}</tool_call>` | Supported |
327
+ | **Direct Parameter XML** | `<tool_name>search</tool_name><query>vector</query>` | Supported |
328
+ | **Markdown Fenced JSON** | ````json\n{"tool": "bash", "command": "git status"}\n```` | Supported |
329
+ | **Embedded String CDATA** | `<parameter name="patch"><![CDATA[def test():\n assert True]]></parameter>` | Supported |
330
+ | **Malformed JSON Repair** | `{'tool': 'bash', 'command': 'pytest', 'verbose': True,}` | Supported |
331
+ | **Thinking Blocks** | `<think>Analyzing context...</think>` | Delimited & Stripped |
332
+
333
+ ---
334
+
335
+ ## API Reference
336
+
337
+ ### Functional Interface
338
+
339
+ #### `parse_tool_call(text: str, ...) -> ToolCall`
340
+ Extracts a single tool call from text. Raises `ToolError` if no valid structure is recognized.
341
+
342
+ #### `parse_tool_calls(text: str, ...) -> list[ToolCall]`
343
+ Extracts all tool calls present in the text. Raises `ToolError` if the output contains no extractable invocations.
344
+
345
+ #### `try_parse_tool_call(text: str, ...) -> Optional[ToolCall]`
346
+ Non-raising variant of `parse_tool_call`. Returns `None` if no invocation is detected.
347
+
348
+ #### `try_parse_tool_calls(text: str, ...) -> list[ToolCall]`
349
+ Non-raising variant of `parse_tool_calls`. Returns an empty list `[]` if no invocations are detected.
350
+
351
+ #### `safe_json_loads(s: str, default: Any = None) -> Any`
352
+ Standalone utility for resilient JSON decoding. Resolves trailing commas, single-quoted keys, unquoted boolean/null literals, and unclosed brackets.
353
+
354
+ ---
355
+
356
+ ### Object-Oriented Interface: `ToolParser`
357
+
358
+ The `ToolParser` class allows setting persistent validation rules, allowed tool sets, and parameter mappings across calls:
359
+
360
+ ```python
361
+ from agent_tool_parser import ToolParser, ToolError
362
+
363
+ parser = ToolParser(
364
+ allowed_tools={"read_file", "write_file", "execute_command"},
365
+ tool_aliases={"run": "execute_command", "view": "read_file"},
366
+ param_aliases={"cmd": "command", "file": "path"},
367
+ allow_shell_fallback=True,
368
+ )
369
+
370
+ call = parser.parse("```bash\npytest tests/\n```")
371
+ # Returns ToolCall(name='execute_command', args={'command': 'pytest tests/'})
372
+ ```
373
+
374
+ ---
375
+
376
+ ## Performance Characteristics
377
+
378
+ Measurements conducted on Python 3.12 (AMD EPYC, single execution thread):
379
+
380
+ | Evaluation Scenario | Average Latency | Throughput |
381
+ | :--- | :---: | :---: |
382
+ | DSML Markup Extraction | **0.038 ms** | ~26,000 calls / sec |
383
+ | DeepSeek Delimiter Parsing | **0.024 ms** | ~41,000 calls / sec |
384
+ | Markdown & Malformed JSON Repair | **0.015 ms** | ~65,000 calls / sec |
385
+
386
+ ---
387
+
388
+ ## Automated Testing & CI
389
+
390
+ All pull requests and commits to `main` are continuously validated across runtimes and target architectures in GitHub Actions ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)):
391
+
392
+ - **Python Multi-Version Matrix**: Python 3.9, 3.10, 3.11, 3.12, and 3.13 running `ruff`, `mypy`, and the complete 104-test suite under pure-Python fallback (`AGENT_TOOL_PARSER_NO_EXT=1`).
393
+ - **Rust Core & Multi-Language Bindings**:
394
+ - Rust stable toolchain: `cargo fmt`, `cargo clippy -D warnings`, and 58 unit, integration, and benchmark tests.
395
+ - C-ABI shared library compilation (`libagent_tool_parser_c.so`) and C unit tests.
396
+ - Native Go binding integration tests (`go test -v ./bindings/go/...`).
397
+ - WebAssembly compilation target verification (`wasm32-unknown-unknown` release build).
398
+ - PyO3 native module build and dual-engine differential parity verification (`tests/test_parity.py` with 240+ assertions).
399
+ - **Storage-Conscious CI Architecture**: The entire test matrix runs in ephemeral runner memory with zero artifact storage overhead, preventing billing impact on account storage quotas.
400
+
401
+ ---
402
+
403
+ ## Contributing
404
+
405
+ We welcome contributions to `agent-tool-parser`. Because the project maintains dual implementations (pure-Python reference and compiled Rust core), all pull requests modifying parsing heuristics, format extractors, or cleaner rules must provide synchronized changes across both engines. If full parity is technically infeasible, a comprehensive technical rationale must be provided.
406
+
407
+ See our [**Contributing Guide (CONTRIBUTING.md)**](CONTRIBUTING.md) for full instructions, test commands, and submission checklists.
408
+
409
+ ---
410
+
411
+ ## Security & Execution Disclaimer
412
+
413
+ `agent-tool-parser` is strictly a **passive lexical and structural parser**. It does not validate, authenticate, sandbox, or execute tool calls, shell commands, or arbitrary parameters emitted by language models.
414
+
415
+ - **No Execution Safety Guarantees**: Language models can hallucinate, produce malformed payloads, or be manipulated via adversarial prompt injections. Parsed tool calls and arguments must **never** be executed directly without strict downstream input validation, schema enforcement, authorization checks, and process isolation.
416
+ - **Sandboxing & Privilege Boundaries**: The integrating application, agent framework, and operators are solely responsible for enforcing execution security, sandboxing (e.g., containers, VMs, seccomp/gVisor), rate limits, and human-in-the-loop approvals.
417
+ - **Limitation of Liability**: In accordance with the MIT License, this software is provided **"AS IS"**, without warranty of any kind, express or implied. In no event shall the authors, maintainers, or copyright holders (including the InBoost Team) be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, data loss, unauthorized system access, financial losses, service downtime, or hardware damage) arising in any way out of the use, interpretation, execution, or parsing anomalies of this software.
418
+
419
+ See our full [**Legal & Execution Disclaimer (DISCLAIMER.md)**](DISCLAIMER.md).
420
+
421
+ ---
422
+
423
+ ## License
424
+
425
+ This project is licensed under the [MIT License](LICENSE) - see the [LICENSE](LICENSE) file for details.
426
+
427
+ Copyright (c) 2026 InBoost Team.
428
+
429
+ ---
430
+
431
+ *Maintained by the **InBoost Team**.*
432
+
@@ -0,0 +1,9 @@
1
+ agent_tool_parser/__init__.py,sha256=t9I2z4NFybsNW_enbr8w4pGVcRsck8buGaMnpVa4GK0,1858
2
+ agent_tool_parser/cleaners.py,sha256=tCU9TeU5h0KrN_3mj87OLOmtJ4FiS9s_SYNSSUycxaE,8452
3
+ agent_tool_parser/models.py,sha256=5F4m7Lrt2vRoUIkKmy-QWoGNIdTt5i1Sj0JIkP1g9wU,966
4
+ agent_tool_parser/parser.py,sha256=sJYYF3_lO79aqdAiIDY2z3Ca1BRLSOh5jgVzJqKbgUI,43843
5
+ agent_tool_parser/py.typed,sha256=bWew9mHgMy8LqMu7RuqQXFXLBxh2CRx0dUbSx-3wE48,27
6
+ agent_tool_parser-0.1.0.dist-info/METADATA,sha256=0nHUNzeKPk9BLWnIqWcVIesCuVLrvnt1eX_h_NaAeRs,23443
7
+ agent_tool_parser-0.1.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
8
+ agent_tool_parser-0.1.0.dist-info/licenses/LICENSE,sha256=F6ow7ObLKab1f03q4sQJt0H_2SN4nyQB0PdfeRtFmlY,1069
9
+ agent_tool_parser-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 InBoost Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.