# ============================================================
# gRPC Client Helpers
# ============================================================
# 다른 에이전트 서버들을 gRPC로 호출하는 도우미 함수들
def call_quick(code_path: str, port: int = 50051) -> str:
"""
Quick Agent 서버를 호출하여 빠른 패턴 스캔을 수행하는 함수
Args:
code_path: 분석할 코드 파일 경로
port: Quick Agent 서버 포트 (기본값: 50051)
Returns:
str: Quick Agent의 분석 결과 요약
"""
# insecure 채널을 사용하여 localhost의 지정된 포트로 연결
with grpc.insecure_channel(f"localhost:{port}") as channel:
# QuickService의 스텁 생성
stub = agents_pb2_grpc.QuickServiceStub(channel)
# CodeRequest 생성 및 전송
req = agents_pb2.CodeRequest(code_path=code_path)
resp = stub.Scan(req)
return resp.summary