feat: 站点 JSON、语音终端 WebSocket 指派与客户端联调

- 用 OR_SITE_CONFIG_JSON_FILE 统一术间配置(video_rtsp_urls + voice_or_room_bindings)
- VoiceTerminalHub:assignment、WS 推送与 HTTP 查询;开录/停录后 notify
- 一键联调 orchestrate-and-start 与 /client/surgeries/start 共用指派逻辑,修复 demo 路径不发 WS
- 语音桌面端:SIGINT 退出、shutdown 清理、仅 WS 指派、固定 pending 轮询间隔、界面仅保留录音时长
- 新增/调整契约与绑定测试,文档与示例配置同步

Made-with: Cursor
This commit is contained in:
Kevin
2026-04-27 11:21:16 +08:00
parent 4c3f9a367b
commit 6b3adb4ad8
36 changed files with 1194 additions and 162 deletions

View File

@@ -25,6 +25,7 @@ from app.services.surgery_pipeline import SurgeryPipeline
from app.services.video.hikvision_runtime import HikvisionRuntime
from app.services.video.session_manager import CameraSessionManager
from app.services.voice_resolution import VoiceConfirmationService
from app.services.voice_terminal_hub import VoiceTerminalHub
@dataclass
@@ -42,6 +43,7 @@ class AppContainer:
tear_segment_model_bundle: TearGatedSegmentModelBundle | None
voice_confirmation_service: VoiceConfirmationService
surgery_pipeline: SurgeryPipeline
voice_terminal_hub: VoiceTerminalHub
async def start(self) -> None:
await self.camera_session_manager.start_archive_retry_loop()
@@ -96,6 +98,7 @@ def build_container(
voice_confirmation=voice,
session_factory=sf,
)
voice_hub = VoiceTerminalHub(s)
return AppContainer(
settings=s,
consumable_vision_algorithm_service=vision,
@@ -108,6 +111,7 @@ def build_container(
tear_segment_model_bundle=tear_bundle,
voice_confirmation_service=voice,
surgery_pipeline=pipeline,
voice_terminal_hub=voice_hub,
)
@@ -140,3 +144,7 @@ def get_surgery_result_repository(request: Request) -> SurgeryResultRepository:
def get_voice_confirmation_service(request: Request) -> VoiceConfirmationService:
return get_container(request).voice_confirmation_service
def get_voice_terminal_hub(request: Request) -> VoiceTerminalHub:
return get_container(request).voice_terminal_hub