Spaces:
Running
Running
sync: upstream 9194f15 + custom addons (KeyRotator, RotatingChatTransport, sol/terra/luna, ScannerTrap, health, Py3.12 compat)
e99df76 Download src/free_claude_code/messaging/managed_protocols.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/messaging/managed_protocols.py
- Command line
-
hf download hf://spaces/dherain24/claude-proxy/src/free_claude_code/messaging/managed_protocols.py
-
curl -L -o managed_protocols.py https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/src/free_claude_code/messaging/managed_protocols.py
1.07 kB
| from __future__ import annotations | |
| """Protocols for messaging-owned managed Claude sessions.""" | |
| from collections.abc import AsyncGenerator | |
| from typing import Any, Protocol, runtime_checkable | |
| class ManagedClaudeSessionProtocol(Protocol): | |
| """Protocol for managed Claude sessions used by messaging.""" | |
| def start_task( | |
| self, prompt: str, session_id: str | None = None, fork_session: bool = False | |
| ) -> AsyncGenerator[dict, Any]: ... | |
| def is_busy(self) -> bool: ... | |
| class ManagedClaudeSessionManagerProtocol(Protocol): | |
| """Protocol for the managed Claude session pool used by messaging.""" | |
| async def get_or_create_session( | |
| self, session_id: str | None = None | |
| ) -> tuple[ManagedClaudeSessionProtocol, str, bool]: ... | |
| async def register_real_session_id( | |
| self, temp_id: str, real_session_id: str | |
| ) -> bool: ... | |
| async def stop_all(self) -> None: ... | |
| async def remove_session(self, session_id: str) -> bool: ... | |
| def get_stats(self) -> dict: ... | |