spice-mcp 0.1.1__py3-none-any.whl → 0.1.3__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.
- spice_mcp/adapters/dune/__init__.py +4 -2
- spice_mcp/adapters/dune/cache.py +2 -34
- spice_mcp/adapters/dune/extract.py +33 -631
- spice_mcp/adapters/dune/typing_utils.py +8 -1
- spice_mcp/adapters/spellbook/__init__.py +6 -0
- spice_mcp/adapters/spellbook/explorer.py +313 -0
- spice_mcp/config.py +1 -1
- spice_mcp/core/models.py +0 -8
- spice_mcp/core/ports.py +0 -15
- spice_mcp/mcp/server.py +321 -135
- spice_mcp/mcp/tools/base.py +1 -1
- spice_mcp/mcp/tools/execute_query.py +48 -59
- {spice_mcp-0.1.1.dist-info → spice_mcp-0.1.3.dist-info}/METADATA +18 -13
- {spice_mcp-0.1.1.dist-info → spice_mcp-0.1.3.dist-info}/RECORD +17 -17
- spice_mcp/mcp/tools/sui_package_overview.py +0 -56
- spice_mcp/service_layer/sui_service.py +0 -131
- {spice_mcp-0.1.1.dist-info → spice_mcp-0.1.3.dist-info}/WHEEL +0 -0
- {spice_mcp-0.1.1.dist-info → spice_mcp-0.1.3.dist-info}/entry_points.txt +0 -0
- {spice_mcp-0.1.1.dist-info → spice_mcp-0.1.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
This module provides a thin façade used by the new service layer while
|
|
4
4
|
keeping the battle-tested logic that the original spice client offered.
|
|
5
|
+
|
|
6
|
+
Only synchronous interfaces are exposed.
|
|
5
7
|
"""
|
|
6
8
|
|
|
7
9
|
from . import urls # re-export for callers needing low-level helpers
|
|
8
|
-
from .extract import
|
|
10
|
+
from .extract import query # noqa: F401
|
|
9
11
|
|
|
10
|
-
__all__ = ["query", "
|
|
12
|
+
__all__ = ["query", "urls"]
|
spice_mcp/adapters/dune/cache.py
CHANGED
|
@@ -51,39 +51,7 @@ def load_from_cache(
|
|
|
51
51
|
return None, execution
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
async
|
|
55
|
-
execute_kwargs: _extract.ExecuteKwargs,
|
|
56
|
-
result_kwargs: _extract.RetrievalKwargs,
|
|
57
|
-
output_kwargs: _extract.OutputKwargs,
|
|
58
|
-
) -> tuple[
|
|
59
|
-
pl.DataFrame | tuple[pl.DataFrame, Execution] | None, Execution | None
|
|
60
|
-
]:
|
|
61
|
-
# get latest execution
|
|
62
|
-
execution = await _extract.async_get_latest_execution(execute_kwargs)
|
|
63
|
-
if execution is None:
|
|
64
|
-
return None, None
|
|
65
|
-
|
|
66
|
-
# build cache path
|
|
67
|
-
cache_path = _build_cache_path(
|
|
68
|
-
execution=execution,
|
|
69
|
-
execute_kwargs=execute_kwargs,
|
|
70
|
-
result_kwargs=result_kwargs,
|
|
71
|
-
cache_dir=output_kwargs['cache_dir'],
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
# load cache result
|
|
75
|
-
if os.path.exists(cache_path):
|
|
76
|
-
import polars as pl
|
|
77
|
-
|
|
78
|
-
if result_kwargs['verbose']:
|
|
79
|
-
print('loading dune query result from cache')
|
|
80
|
-
df = await pl.scan_parquet(cache_path).collect_async()
|
|
81
|
-
if output_kwargs['include_execution']:
|
|
82
|
-
return (df, execution), execution
|
|
83
|
-
else:
|
|
84
|
-
return df, execution
|
|
85
|
-
else:
|
|
86
|
-
return None, execution
|
|
54
|
+
## Removed async cache loader; synchronous load_from_cache should be used exclusively.
|
|
87
55
|
|
|
88
56
|
|
|
89
57
|
def save_to_cache(
|
|
@@ -113,7 +81,7 @@ def save_to_cache(
|
|
|
113
81
|
# save to cache
|
|
114
82
|
tmp_path = (
|
|
115
83
|
cache_path + '_tmp_' + secrets.token_hex(8)
|
|
116
|
-
) # add
|
|
84
|
+
) # add tmp suffix to avoid conflicts during writes
|
|
117
85
|
df.write_parquet(tmp_path)
|
|
118
86
|
shutil.move(tmp_path, cache_path)
|
|
119
87
|
|