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:
@@ -93,14 +93,16 @@ def inp_in_status(line: str) -> str:
|
||||
return str(f"insert into network.link_initial_settings (link_id, status, setting) values ({sql_literal(link)}, null, {sql_literal(float(value))});")
|
||||
|
||||
|
||||
def inp_out_status(name: str) -> list[str]:
|
||||
def inp_out_status(name: str, version: str = '2') -> list[str]:
|
||||
lines = []
|
||||
objs = read_all(name, 'select link_id as link, status, setting from network.link_initial_settings order by link_id')
|
||||
for obj in objs:
|
||||
link = obj['link']
|
||||
status = obj['status'] if obj['status'] != None else ''
|
||||
setting = obj['setting'] if obj['setting'] != None else ''
|
||||
if status != '':
|
||||
# EPANET 2 valves are active at their configured setting by default.
|
||||
# ACTIVE is an internal state, not a legal [STATUS] keyword in v2.
|
||||
if status != '' and not (version == '2' and status.upper() == LINK_STATUS_ACTIVE):
|
||||
lines.append(f'{link} {status}')
|
||||
if setting != '':
|
||||
lines.append(f'{link} {setting}')
|
||||
|
||||
Reference in New Issue
Block a user