Add hub-core package, docs, and State Hub integration scaffold

Extract the first reusable slice (models, schemas, routers, MCP, migrations)
from state-hub with INTENT/SCOPE, agent instructions, workplan, and aligned
inter_hub capability registry index.
This commit is contained in:
2026-06-16 02:39:36 +02:00
parent d3ee203a3a
commit 986ac4d40b
52 changed files with 4085 additions and 3 deletions

31
tests/test_mcp.py Normal file
View File

@@ -0,0 +1,31 @@
import asyncio
from hub_core.mcp import HubCoreMCPServer
def test_mcp_base_server_constructs_without_registering_tools() -> None:
server = HubCoreMCPServer(
name="test-hub",
api_base="http://127.0.0.1:9999/",
register_tools=False,
)
assert server.api_base == "http://127.0.0.1:9999"
assert server.mcp.name == "test-hub"
assert server._clean({"a": None, "b": 1}) == {"b": 1}
def test_mcp_base_server_registers_orientation_doi_and_fos10_tools() -> None:
server = HubCoreMCPServer(name="test-hub", api_base="http://127.0.0.1:9999")
tools = asyncio.run(server.mcp.list_tools())
names = {tool.name for tool in tools}
assert {
"get_state_summary",
"get_domain_summary",
"check_repo_doi",
"get_doi_summary",
"get_risks",
"get_alerts",
} <= names