INNER CODE UNIT · Python
hits
AgentSkillOS/SkillAnything · scripts/analyze_target.py:75
hits = sum(1 for s in openapi_signals if s.lower() in body.lower())
if hits >= 2 or "application/json" in content_type and hits >= 1:
if verbose:
print(f"[detect] URL appears to be an OpenAPI/Swagger spec ({hits} signals)")
return "api"
return "service"
def _classify_path(path: str, verbose: bool = False) -> str:
"""Read a local file/dir and guess its category."""
p = Path(path)
if p.is_dir():
return "library"
try:
text = p.read_text(errors="replace")[:32_000]
except OSError:
return "unknown"