feat(agent-superset): extend SupersetClient with agent-critical methods + DDL/DML guard + tests (126 passed)
Ported from mcp-superset research module, integrated into existing async SupersetClient: New mixins (4 files): - safety.py: DDL/DML guard (13 keywords), comment/string stripping, viz_type validation - _sql_lab.py: execute_sql, format_sql, results, estimate, CSV export, query history - _saved_queries.py: saved queries CRUD (5 methods) - _audit.py: permissions audit matrix (user × dashboard × dataset × RLS) Extended mixins (4 files): - _dashboards_write.py: +create, +update (general), +copy, +publish, +unpublish - _dashboards_crud.py: +standalone get_dashboard_charts/datasets, +get_dashboard - _datasets.py: +create, +delete, +duplicate, +refresh_schema, +get_or_create, +export/import - _databases.py: +update, +test_connection, +schemas/tables/catalogs, +validate_sql, +select_star, +table_metadata FastAPI proxy (2 files): - agent_superset.py (284L): SQL Lab + Dashboards/Datasets write endpoints - agent_superset_explore.py (240L): DB explore + Audit + Saved Queries endpoints Agent tools (2 files): - tools.py: +7 LangChain @tools (24 total), intent-routing keywords - _tool_resolver.py: updated SAFE/GUARDED/FAST_CONFIRM classification sets Tests (3 files, 126 tests): - test_superset_safety.py (51): DDL/DML bypass/legitimate/safe scenarios - test_superset_extended.py (42): all mixin methods with mock AsyncAPIClient - test_superset_tools.py (33): agent tool registration, intent matching, @tool .ainvoke()
This commit is contained in:
@@ -33,6 +33,8 @@ from .api.routes import (
|
||||
admin,
|
||||
admin_api_keys,
|
||||
agent_conversations,
|
||||
agent_superset,
|
||||
agent_superset_explore,
|
||||
assistant,
|
||||
clean_release,
|
||||
clean_release_v2,
|
||||
@@ -403,6 +405,8 @@ app.include_router(reports.router)
|
||||
app.include_router(assistant.router, prefix="/api/assistant", tags=["Assistant"])
|
||||
app.include_router(agent_conversations.agent_router, tags=["Agent"])
|
||||
app.include_router(agent_conversations.router, tags=["Assistant"])
|
||||
app.include_router(agent_superset.router, tags=["Agent Superset"])
|
||||
app.include_router(agent_superset_explore.router, tags=["Agent Superset"])
|
||||
app.include_router(clean_release.router)
|
||||
app.include_router(clean_release_v2.router)
|
||||
app.include_router(profile.router)
|
||||
|
||||
Reference in New Issue
Block a user