warlockcode-wartools-ai 0.1.1__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.
- warlockcode_wartools_ai/__init__.py +21 -0
- warlockcode_wartools_ai/_generated/__init__.py +1 -0
- warlockcode_wartools_ai/_generated/shared_data.py +5 -0
- warlockcode_wartools_ai/_lib/__init__.py +0 -0
- warlockcode_wartools_ai/_lib/canonical.py +96 -0
- warlockcode_wartools_ai/_lib/common.py +54 -0
- warlockcode_wartools_ai/_lib/errors.py +9 -0
- warlockcode_wartools_ai/_lib/html.py +32 -0
- warlockcode_wartools_ai/_lib/net.py +132 -0
- warlockcode_wartools_ai/_lib/patchapply.py +144 -0
- warlockcode_wartools_ai/_lib/sandbox.py +42 -0
- warlockcode_wartools_ai/_lib/textkit.py +59 -0
- warlockcode_wartools_ai/_lib/timekit.py +59 -0
- warlockcode_wartools_ai/_lib/udiff.py +117 -0
- warlockcode_wartools_ai/_lib/unicode.py +93 -0
- warlockcode_wartools_ai/handlers/__init__.py +43 -0
- warlockcode_wartools_ai/handlers/catalog.py +27 -0
- warlockcode_wartools_ai/handlers/context.py +35 -0
- warlockcode_wartools_ai/handlers/crypto.py +61 -0
- warlockcode_wartools_ai/handlers/csv.py +132 -0
- warlockcode_wartools_ai/handlers/doc.py +77 -0
- warlockcode_wartools_ai/handlers/doc_detect.py +55 -0
- warlockcode_wartools_ai/handlers/encoding.py +57 -0
- warlockcode_wartools_ai/handlers/fs.py +110 -0
- warlockcode_wartools_ai/handlers/json.py +220 -0
- warlockcode_wartools_ai/handlers/kv.py +103 -0
- warlockcode_wartools_ai/handlers/math.py +223 -0
- warlockcode_wartools_ai/handlers/scratchpad.py +82 -0
- warlockcode_wartools_ai/handlers/security.py +50 -0
- warlockcode_wartools_ai/handlers/state.py +40 -0
- warlockcode_wartools_ai/handlers/text.py +183 -0
- warlockcode_wartools_ai/handlers/text_patch.py +24 -0
- warlockcode_wartools_ai/handlers/text_rerank.py +50 -0
- warlockcode_wartools_ai/handlers/time.py +103 -0
- warlockcode_wartools_ai/handlers/time_business.py +109 -0
- warlockcode_wartools_ai/handlers/trace.py +33 -0
- warlockcode_wartools_ai/handlers/validate.py +58 -0
- warlockcode_wartools_ai/handlers/web.py +81 -0
- warlockcode_wartools_ai/mcp.py +106 -0
- warlockcode_wartools_ai/models.py +118 -0
- warlockcode_wartools_ai/py.typed +0 -0
- warlockcode_wartools_ai/registry.py +196 -0
- warlockcode_wartools_ai/runtime/__init__.py +4 -0
- warlockcode_wartools_ai/runtime/pipeline.py +149 -0
- warlockcode_wartools_ai/runtime/policy_store.py +63 -0
- warlockcode_wartools_ai/stores.py +267 -0
- warlockcode_wartools_ai/tools.py +66 -0
- warlockcode_wartools_ai-0.1.1.dist-info/METADATA +34 -0
- warlockcode_wartools_ai-0.1.1.dist-info/RECORD +52 -0
- warlockcode_wartools_ai-0.1.1.dist-info/WHEEL +5 -0
- warlockcode_wartools_ai-0.1.1.dist-info/entry_points.txt +2 -0
- warlockcode_wartools_ai-0.1.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Facade over the per-domain handler registry (see handlers/).
|
|
2
|
+
|
|
3
|
+
Keeps the historical public surface: dispatch_tool, ToolExecutionError and the
|
|
4
|
+
private helper aliases that other modules may import.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from typing import Any, Dict, List
|
|
9
|
+
|
|
10
|
+
from ._lib.common import clean_number as _clean_number
|
|
11
|
+
from ._lib.common import format_in_timezone as _format_in_timezone
|
|
12
|
+
from ._lib.common import parse_iso_datetime as _parse_iso_datetime
|
|
13
|
+
from ._lib.errors import ToolExecutionError
|
|
14
|
+
from ._lib.html import html_to_markdown as _html_to_markdown
|
|
15
|
+
from ._lib.html import strip_html as _strip_html
|
|
16
|
+
from ._lib.net import _NoAutoRedirectHandler, _RedirectStop
|
|
17
|
+
from ._lib.net import domain_matches as _domain_matches
|
|
18
|
+
from ._lib.net import is_private_ip as _is_private_ip
|
|
19
|
+
from ._lib.net import safe_fetch_text as _safe_fetch_text
|
|
20
|
+
from ._lib.sandbox import resolve_sandbox_path as _resolve_sandbox_path
|
|
21
|
+
from .handlers import REGISTRY
|
|
22
|
+
from .handlers.context import ToolContext
|
|
23
|
+
from .handlers.csv import parse_csv_lines as _parse_csv_lines
|
|
24
|
+
from .handlers.json import query_json_path as _query_json_path
|
|
25
|
+
from .handlers.json import validate_json_schema_simple as _validate_json_schema_simple
|
|
26
|
+
from .handlers.math import evaluate_math_ast as _evaluate_math_ast
|
|
27
|
+
from .handlers.text import luhn_valid as _luhn_valid
|
|
28
|
+
from .models import SecurityConfig
|
|
29
|
+
from .stores import KvStore, TraceSink
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"ToolExecutionError",
|
|
33
|
+
"dispatch_tool",
|
|
34
|
+
"_safe_fetch_text",
|
|
35
|
+
"_resolve_sandbox_path",
|
|
36
|
+
"_is_private_ip",
|
|
37
|
+
"_domain_matches",
|
|
38
|
+
"_html_to_markdown",
|
|
39
|
+
"_strip_html",
|
|
40
|
+
"_format_in_timezone",
|
|
41
|
+
"_parse_iso_datetime",
|
|
42
|
+
"_evaluate_math_ast",
|
|
43
|
+
"_clean_number",
|
|
44
|
+
"_parse_csv_lines",
|
|
45
|
+
"_luhn_valid",
|
|
46
|
+
"_validate_json_schema_simple",
|
|
47
|
+
"_query_json_path",
|
|
48
|
+
"_RedirectStop",
|
|
49
|
+
"_NoAutoRedirectHandler",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def dispatch_tool(
|
|
54
|
+
tool_name: str,
|
|
55
|
+
inp: Dict[str, Any],
|
|
56
|
+
security: SecurityConfig,
|
|
57
|
+
store: KvStore,
|
|
58
|
+
trace_sink: TraceSink,
|
|
59
|
+
catalog: List[Dict[str, Any]],
|
|
60
|
+
active_tools: set[str],
|
|
61
|
+
) -> Any:
|
|
62
|
+
handler = REGISTRY.get(tool_name)
|
|
63
|
+
if handler is None:
|
|
64
|
+
raise ToolExecutionError("NOT_IMPLEMENTED", f'Handler for "{tool_name}" is not wired.')
|
|
65
|
+
ctx = ToolContext.build(inp, security, store, trace_sink, catalog, active_tools)
|
|
66
|
+
return handler(ctx)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: warlockcode-wartools-ai
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Modular, Default-Off tool runtime and MCP server for AI agents.
|
|
5
|
+
Author: WarlockCode
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: pydantic>=2.0
|
|
10
|
+
|
|
11
|
+
# `warlockcode-wartools-ai`
|
|
12
|
+
|
|
13
|
+
Modular, Default-Off tool runtime and MCP server for Python >= 3.10.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install warlockcode-wartools-ai
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start (Default-Off)
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from warlockcode_wartools_ai import WarTools, JsonFileKvStore, SecurityConfig
|
|
25
|
+
|
|
26
|
+
kit = WarTools.create(
|
|
27
|
+
preset="none",
|
|
28
|
+
enable=["time.now", "kv.*"],
|
|
29
|
+
security=SecurityConfig(fs_root="./workspace", http_allow_domains=["api.github.com"]),
|
|
30
|
+
store=JsonFileKvStore("./.wartools-store.json"),
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
envelope = kit.execute("time.now", {"timezone": "America/Bogota"})
|
|
34
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
warlockcode_wartools_ai/__init__.py,sha256=HFYPuMgrs-Uq6ZBtv7wim0qf7ABrxLOTLK2PXm0NXFo,600
|
|
2
|
+
warlockcode_wartools_ai/mcp.py,sha256=MY4NjXJzY53yd2mee96rZ0RufP-kJPvX5FbweTZlKBI,4340
|
|
3
|
+
warlockcode_wartools_ai/models.py,sha256=wj5RaU-_zpzYcRwTUhd9UWZFi7dwSDTn3vFUcDJnBRw,4915
|
|
4
|
+
warlockcode_wartools_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
warlockcode_wartools_ai/registry.py,sha256=5-aDSDvztybnnU0YKvjP8v-b97xf-VxLqmlUcNO9B90,8256
|
|
6
|
+
warlockcode_wartools_ai/stores.py,sha256=m3gKGqzjQDgmLsOxED5yXqPmSXJdpVWMXnW168ap370,9941
|
|
7
|
+
warlockcode_wartools_ai/tools.py,sha256=0HFxbP6esV4Pg9Ks7jzBMt2B4VjUjK7Itg-xrPuDGSg,2338
|
|
8
|
+
warlockcode_wartools_ai/_generated/__init__.py,sha256=XrUNVDSB91VRPkqlvCxpkUZZDwCaPmAq5SLuszn4P0c,83
|
|
9
|
+
warlockcode_wartools_ai/_generated/shared_data.py,sha256=rFHQAodNebDqkdTVQms6FwdYIR8RYKDGLDAt_7SEPzg,219
|
|
10
|
+
warlockcode_wartools_ai/_lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
warlockcode_wartools_ai/_lib/canonical.py,sha256=_Lb20PyuLklEv6QRFLy33u1wNgnHgmAa1_wGEL4qM4E,3386
|
|
12
|
+
warlockcode_wartools_ai/_lib/common.py,sha256=h8gEc3nFZJrPlEXKy1mq6-gS1qqDJCcXdt3wwGXf4-k,1725
|
|
13
|
+
warlockcode_wartools_ai/_lib/errors.py,sha256=CHdpkuEWrWW4ZtzVvrn41PgTD3CQTw9bnw1-he0LpHA,286
|
|
14
|
+
warlockcode_wartools_ai/_lib/html.py,sha256=69K3Sfqux6eUbeW2roWCRrOaAcXXVQmUIm7fKkTdkGU,1661
|
|
15
|
+
warlockcode_wartools_ai/_lib/net.py,sha256=GpIhd7T4mJjvWdVqqKwzvQhCDq-jqbCNjjtLNiQTA5s,5618
|
|
16
|
+
warlockcode_wartools_ai/_lib/patchapply.py,sha256=aWrjHaSXyGXDa7dUj0VgAI50Kw8JgvG6g8ugS-sjRec,4369
|
|
17
|
+
warlockcode_wartools_ai/_lib/sandbox.py,sha256=ohJYZQwIkX-uYtp7yRIYWlO4IxoSauuPAS6QGTZ9__U,2075
|
|
18
|
+
warlockcode_wartools_ai/_lib/textkit.py,sha256=dxA-ZaS1-1EGsSVxheop4OGzL0NQ3oElAVfu8FwgN74,1711
|
|
19
|
+
warlockcode_wartools_ai/_lib/timekit.py,sha256=70_lGHq8Aph0viZcVJPROZu1pI7e-sQmtJ6ktDErCsQ,1664
|
|
20
|
+
warlockcode_wartools_ai/_lib/udiff.py,sha256=5PKyVVPLVNfsn6zgM46Gqac8jTKiWg5mg4ax0pYIdOI,3690
|
|
21
|
+
warlockcode_wartools_ai/_lib/unicode.py,sha256=ZOHoq39X76Df9N-AesTI4TGkHKNN8KKhKo7eekXwQTA,2574
|
|
22
|
+
warlockcode_wartools_ai/handlers/__init__.py,sha256=h_Qqg1YEXqtsGyvQ7NO1yAtdgcg_Y5oXWx3AqOsiLDc,1534
|
|
23
|
+
warlockcode_wartools_ai/handlers/catalog.py,sha256=d2iQf56UTj4D6A4GAMmo495I_QcMhmjZ5-FMBw4y42U,1013
|
|
24
|
+
warlockcode_wartools_ai/handlers/context.py,sha256=jKJZohcZuhmvNzW_oLp9cX02AiKWUQGYUs6yWx38IAI,905
|
|
25
|
+
warlockcode_wartools_ai/handlers/crypto.py,sha256=q2n_UMPk2ewwwh5wiQflvMC_QdWhRuM5t-Fi5erml_w,2168
|
|
26
|
+
warlockcode_wartools_ai/handlers/csv.py,sha256=cqt7gwTkTc42K8GGNRMbG6OQjotAEdcOH8gQhw3zqPE,5550
|
|
27
|
+
warlockcode_wartools_ai/handlers/doc.py,sha256=raKqKfUO9SxG5zxuCI9HlupvlHKLiV6SrfNEax3ZN3g,3084
|
|
28
|
+
warlockcode_wartools_ai/handlers/doc_detect.py,sha256=unFbfHBbtam1sqA_ZbcYZQkqlthDBtGjbREaFUGtFNY,2362
|
|
29
|
+
warlockcode_wartools_ai/handlers/encoding.py,sha256=_ojLApFxVNWbgWlIbSvl9yrkSOeqv0xN231xQzdETyA,2144
|
|
30
|
+
warlockcode_wartools_ai/handlers/fs.py,sha256=0KbmbF2aadS-blANhOxlzjATRKbr15n91Wy2nScyQDQ,4773
|
|
31
|
+
warlockcode_wartools_ai/handlers/json.py,sha256=yJbc6jmH10i3IvKHosqlViQP6eWN_j9S9BCcZ8_Vycc,8216
|
|
32
|
+
warlockcode_wartools_ai/handlers/kv.py,sha256=OiJQldrwOx0GZe3LkAmynojnsJHpkRkVgCu2_xdc1iI,4003
|
|
33
|
+
warlockcode_wartools_ai/handlers/math.py,sha256=HJ52nHzgZB6PPLiO8t6p6GDOC6--Svmy4felUbJKzeo,8084
|
|
34
|
+
warlockcode_wartools_ai/handlers/scratchpad.py,sha256=xu83aP1_7avzA0CSZD3wlE57nX3A1MwGIq7R6dxUF2k,3482
|
|
35
|
+
warlockcode_wartools_ai/handlers/security.py,sha256=PMd9XFRcp3teBm7vPNsp336Qhhk4EI6yAU3VPymypIw,2118
|
|
36
|
+
warlockcode_wartools_ai/handlers/state.py,sha256=nb_s8AR9T-A5zmmjQfUbYXXpDWyaEB3GHvcRZ0LN37k,1379
|
|
37
|
+
warlockcode_wartools_ai/handlers/text.py,sha256=mgISWlQBpohlGfFowvnk3PR4zaY9q-Rr60cg_rCuDQ4,7058
|
|
38
|
+
warlockcode_wartools_ai/handlers/text_patch.py,sha256=vFkt3XRJXgPxapz7lTr-FZ1vw-AC8GXZR42BJihD7ik,918
|
|
39
|
+
warlockcode_wartools_ai/handlers/text_rerank.py,sha256=Ou0OYRmiVtBa7S_KjH8bm-im5jwNd36bjKY9OSBTuj8,2002
|
|
40
|
+
warlockcode_wartools_ai/handlers/time.py,sha256=rVB-nFOnU6HazDCXjDrXhsOdxvUMp4-Kc_S-iQTGiqc,3888
|
|
41
|
+
warlockcode_wartools_ai/handlers/time_business.py,sha256=q2wlQGJISLPmH3ZUl-orDxdDc8-DVVHW1fA30GzhjzM,3567
|
|
42
|
+
warlockcode_wartools_ai/handlers/trace.py,sha256=yR09cVwhV6ixiksD7EHZvnkmBbAmnLheyNlN9CCa03c,1067
|
|
43
|
+
warlockcode_wartools_ai/handlers/validate.py,sha256=f1hZ2tWYTTDj8nK1mGdFGZRZayEgM4dsRD2fyYhV4NE,2672
|
|
44
|
+
warlockcode_wartools_ai/handlers/web.py,sha256=E9k3iNdXFBcyoYS9gr3u1KtdFvBpY2bnYgnrgQ-DlKY,3501
|
|
45
|
+
warlockcode_wartools_ai/runtime/__init__.py,sha256=lTMPRksEAyWSUWD5tIU3FURrT6xTBagp19jJIVv2Kgc,176
|
|
46
|
+
warlockcode_wartools_ai/runtime/pipeline.py,sha256=iky3mTG5zQIfYTMvOOWgnEGTwaikIN7Jh-UOewD8Y10,6146
|
|
47
|
+
warlockcode_wartools_ai/runtime/policy_store.py,sha256=hkFYS5oej_hKQlEka0IDdGlOKxOF7MFDooyKffaj7n8,2198
|
|
48
|
+
warlockcode_wartools_ai-0.1.1.dist-info/METADATA,sha256=ccp1u7OfS3nKElt54GM5EcgUxV-cxruTetjXqBwMNlM,844
|
|
49
|
+
warlockcode_wartools_ai-0.1.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
50
|
+
warlockcode_wartools_ai-0.1.1.dist-info/entry_points.txt,sha256=s4rCawbbQOO-hrZnLC0D-fajgX0gAdTdOrjZ0Q0W-Zg,65
|
|
51
|
+
warlockcode_wartools_ai-0.1.1.dist-info/top_level.txt,sha256=c9Nge0daSP6bCNHYLYgVcA-XUEFQwQ0dlWVOf_H5cLU,24
|
|
52
|
+
warlockcode_wartools_ai-0.1.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
warlockcode_wartools_ai
|