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:
@@ -30,6 +30,11 @@ WORK_ORDER_FIELD_LABELS = {
|
||||
"assignee": "负责人", "scheduled_at": "预约时间", "location": "位置",
|
||||
"scenario_code": "场景编号", "feedback_requirements": "回执要求",
|
||||
}
|
||||
WORK_ORDER_CREATED_DETAILS = {
|
||||
"general": "预约工单已创建。",
|
||||
"water_quality_complaint": "投诉工单已创建。",
|
||||
"burst_report": "爆管上报工单已创建。",
|
||||
}
|
||||
|
||||
|
||||
class PostgresStore:
|
||||
@@ -351,7 +356,8 @@ class PostgresStore:
|
||||
"origin": "synthetic", "created_at": now, "updated_at": now,
|
||||
"created_by": who.user_id, "updated_by": who.user_id,
|
||||
"activity": [{"sequence": 1, "occurred_at": now, "actor": who.user_id,
|
||||
"kind": "created", "title": "工单创建", "detail": "预约工单已创建。"}],
|
||||
"kind": "created", "title": "工单创建",
|
||||
"detail": WORK_ORDER_CREATED_DETAILS[command.work_order_type]}],
|
||||
}
|
||||
return self._save_work_order(conn, who, document)
|
||||
return self._mutate(who, "create_work_order", command, write)
|
||||
@@ -380,8 +386,10 @@ class PostgresStore:
|
||||
if command.progress_note:
|
||||
title, detail, kind = "现场反馈", command.progress_note, "feedback"
|
||||
elif changed_fields:
|
||||
field_labels = WORK_ORDER_FIELD_LABELS | ({"scheduled_at": "发生时间"}
|
||||
if document["work_order_type"] != "general" else {})
|
||||
title, detail, kind = "工单信息更新", "更新了" + "、".join(
|
||||
WORK_ORDER_FIELD_LABELS.get(field, field) for field in changed_fields
|
||||
field_labels.get(field, field) for field in changed_fields
|
||||
) + "。", "updated"
|
||||
else:
|
||||
title, detail, kind = "工单信息确认", "工单信息已确认,未记录新的现场进展。", "updated"
|
||||
|
||||
Reference in New Issue
Block a user