mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-30 19:02:16 +00:00
- Add URL detection, normalization, and direct fetching to web_search tool (handles standalone URLs, embedded URLs, arxiv PDF→abs conversion) - Add URL pre-expansion in OpenHands agent to bypass tool loop for URL queries - Add input truncation (_truncate_if_needed) to prevent context window overflow - Fix stream_bridge ToolResult field access (content/latency_seconds vs output/latency_ms) - Add XML tool call format parser alongside Action:/Action Input: format - Reduce default max_turns from 10→3 to cap worst-case response time - Add empty response fallback text in frontend useChat hook - Add channels system, security module, and model catalog updates - Add 30+ new tests for URL fetching, truncation, and agent behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
639 B
Python
29 lines
639 B
Python
"""ABC for security scanners."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
from openjarvis.security.types import ScanResult
|
|
|
|
|
|
class BaseScanner(ABC):
|
|
"""Base class for all security scanners.
|
|
|
|
Subclasses implement pattern-based scanning for secrets, PII, or other
|
|
sensitive content.
|
|
"""
|
|
|
|
scanner_id: str
|
|
|
|
@abstractmethod
|
|
def scan(self, text: str) -> ScanResult:
|
|
"""Scan *text* and return findings."""
|
|
|
|
@abstractmethod
|
|
def redact(self, text: str) -> str:
|
|
"""Return *text* with sensitive matches replaced by redaction markers."""
|
|
|
|
|
|
__all__ = ["BaseScanner"]
|