amfs-http-server 0.3.5__tar.gz → 0.3.6__tar.gz
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.
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/PKG-INFO +1 -1
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/pyproject.toml +1 -1
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/server.py +35 -3
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/.gitignore +0 -0
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/__init__.py +0 -0
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/auth.py +0 -0
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/models.py +0 -0
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/openrouter_proxy.py +0 -0
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/pro_provider.py +0 -0
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/pro_proxy.py +0 -0
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/sse.py +0 -0
- {amfs_http_server-0.3.5 → amfs_http_server-0.3.6}/src/amfs_http/tenant_middleware.py +0 -0
|
@@ -66,6 +66,27 @@ from amfs_http.sse import SSEManager
|
|
|
66
66
|
|
|
67
67
|
logger = logging.getLogger(__name__)
|
|
68
68
|
|
|
69
|
+
|
|
70
|
+
def _server_version() -> str:
|
|
71
|
+
"""Return the deployed amfs-http-server package version.
|
|
72
|
+
|
|
73
|
+
Sourced from installed package metadata so it changes on every release —
|
|
74
|
+
unlike the per-entry ``amfs_version`` schema tag. This is the value to use
|
|
75
|
+
when telling deploys/revisions apart.
|
|
76
|
+
"""
|
|
77
|
+
try:
|
|
78
|
+
from importlib.metadata import version
|
|
79
|
+
|
|
80
|
+
return version("amfs-http-server")
|
|
81
|
+
except Exception:
|
|
82
|
+
return "unknown"
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# Set by the deploy pipeline (e.g. the git SHA) so a running revision is
|
|
86
|
+
# identifiable even between version bumps. Empty when not provided.
|
|
87
|
+
_BUILD_SHA = os.environ.get("AMFS_BUILD_SHA", "")
|
|
88
|
+
_SCHEMA_VERSION = MemoryEntry.model_fields["amfs_version"].default
|
|
89
|
+
|
|
69
90
|
# ── Async adapter (hot-path, non-blocking) ──────────────────────────
|
|
70
91
|
_async_adapter = None # AsyncPostgresAdapter | None, set in lifespan
|
|
71
92
|
|
|
@@ -94,7 +115,7 @@ async def _lifespan(application: FastAPI): # noqa: ARG001
|
|
|
94
115
|
app = FastAPI(
|
|
95
116
|
title="AMFS HTTP API",
|
|
96
117
|
description="Agent Memory File System — REST API with SSE support",
|
|
97
|
-
version=
|
|
118
|
+
version=_server_version(),
|
|
98
119
|
lifespan=_lifespan,
|
|
99
120
|
)
|
|
100
121
|
|
|
@@ -316,14 +337,25 @@ def _ensure_agent_owner(
|
|
|
316
337
|
# ──────────────────────────────────────────────────────────────────────
|
|
317
338
|
|
|
318
339
|
|
|
340
|
+
def _health_payload() -> dict[str, str]:
|
|
341
|
+
payload = {
|
|
342
|
+
"status": "ok",
|
|
343
|
+
"version": _server_version(), # deploy/package version — changes per release
|
|
344
|
+
"schema_version": _SCHEMA_VERSION, # per-entry MemoryEntry schema tag
|
|
345
|
+
}
|
|
346
|
+
if _BUILD_SHA:
|
|
347
|
+
payload["build"] = _BUILD_SHA
|
|
348
|
+
return payload
|
|
349
|
+
|
|
350
|
+
|
|
319
351
|
@app.get("/health")
|
|
320
352
|
async def health() -> dict[str, str]:
|
|
321
|
-
return
|
|
353
|
+
return _health_payload()
|
|
322
354
|
|
|
323
355
|
|
|
324
356
|
@app.get("/api/v1/health")
|
|
325
357
|
async def health_v1() -> dict[str, str]:
|
|
326
|
-
return
|
|
358
|
+
return _health_payload()
|
|
327
359
|
|
|
328
360
|
|
|
329
361
|
@app.get("/api/v1/auth/whoami")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|