feat(server): integrate MCP queries and investigation messaging
Add project-bound OAuth MCP queries and controlled analysis with scoped evidence, limits, timeouts and a nearby-model spatial query using EPSG:4326 inputs. Default nearby searches to 200 meters and five results. Integrate investigation messaging/presentation, health/readiness and typed history; remove duplicate web search and fix online simulation and compressed baseline writes. Include project migrations 023-025; keep local credentials and demo seeding excluded. Validation: 319 focused pytest checks; real PostGIS temporary-table regression; read-only Jinqian bridge radius comparison; cross-language MCP discovery/calls.
This commit is contained in:
@@ -34,13 +34,15 @@ class ScadaRepository:
|
||||
device_ids: List[str],
|
||||
start_time: datetime,
|
||||
end_time: datetime,
|
||||
*, row_limit: int | None = None,
|
||||
) -> List[dict]:
|
||||
async with conn.cursor() as cur:
|
||||
await cur.execute(
|
||||
f"SELECT {ScadaRepository.RESULT_COLUMNS} FROM scada.measurements "
|
||||
"WHERE device_id = ANY(%s) "
|
||||
"AND time >= %s AND time <= %s ORDER BY device_id, time",
|
||||
(device_ids, start_time, end_time),
|
||||
"AND time >= %s AND time <= %s ORDER BY device_id, time"
|
||||
+ (" LIMIT %s" if row_limit is not None else ""),
|
||||
(device_ids, start_time, end_time) + ((row_limit,) if row_limit is not None else ()),
|
||||
)
|
||||
return await cur.fetchall()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user