feat: import core schemas from hub-core

This commit is contained in:
2026-06-07 01:20:57 +02:00
parent 093b2b14ae
commit 70b264a37a
5 changed files with 49 additions and 57 deletions

View File

@@ -1,30 +1,7 @@
import uuid
from datetime import datetime
from hub_core.schemas.agent_message import MessageCreate, MessageRead, MessageReply
from pydantic import BaseModel, ConfigDict
class MessageCreate(BaseModel):
from_agent: str
to_agent: str
subject: str
body: str
thread_id: uuid.UUID | None = None
class MessageReply(BaseModel):
from_agent: str
body: str
class MessageRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
from_agent: str
to_agent: str
subject: str
body: str
thread_id: uuid.UUID | None = None
read_at: datetime | None = None
archived_at: datetime | None = None
created_at: datetime
__all__ = [
"MessageCreate",
"MessageRead",
"MessageReply",
]

View File

@@ -1,29 +1,7 @@
from pydantic import BaseModel
from hub_core.schemas.doi import DoICriterion, DoIReport, DoISummaryEntry
class DoICriterion(BaseModel):
id: str
label: str
tier: str
status: str # pass | fail | warn | skip
detail: str = ""
class DoIReport(BaseModel):
repo_slug: str
tier: str # none | core | standard | full
core_pass: bool
standard_pass: bool
full_pass: bool
criteria: list[DoICriterion] = []
checked_at: str
class DoISummaryEntry(BaseModel):
repo_slug: str
domain_slug: str | None
tier: str
core_pass: bool
standard_pass: bool
full_pass: bool
checked_at: str
__all__ = [
"DoICriterion",
"DoIReport",
"DoISummaryEntry",
]

View File

@@ -18,6 +18,7 @@ dependencies = [
"llm-connect",
"pyyaml>=6.0.3",
"nats-py>=2.7.0",
"hub-core",
]
[project.scripts]
@@ -34,6 +35,7 @@ artifacts = ["custodian_cli.py", "statehub_register.py"]
[tool.uv.sources]
llm-connect = { path = "/home/worsch/llm-connect", editable = true }
hub-core = { path = "/home/worsch/hub-core", editable = true }
[tool.pytest.ini_options]
asyncio_mode = "auto"

View File

@@ -0,0 +1,12 @@
from api.schemas.agent_message import MessageCreate
from api.schemas.doi import DoIReport
from hub_core.schemas.agent_message import MessageCreate as CoreMessageCreate
from hub_core.schemas.doi import DoIReport as CoreDoIReport
def test_state_hub_reexports_core_message_schema() -> None:
assert MessageCreate is CoreMessageCreate
def test_state_hub_reexports_core_doi_schema() -> None:
assert DoIReport is CoreDoIReport

23
uv.lock generated
View File

@@ -530,6 +530,27 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960 },
]
[[package]]
name = "hub-core"
version = "0.1.0"
source = { editable = "../hub-core" }
dependencies = [
{ name = "fastapi" },
{ name = "fastmcp" },
{ name = "httpx" },
{ name = "pydantic" },
{ name = "sqlalchemy", extra = ["asyncio"] },
]
[package.metadata]
requires-dist = [
{ name = "fastapi", specifier = ">=0.115.0" },
{ name = "fastmcp", specifier = ">=2.0.0" },
{ name = "httpx", specifier = ">=0.28.0" },
{ name = "pydantic", specifier = ">=2.10.0" },
{ name = "sqlalchemy", extras = ["asyncio"], specifier = ">=2.0.0" },
]
[[package]]
name = "idna"
version = "3.11"
@@ -1443,6 +1464,7 @@ dependencies = [
{ name = "fastapi" },
{ name = "fastmcp" },
{ name = "httpx" },
{ name = "hub-core" },
{ name = "llm-connect" },
{ name = "nats-py" },
{ name = "psycopg2-binary" },
@@ -1468,6 +1490,7 @@ requires-dist = [
{ name = "fastapi", specifier = ">=0.115.0" },
{ name = "fastmcp", specifier = ">=2.0.0" },
{ name = "httpx", specifier = ">=0.28.0" },
{ name = "hub-core", editable = "../hub-core" },
{ name = "llm-connect", editable = "../llm-connect" },
{ name = "nats-py", specifier = ">=2.7.0" },
{ name = "psycopg2-binary", specifier = ">=2.9.0" },