exprts-ai 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
exprts_ai/__init__.py ADDED
@@ -0,0 +1,29 @@
1
+ """Exprts.ai connectivity SDK. Install ``exprts-ai``; import ``exprts_ai``."""
2
+
3
+ from .client import ConnectionState, ConnectionStatus, ExprtsClient
4
+ from .config import Config
5
+ from .errors import (
6
+ APIError,
7
+ AuthenticationError,
8
+ ConfigurationError,
9
+ ExprtsError,
10
+ ProtocolError,
11
+ TransportError,
12
+ )
13
+ from .models import DeviceInfo
14
+
15
+ __version__ = "0.1.0"
16
+ __all__ = [
17
+ "ExprtsClient",
18
+ "Config",
19
+ "DeviceInfo",
20
+ "ConnectionState",
21
+ "ConnectionStatus",
22
+ "ExprtsError",
23
+ "ConfigurationError",
24
+ "AuthenticationError",
25
+ "APIError",
26
+ "ProtocolError",
27
+ "TransportError",
28
+ "__version__",
29
+ ]
exprts_ai/client.py ADDED
@@ -0,0 +1,240 @@
1
+ """Background connectivity never touches robot control or framework objects."""
2
+
3
+ import platform
4
+ import random
5
+ import threading
6
+ from dataclasses import dataclass
7
+ from enum import Enum
8
+
9
+ from .config import Config
10
+ from .errors import (
11
+ APIError,
12
+ AuthenticationError,
13
+ ConfigurationError,
14
+ ExprtsError,
15
+ ProtocolError,
16
+ TransportError,
17
+ )
18
+ from .models import DeviceInfo
19
+ from .transport import HTTPTransport
20
+
21
+
22
+ class ConnectionState(str, Enum):
23
+ STOPPED = "stopped"
24
+ CONNECTING = "connecting"
25
+ CONNECTED = "connected"
26
+ RETRYING = "retrying"
27
+ AUTHENTICATION_FAILED = "authentication_failed"
28
+ FAILED = "failed"
29
+
30
+
31
+ @dataclass(frozen=True)
32
+ class ConnectionStatus:
33
+ state: ConnectionState
34
+ device: DeviceInfo | None
35
+ error: str | None
36
+
37
+
38
+ class ExprtsClient:
39
+ """Robot device client. ``start`` is nonblocking; direct requests are blocking.
40
+
41
+ Credentials identify the robot on the server. No project or robot IDs are sent.
42
+ Instances own one background worker and serialize their HTTP requests.
43
+ """
44
+
45
+ def __init__(
46
+ self,
47
+ *,
48
+ api_url: str | None = None,
49
+ device_token: str | None = None,
50
+ timeout: float = 3.0,
51
+ max_backoff: float = 30.0,
52
+ max_retry_after: float = 300.0,
53
+ integration: str = "python",
54
+ runtime: str | None = None,
55
+ ):
56
+ self._config = Config.from_env(
57
+ api_url=api_url,
58
+ device_token=device_token,
59
+ timeout=timeout,
60
+ max_backoff=max_backoff,
61
+ max_retry_after=max_retry_after,
62
+ )
63
+ self._payload = {
64
+ "integration": integration,
65
+ "runtime": runtime if runtime is not None else "python-" + platform.python_version(),
66
+ "client_version": "0.1.0",
67
+ }
68
+ for value in self._payload.values():
69
+ if (
70
+ not isinstance(value, str)
71
+ or not 1 <= len(value.strip()) <= 100
72
+ or any(ord(c) < 32 for c in value)
73
+ or "exprts_dev_" in value
74
+ or "exprts_sk_" in value
75
+ ):
76
+ raise ConfigurationError(
77
+ "Client metadata must be 1–100 characters "
78
+ "without credentials or control characters"
79
+ )
80
+ self._transport = HTTPTransport(self._config)
81
+ self._http_lock = threading.Lock()
82
+ self._lock = threading.RLock()
83
+ self._stop = threading.Event()
84
+ self._connected = threading.Event()
85
+ self._thread: threading.Thread | None = None
86
+ self._status = ConnectionStatus(ConnectionState.STOPPED, None, None)
87
+
88
+ @property
89
+ def status(self) -> ConnectionStatus:
90
+ with self._lock:
91
+ return self._status
92
+
93
+ @property
94
+ def is_connected(self) -> bool:
95
+ return self._connected.is_set()
96
+
97
+ def _set_status(
98
+ self, state: ConnectionState, device: DeviceInfo | None = None, error: str | None = None
99
+ ) -> None:
100
+ with self._lock:
101
+ self._status = ConnectionStatus(state, device or self._status.device, error)
102
+ if state == ConnectionState.CONNECTED:
103
+ self._connected.set()
104
+ else:
105
+ self._connected.clear()
106
+
107
+ def _request(self, operation: str) -> DeviceInfo:
108
+ with self._http_lock:
109
+ result = DeviceInfo.parse(
110
+ self._transport.request(
111
+ operation,
112
+ self._payload if operation == "heartbeat" else None,
113
+ )
114
+ )
115
+ previous = self.status.device
116
+ if previous and (previous.robot_id, previous.project_id) != (
117
+ result.robot_id,
118
+ result.project_id,
119
+ ):
120
+ raise ProtocolError("Device identity changed unexpectedly")
121
+ with self._lock:
122
+ self._status = ConnectionStatus(self._status.state, result, self._status.error)
123
+ return result
124
+
125
+ def verify(self) -> DeviceInfo:
126
+ """Validate credentials without marking the robot connected or retrying."""
127
+ try:
128
+ return self._request("verify")
129
+ except ExprtsError as error:
130
+ self._record_failure(error)
131
+ raise
132
+
133
+ def heartbeat(self) -> DeviceInfo:
134
+ """Send one heartbeat; failures propagate without automatic retries."""
135
+ try:
136
+ result = self._request("heartbeat")
137
+ except ExprtsError as error:
138
+ self._record_failure(error)
139
+ raise
140
+ self._set_status(ConnectionState.CONNECTED, result)
141
+ return result
142
+
143
+ def _record_failure(self, error: ExprtsError) -> None:
144
+ state = ConnectionState.RETRYING
145
+ if isinstance(error, AuthenticationError):
146
+ state = ConnectionState.AUTHENTICATION_FAILED
147
+ elif isinstance(error, ProtocolError) or (
148
+ isinstance(error, APIError) and not error.retryable
149
+ ):
150
+ state = ConnectionState.FAILED
151
+ self._set_status(state, error=str(error))
152
+
153
+ def connect(self) -> DeviceInfo:
154
+ """Verify and send the first heartbeat synchronously, without retries."""
155
+ self.verify()
156
+ return self.heartbeat()
157
+
158
+ def start(self) -> "ExprtsClient":
159
+ """Start one background worker. A stopped client can be restarted."""
160
+ with self._lock:
161
+ if self._thread is not None and self._thread.is_alive():
162
+ raise RuntimeError("Connectivity worker is already running")
163
+ self._stop.clear()
164
+ self._set_status(ConnectionState.CONNECTING)
165
+ self._thread = threading.Thread(
166
+ target=self._run, name="exprts-connectivity", daemon=True
167
+ )
168
+ self._thread.start()
169
+ return self
170
+
171
+ def stop(self, timeout: float | None = None) -> bool:
172
+ """Interrupt retry waits and join the worker; return whether it stopped.
173
+
174
+ An in-flight HTTP request cannot be cancelled. The default join budget is
175
+ the configured socket timeout plus one second. Never call from a control loop.
176
+ """
177
+ self._stop.set()
178
+ self._connected.clear()
179
+ with self._lock:
180
+ thread = self._thread
181
+ if thread is not None:
182
+ thread.join(self._config.timeout + 1 if timeout is None else timeout)
183
+ stopped = thread is None or not thread.is_alive()
184
+ if stopped:
185
+ self._set_status(ConnectionState.STOPPED)
186
+ return stopped
187
+
188
+ close = stop
189
+
190
+ def wait_until_connected(self, timeout: float = 10.0) -> bool:
191
+ """Wait up to timeout seconds for a successful heartbeat."""
192
+ return self._connected.wait(timeout)
193
+
194
+ def _run(self) -> None:
195
+ verified = False
196
+ delay = 1.0
197
+ try:
198
+ while not self._stop.is_set():
199
+ try:
200
+ if not verified:
201
+ self.verify()
202
+ verified = True
203
+ result = self.heartbeat()
204
+ delay = 1.0
205
+ self._stop.wait(result.heartbeat_interval_seconds)
206
+ except AuthenticationError as error:
207
+ self._set_status(ConnectionState.AUTHENTICATION_FAILED, error=str(error))
208
+ return
209
+ except (TransportError, APIError) as error:
210
+ if isinstance(error, APIError) and not error.retryable:
211
+ self._set_status(ConnectionState.FAILED, error=str(error))
212
+ return
213
+ verified = False
214
+ self._set_status(ConnectionState.RETRYING, error=str(error))
215
+ wait = random.uniform(
216
+ min(delay, self._config.max_backoff) / 2,
217
+ min(delay, self._config.max_backoff),
218
+ )
219
+ if isinstance(error, APIError) and error.retry_after is not None:
220
+ wait = max(wait, error.retry_after)
221
+ self._stop.wait(wait)
222
+ delay = min(delay * 2, self._config.max_backoff)
223
+ except ProtocolError as error:
224
+ self._set_status(ConnectionState.FAILED, error=str(error))
225
+ return
226
+ except Exception:
227
+ # Do not expose arbitrary exception messages or thread tracebacks.
228
+ self._set_status(
229
+ ConnectionState.FAILED, error="Unexpected connectivity failure"
230
+ )
231
+ return
232
+ finally:
233
+ if self._stop.is_set():
234
+ self._set_status(ConnectionState.STOPPED)
235
+
236
+ def __enter__(self) -> "ExprtsClient":
237
+ return self.start()
238
+
239
+ def __exit__(self, *_: object) -> None:
240
+ self.stop()
exprts_ai/config.py ADDED
@@ -0,0 +1,75 @@
1
+ """Explicit configuration takes precedence over environment variables."""
2
+
3
+ import math
4
+ import os
5
+ import re
6
+ from dataclasses import dataclass, field
7
+ from urllib.parse import urlsplit
8
+
9
+ from .errors import ConfigurationError
10
+
11
+ _TOKEN = re.compile(r"exprts_dev_[0-9a-f]{24}_[A-Za-z0-9_-]{43}\Z")
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class Config:
16
+ api_url: str
17
+ device_token: str = field(repr=False)
18
+ timeout: float = 3.0
19
+ max_backoff: float = 30.0
20
+ max_retry_after: float = 300.0
21
+
22
+ def __post_init__(self) -> None:
23
+ try:
24
+ parsed = urlsplit(self.api_url)
25
+ port = parsed.port
26
+ except (ValueError, TypeError, AttributeError):
27
+ raise ConfigurationError("Invalid API URL") from None
28
+ if (
29
+ parsed.scheme not in ("http", "https")
30
+ or not parsed.hostname
31
+ or parsed.username is not None
32
+ or parsed.password is not None
33
+ or parsed.query
34
+ or parsed.fragment
35
+ or parsed.path not in ("", "/")
36
+ or port == 0
37
+ or any(c.isspace() or ord(c) < 32 for c in self.api_url)
38
+ ):
39
+ raise ConfigurationError("Use an HTTP(S) API origin without a path or credentials")
40
+ if parsed.scheme == "http" and parsed.hostname not in ("localhost", "127.0.0.1", "::1"):
41
+ raise ConfigurationError("HTTPS is required outside localhost")
42
+ if not isinstance(self.device_token, str) or not _TOKEN.fullmatch(self.device_token):
43
+ raise ConfigurationError("A valid robot device credential is required")
44
+ for name, maximum in (("timeout", 60), ("max_backoff", 3600), ("max_retry_after", 86400)):
45
+ value = getattr(self, name)
46
+ if (
47
+ isinstance(value, bool)
48
+ or not isinstance(value, (int, float))
49
+ or not math.isfinite(value)
50
+ or not 0 < value <= maximum
51
+ ):
52
+ raise ConfigurationError(f"{name} must be positive and at most {maximum} seconds")
53
+ object.__setattr__(self, "api_url", self.api_url.rstrip("/"))
54
+
55
+ @classmethod
56
+ def from_env(
57
+ cls,
58
+ *,
59
+ api_url: str | None = None,
60
+ device_token: str | None = None,
61
+ timeout: float = 3.0,
62
+ max_backoff: float = 30.0,
63
+ max_retry_after: float = 300.0,
64
+ ) -> "Config":
65
+ return cls(
66
+ api_url=api_url
67
+ if api_url is not None
68
+ else os.environ.get("EXPRTS_API_URL", "https://api.exprts.ai"),
69
+ device_token=device_token
70
+ if device_token is not None
71
+ else os.environ.get("EXPRTS_DEVICE_TOKEN", ""),
72
+ timeout=timeout,
73
+ max_backoff=max_backoff,
74
+ max_retry_after=max_retry_after,
75
+ )
exprts_ai/errors.py ADDED
@@ -0,0 +1,34 @@
1
+ """Sanitized errors: never include response bodies, URLs or request credentials."""
2
+
3
+
4
+ class ExprtsError(Exception):
5
+ """Base SDK error."""
6
+
7
+
8
+ class ConfigurationError(ExprtsError, ValueError):
9
+ """Invalid local configuration."""
10
+
11
+
12
+ class TransportError(ExprtsError):
13
+ """Network or TLS failure. Retrying may succeed."""
14
+
15
+
16
+ class ProtocolError(ExprtsError):
17
+ """Unexpected or oversized server response."""
18
+
19
+
20
+ class APIError(ExprtsError):
21
+ """HTTP failure with bounded retry metadata, without server-provided text."""
22
+
23
+ def __init__(self, status_code: int, retry_after: float | None = None):
24
+ self.status_code = status_code
25
+ self.retry_after = retry_after
26
+ super().__init__(f"Exprts API returned HTTP {status_code}")
27
+
28
+ @property
29
+ def retryable(self) -> bool:
30
+ return self.status_code in (408, 429, 500, 502, 503, 504)
31
+
32
+
33
+ class AuthenticationError(APIError):
34
+ """Credential rejected, revoked, expired, or robot/project unavailable."""
exprts_ai/models.py ADDED
@@ -0,0 +1,54 @@
1
+ """Validated connectivity responses, independent of robotics frameworks."""
2
+
3
+ from dataclasses import dataclass
4
+ from datetime import datetime
5
+ from typing import Any
6
+ from uuid import UUID
7
+
8
+ from .errors import ProtocolError
9
+
10
+
11
+ def _timestamp(value: Any) -> datetime:
12
+ if not isinstance(value, str):
13
+ raise ValueError
14
+ result = datetime.fromisoformat(value.replace("Z", "+00:00"))
15
+ if result.tzinfo is None:
16
+ raise ValueError
17
+ return result
18
+
19
+
20
+ @dataclass(frozen=True)
21
+ class DeviceInfo:
22
+ project_id: UUID
23
+ robot_id: UUID
24
+ heartbeat_interval_seconds: int
25
+ heartbeat_timeout_seconds: int
26
+ server_time: datetime
27
+ last_heartbeat_at: datetime | None
28
+ authenticated: bool = True
29
+
30
+ @classmethod
31
+ def parse(cls, value: Any) -> "DeviceInfo":
32
+ try:
33
+ if not isinstance(value, dict) or value.get("authenticated") is not True:
34
+ raise ValueError
35
+ interval, timeout = (
36
+ value["heartbeat_interval_seconds"],
37
+ value["heartbeat_timeout_seconds"],
38
+ )
39
+ if type(interval) is not int or not 1 <= interval <= 3600:
40
+ raise ValueError
41
+ if type(timeout) is not int or not interval * 2 <= timeout <= 86400:
42
+ raise ValueError
43
+ return cls(
44
+ project_id=UUID(value["project_id"]),
45
+ robot_id=UUID(value["robot_id"]),
46
+ heartbeat_interval_seconds=interval,
47
+ heartbeat_timeout_seconds=timeout,
48
+ server_time=_timestamp(value["server_time"]),
49
+ last_heartbeat_at=_timestamp(value["last_heartbeat_at"])
50
+ if value["last_heartbeat_at"] is not None
51
+ else None,
52
+ )
53
+ except (KeyError, TypeError, ValueError, AttributeError):
54
+ raise ProtocolError("Invalid device response") from None
exprts_ai/py.typed ADDED
File without changes
exprts_ai/transport.py ADDED
@@ -0,0 +1,78 @@
1
+ """Bounded standard-library HTTP transport. No redirects or ambient proxies."""
2
+
3
+ import json
4
+ from datetime import datetime, timezone
5
+ from email.utils import parsedate_to_datetime
6
+ from http.client import HTTPException
7
+ from typing import Any
8
+ from urllib.error import HTTPError, URLError
9
+ from urllib.request import HTTPRedirectHandler, ProxyHandler, Request, build_opener
10
+
11
+ from .config import Config
12
+ from .errors import APIError, AuthenticationError, ProtocolError, TransportError
13
+
14
+ MAX_RESPONSE_BYTES = 65536
15
+
16
+
17
+ class _NoRedirects(HTTPRedirectHandler):
18
+ def redirect_request(
19
+ self, req: Any, fp: Any, code: int, msg: str, headers: Any, newurl: str
20
+ ) -> None:
21
+ return None
22
+
23
+
24
+ def retry_after(value: str | None, maximum: float) -> float | None:
25
+ if not value:
26
+ return None
27
+ try:
28
+ seconds = (
29
+ float(int(value))
30
+ if value.isdigit()
31
+ else (parsedate_to_datetime(value) - datetime.now(timezone.utc)).total_seconds()
32
+ )
33
+ return min(maximum, max(0.0, seconds))
34
+ except (TypeError, ValueError, OverflowError):
35
+ return None
36
+
37
+
38
+ class HTTPTransport:
39
+ def __init__(self, config: Config):
40
+ self._config = config
41
+ # System proxies can leak bearer credentials when configured incorrectly.
42
+ self._opener = build_opener(ProxyHandler({}), _NoRedirects())
43
+
44
+ def request(self, operation: str, payload: dict[str, str] | None = None) -> Any:
45
+ if operation not in ("verify", "heartbeat"):
46
+ raise ValueError("Unsupported device operation")
47
+ request = Request(
48
+ self._config.api_url + "/v1/device/" + operation,
49
+ data=json.dumps(payload, allow_nan=False).encode() if payload is not None else None,
50
+ headers={
51
+ "Authorization": "Bearer " + self._config.device_token,
52
+ "Content-Type": "application/json",
53
+ "Accept": "application/json",
54
+ "User-Agent": "exprts-ai/0.1.0",
55
+ },
56
+ )
57
+ try:
58
+ with self._opener.open(request, timeout=self._config.timeout) as response:
59
+ if response.status != 200:
60
+ raise APIError(response.status)
61
+ raw = response.read(MAX_RESPONSE_BYTES + 1)
62
+ except HTTPError as error:
63
+ status = error.code
64
+ delay = retry_after(error.headers.get("Retry-After"), self._config.max_retry_after)
65
+ error.close()
66
+ cls = AuthenticationError if status in (401, 403) else APIError
67
+ raise cls(status, delay) from None
68
+ except (URLError, OSError, TimeoutError, HTTPException):
69
+ raise TransportError("Exprts connection unavailable") from None
70
+ if len(raw) > MAX_RESPONSE_BYTES:
71
+ raise ProtocolError("Device response exceeds size limit")
72
+ try:
73
+ result = json.loads(raw)
74
+ if not isinstance(result, dict) or "data" not in result:
75
+ raise ValueError
76
+ return result["data"]
77
+ except (ValueError, UnicodeError, RecursionError):
78
+ raise ProtocolError("Invalid JSON response") from None
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: exprts-ai
3
+ Version: 0.1.0
4
+ Summary: Exprts.ai robotics connectivity SDK
5
+ Author: Exprts.ai
6
+ License-Expression: Apache-2.0
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Provides-Extra: dev
17
+ Requires-Dist: pytest>=8; extra == "dev"
18
+ Requires-Dist: build>=1.2; extra == "dev"
19
+ Requires-Dist: twine>=6; extra == "dev"
20
+ Requires-Dist: ruff>=0.11; extra == "dev"
21
+ Requires-Dist: mypy>=1.15; extra == "dev"
22
+ Dynamic: license-file
23
+
24
+ # Exprts.ai Python SDK
25
+
26
+ Connectivity-only SDK v0.1.0 for Python 3.10+. Distribution: **exprts-ai**. Import: **exprts_ai**. No runtime dependencies.
27
+
28
+ This source is prepared locally. Installation from PyPI becomes available after a separate release; the commands below currently use a local checkout or wheel.
29
+
30
+ ## Quick start
31
+
32
+ Register a robot in the customer dashboard and generate its **device credential**. A project API key cannot authenticate a device. Identity is determined by the server; do not supply robot or project IDs.
33
+
34
+ ```bash
35
+ python -m pip install /path/to/python-sdk
36
+ export EXPRTS_API_URL=https://api.exprts.ai
37
+ read -rs -p 'Device credential: ' EXPRTS_DEVICE_TOKEN
38
+ export EXPRTS_DEVICE_TOKEN
39
+ ```
40
+
41
+ Use your actual API origin. HTTP is allowed only for `localhost`, `127.0.0.1` and `::1` development. URLs must not include `/v1`, credentials, a query, or a fragment. TLS certificate verification stays enabled; redirects and ambient HTTP proxies are disabled.
42
+
43
+ ```python
44
+ from exprts_ai import ExprtsClient
45
+
46
+ with ExprtsClient(integration="custom") as client:
47
+ # start() / entering the context launches a background thread immediately.
48
+ # Put the existing robot application's loop here; do not wait on cloud access.
49
+ run_local_robot_application()
50
+ ```
51
+
52
+ For a blocking connectivity check outside a control loop:
53
+
54
+ ```python
55
+ from exprts_ai import ExprtsClient, ExprtsError
56
+
57
+ client = ExprtsClient() # Reads EXPRTS_API_URL and EXPRTS_DEVICE_TOKEN.
58
+ try:
59
+ info = client.connect() # GET /v1/device/verify, POST /v1/device/heartbeat.
60
+ print(info.robot_id, info.heartbeat_interval_seconds)
61
+ except ExprtsError as error:
62
+ print(error) # SDK error text excludes request credentials and server bodies.
63
+ finally:
64
+ client.close()
65
+ ```
66
+
67
+ After release the installation command will be `python -m pip install exprts-ai==0.1.0`.
68
+
69
+ ## API
70
+
71
+ - `ExprtsClient(api_url=None, device_token=None, timeout=3, max_backoff=30, max_retry_after=300, integration="python", runtime=None)`: explicit arguments override environment variables. Default origin is `https://api.exprts.ai`; no connection occurs during initialization.
72
+ - `verify() -> DeviceInfo`: blocking credential check, no retries. Does not record a heartbeat.
73
+ - `heartbeat() -> DeviceInfo`: blocking single heartbeat, no retries.
74
+ - `connect() -> DeviceInfo`: blocking verify followed by heartbeat, no retries.
75
+ - `start() -> ExprtsClient`: background verification and heartbeats; duplicate running starts raise `RuntimeError`.
76
+ - `stop(timeout=None) -> bool` / `close()`: signal stop, interrupt retry waits and join. Returns false if a request is still in progress. Restart only once the old worker exits.
77
+ - `wait_until_connected(timeout=10) -> bool`: optional bounded wait, outside control loops.
78
+ - `status -> ConnectionStatus`: immutable snapshot with state, last device response and sanitized error text.
79
+ - `is_connected -> bool`: whether the last connectivity attempt succeeded. It is not a safety signal or a real-time guarantee of network reachability.
80
+
81
+ States: `stopped`, `connecting`, `connected`, `retrying`, `authentication_failed`, `failed`.
82
+
83
+ The background worker follows the server heartbeat interval. Network failures and HTTP 408/429/500/502/503/504 trigger bounded exponential backoff with jitter and re-verification. `Retry-After` supports seconds and HTTP dates, capped by `max_retry_after`. HTTP 401/403 stops the worker rather than repeatedly submitting rejected credentials. Generate/rotate a credential in the dashboard, stop the old client and create a new client with the replacement. Other HTTP errors and invalid/oversized responses stop the worker; inspect `status` before restarting.
84
+
85
+ The three-second default timeout is a socket timeout, not a hard total deadline against a peer that continuously trickles bytes. Shutdown cannot cancel an in-flight standard-library HTTP operation; its join budget defaults to timeout + one second and the worker is a daemon. Never wait for shutdown in a safety-critical control loop. No samples or robot commands are queued, persisted, replayed or sent.
86
+
87
+ ## Robotics integration
88
+
89
+ The worker accesses no robot hardware or simulator objects. Start it beside an existing Python controller and keep local control independent of connectivity. See `examples/webots_controller.py` and `examples/background.py`. ROS, Gazebo, Isaac Sim and other Python runtimes can use the same pattern; native adapters are not included or claimed tested. Webots must use a Python interpreter where this package is installed.
90
+
91
+ SDK v0.1.0 does not implement telemetry ingestion, tables, streams, recording policies, experiences, storage, datasets, managed processing, billing or deployments.
92
+
93
+ ## Development
94
+
95
+ From this SDK directory:
96
+
97
+ ```bash
98
+ python -m venv .venv
99
+ .venv/bin/python -m pip install -e '.[dev]'
100
+ .venv/bin/python -m pytest
101
+ .venv/bin/ruff check .
102
+ .venv/bin/mypy src
103
+ .venv/bin/python -m build
104
+ .venv/bin/python -m twine check dist/*
105
+ ```
106
+
107
+ The included CI workflow runs after this directory is exported as the root of its own repository. The workflow tests Python 3.10–3.14; local results are recorded in `RELEASE.md` and are not a claim that every matrix version has run locally.
108
+
109
+ ## License and contribution
110
+
111
+ Apache License 2.0 applies to this SDK directory only. It does not license the surrounding platform repository. Report security issues privately to the SDK maintainer; do not include credentials in issues, logs or screenshots. Contributions should include focused tests and pass the checks above.
@@ -0,0 +1,12 @@
1
+ exprts_ai/__init__.py,sha256=zKi2lIkFd5BQ_Ze0l_i6Q1CUiXpz1nGxY0h6D6DnAY8,635
2
+ exprts_ai/client.py,sha256=is0bTTxsih_3zSF5zd36Cy5Mh57yXLsHVtqC27ZREV4,8772
3
+ exprts_ai/config.py,sha256=ndvvQs3xBtDEUYZMjC6L7RQdvXTxEvdehk2e_Bny8sM,2770
4
+ exprts_ai/errors.py,sha256=V2f-6OQpLSFJRN0gdqrThXWfCuSCOOMfpQnMWkQQv9c,982
5
+ exprts_ai/models.py,sha256=wb-8ac2vFkVp1o4P-WpqNTT3P6mKo3tnfN0hz_MojDw,1883
6
+ exprts_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ exprts_ai/transport.py,sha256=1ZDf973rP1Ja9t9_KKXc0EKQIbqTJgh93WPUADl40M4,3138
8
+ exprts_ai-0.1.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
9
+ exprts_ai-0.1.0.dist-info/METADATA,sha256=esP_LTGiB9pgkxOirBWT9JHQzkYzehDDE0vD33hTKxI,6260
10
+ exprts_ai-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
11
+ exprts_ai-0.1.0.dist-info/top_level.txt,sha256=6Cs4Ggo0dLUVWFW6ZO7EhWqA8TaCqzm4gBkqEp8R1pQ,10
12
+ exprts_ai-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1 @@
1
+ exprts_ai