Spaces:
Running
Running
fix(py312): surgical future-annotations — only files with forward refs, fixes super() 500 error
c5e21af Download src/free_claude_code/application/web_tools/ports.py from dherain24/claude-proxy: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/src/free_claude_code/application/web_tools/ports.py
- Command line
-
hf download hf://spaces/dherain24/claude-proxy/src/free_claude_code/application/web_tools/ports.py
-
curl -L -o ports.py https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/src/free_claude_code/application/web_tools/ports.py
1.07 kB
| """Outbound capabilities consumed by the local web-tool workflow.""" | |
| from dataclasses import dataclass | |
| from typing import Protocol | |
| from free_claude_code.core.web_tools import WebFetchResult, WebSearchResult | |
| class WebFetchEgressPolicy: | |
| """Egress rules for user-influenced web_fetch URLs.""" | |
| allow_private_network_targets: bool | |
| allowed_schemes: frozenset[str] | |
| class WebFetchEgressViolation(ValueError): | |
| """Raised when a web_fetch URL is rejected by egress policy (SSRF guard).""" | |
| def web_fetch_allowed_scheme_set(raw_schemes: str) -> frozenset[str]: | |
| """Return normalized schemes allowed for web_fetch.""" | |
| return frozenset( | |
| part.strip().lower() for part in raw_schemes.split(",") if part.strip() | |
| ) | |
| class WebToolsPort(Protocol): | |
| """Complete each operation before returning data, retaining no response resource.""" | |
| async def search(self, query: str) -> list[WebSearchResult]: ... | |
| async def fetch( | |
| self, url: str, *, egress: WebFetchEgressPolicy | |
| ) -> WebFetchResult: ... | |