File size: 1,679 Bytes
0602b26
 
 
 
 
 
9fb95ba
 
 
 
0ff89da
d29db6e
0602b26
 
 
 
 
 
 
 
 
 
 
 
 
0ff89da
0602b26
e8f2acc
 
0602b26
 
9fb95ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0602b26
 
 
 
 
 
 
d29db6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""Runtime capabilities consumed by the HTTP API adapter."""

from collections.abc import Mapping
from dataclasses import dataclass
from typing import Any, Protocol

from free_claude_code.application.connected_accounts import (
    ConnectedAccountLoginMode,
    ConnectedAccountStatus,
)
from free_claude_code.application.model_metadata import ProviderModelRefreshResult
from free_claude_code.application.ports import RequestRuntimePort, TaskController


class AdminRuntimePort(Protocol):
    """Runtime operations exposed by the local Admin API."""

    async def apply_admin_config(
        self, updates: Mapping[str, Any]
    ) -> dict[str, Any]: ...

    def admin_status(self) -> dict[str, Any]: ...

    async def test_provider(self, provider_id: str) -> dict[str, Any]: ...

    async def refresh_models(self) -> ProviderModelRefreshResult: ...

    def usage_stats(self) -> dict[str, Any]: ...

    async def request_restart(self) -> None: ...

    async def connected_account_status(
        self, provider_id: str
    ) -> ConnectedAccountStatus: ...

    async def start_connected_account_login(
        self,
        provider_id: str,
        mode: ConnectedAccountLoginMode,
    ) -> ConnectedAccountStatus: ...

    async def cancel_connected_account_login(
        self, provider_id: str
    ) -> ConnectedAccountStatus: ...

    async def disconnect_connected_account(
        self, provider_id: str
    ) -> ConnectedAccountStatus: ...


@dataclass(frozen=True, slots=True)
class ApiServices:
    """Complete runtime boundary required to construct the API application."""

    requests: RequestRuntimePort
    admin: AdminRuntimePort
    tasks: TaskController