Skip to content

Commit f8b5d8e

Browse files
committed
feat: project renaming
1 parent e3ef9db commit f8b5d8e

24 files changed

Lines changed: 179 additions & 174 deletions

.github/workflows/build-deb.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99
contents: write
1010

1111
env:
12-
PKG_NAME: intercom-client
12+
PKG_NAME: splintercom-client
1313
PKG_ARCH: arm64
1414
PKG_DEPENDS: "libgstreamer1.0-0, gstreamer1.0-plugins-base, gstreamer1.0-plugins-good, libv4l-0"
1515

@@ -95,16 +95,16 @@ jobs:
9595
main.build/
9696
main.dist/
9797
main.onefile-build/
98-
key: nuitka-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('uv.lock', 'main.py', 'intercomclient/**/*.py') }}
98+
key: nuitka-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('uv.lock', 'main.py', 'splintercomclient/**/*.py') }}
9999

100100
- name: Build native binary with Nuitka
101101
run: >
102102
uv run python -m nuitka
103103
--standalone
104104
--onefile
105-
--output-filename=intercom-client
105+
--output-filename=splintercom-client
106106
--output-dir=dist
107-
--include-package=intercomclient
107+
--include-package=splintercomclient
108108
--include-package=aiortc
109109
--include-package=av
110110
--include-package=cv2
@@ -134,11 +134,11 @@ jobs:
134134
135135
mkdir -p "${PKG_DIR}/usr/local/bin"
136136
mkdir -p "${PKG_DIR}/lib/systemd/system"
137-
mkdir -p "${PKG_DIR}/etc/intercom-client"
137+
mkdir -p "${PKG_DIR}/etc/splintercom-client"
138138
mkdir -p "${PKG_DIR}/DEBIAN"
139139
140-
cp dist/intercom-client "${PKG_DIR}/usr/local/bin/"
141-
chmod 755 "${PKG_DIR}/usr/local/bin/intercom-client"
140+
cp dist/splintercom-client "${PKG_DIR}/usr/local/bin/"
141+
chmod 755 "${PKG_DIR}/usr/local/bin/splintercom-client"
142142
143143
cat > "${PKG_DIR}/DEBIAN/control" <<EOF
144144
Package: ${PKG_NAME}
@@ -147,36 +147,36 @@ jobs:
147147
Priority: optional
148148
Architecture: ${PKG_ARCH}
149149
Depends: ${PKG_DEPENDS}
150-
Maintainer: Intercom Team
151-
Description: Intercom Pi client for WebRTC live streaming
152-
Raspberry Pi client that connects to the intercom signaling server
150+
Maintainer: Splintercom Team
151+
Description: Splintercom Pi client for WebRTC live streaming
152+
Raspberry Pi client that connects to the splintercom signaling server
153153
and streams live video via WebRTC.
154154
EOF
155155
156-
cat > "${PKG_DIR}/etc/intercom-client/env" <<EOF
157-
# Intercom Client Configuration
156+
cat > "${PKG_DIR}/etc/splintercom-client/env" <<EOF
157+
# Splintercom Client Configuration
158158
# Set your environment variables here — these are sourced by the systemd service.
159159
#
160160
# OAUTH_CLIENT_ID=your_client_id
161161
# OAUTH_CLIENT_SECRET=your_client_secret
162162
# VIDEO_SOURCE=0
163-
# TOKEN_FILE_PATH=/home/pi/.config/intercom-client/tokens.json
163+
# TOKEN_FILE_PATH=/home/pi/.config/splintercom-client/tokens.json
164164
# WEBSOCKET_API_BASE_URL=wss://your-server.com/ws/live_stream
165165
# HTTP_API_BASE_URL=https://your-server.com
166166
EOF
167167
168-
cat > "${PKG_DIR}/lib/systemd/system/intercom-client.service" <<EOF
168+
cat > "${PKG_DIR}/lib/systemd/system/splintercom-client.service" <<EOF
169169
[Unit]
170-
Description=Intercom Pi Client
170+
Description=Splintercom Pi Client
171171
After=network-online.target
172172
Wants=network-online.target
173173
174174
[Service]
175175
Type=simple
176176
User=pi
177177
Group=pi
178-
EnvironmentFile=-/etc/intercom-client/env
179-
ExecStart=/usr/local/bin/intercom-client
178+
EnvironmentFile=-/etc/splintercom-client/env
179+
ExecStart=/usr/local/bin/splintercom-client
180180
Restart=on-failure
181181
RestartSec=10
182182
@@ -198,8 +198,8 @@ jobs:
198198
- name: Upload .deb artifact
199199
uses: actions/upload-artifact@v4
200200
with:
201-
name: intercom-client-deb
202-
path: dist/intercom-client_*.deb
201+
name: splintercom-client-deb
202+
path: dist/splintercom-client_*.deb
203203
retention-days: 30
204204

205205
- name: Send CI metrics to Honeycomb

CLAUDE.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Intercom ClientPython
1+
# Splintercom ClientPython
22

33
Python device client that streams video from a camera to a remote viewer (browser) using WebRTC, authenticated via OAuth 2.0 Device Authorization Grant, with continuous telemetry reporting.
44

@@ -16,7 +16,7 @@ Python device client that streams video from a camera to a remote viewer (browse
1616
```
1717
ClientPython/
1818
├── main.py # PiClient entry point
19-
├── intercomclient/
19+
├── splintercomclient/
2020
│ ├── config.py # Config dataclass (env vars)
2121
│ ├── device_authorization.py # OAuth device flow functions
2222
│ ├── token_store.py # Token persistence (JSON file, 0600 perms)
@@ -28,12 +28,12 @@ ClientPython/
2828

2929
## Architecture
3030

31-
### Authentication (`intercomclient/device_authorization.py` + `intercomclient/token_store.py`)
31+
### Authentication (`splintercomclient/device_authorization.py` + `splintercomclient/token_store.py`)
3232
- **OAuth 2.0 Device Code Grant** (`urn:ietf:params:oauth:grant-type:device_code`)
3333
- `initiate_device_authorization()` — POSTs to `/oauth/device-authorization/` with device type/OS
3434
- `poll_for_token()` — Polls `/oauth/token/` with device code until approved (timeout configurable via `MAX_POLLING_TIME_MINS`, default 5 min)
3535
- `refresh_tokens()` — Refreshes access token using stored refresh token
36-
- `TokenStore` — Stores access/refresh tokens + `device_code` to JSON file (permissions `0600`) at `~/.config/intercomclient/tokens.json`
36+
- `TokenStore` — Stores access/refresh tokens + `device_code` to JSON file (permissions `0600`) at `~/.config/splintercomclient/tokens.json`
3737

3838
### WebRTC Signaling (`main.py``PiClient`)
3939
- Connects to WebSocket signaling server at `{WEBSOCKET_API_BASE_URL}/ws/live_stream/{device_code}/`
@@ -51,7 +51,7 @@ ClientPython/
5151
- Uses `if pc is not self.pc: return` guard in all event handlers to discard events from replaced PCs
5252
- Signaling WebSocket is **never** closed by WebRTC state changes — only by unrecoverable signaling errors
5353

54-
### Video Capture (`intercomclient/camera_video_stream_track.py`)
54+
### Video Capture (`splintercomclient/camera_video_stream_track.py`)
5555
- `cv2.VideoCapture` can only be opened **once** per process on this hardware. Multi-viewer support is handled by `SharedCameraSource`:
5656
- Opens the capture device once; runs a `_read_loop` background task that reads frames and fan-outs to per-viewer `asyncio.Queue(maxsize=4)`.
5757
- Subscribers call `subscribe(key) → Queue` / `unsubscribe(key)`. If a queue is full, the oldest frame is dropped (never blocks the read loop).
@@ -60,7 +60,7 @@ ClientPython/
6060
- Converts frames to `av.VideoFrame` (BGR24 format) with proper PTS/time_base timestamps.
6161
- `PiClient._get_or_create_camera_source()` — lazily opens the camera; `_release_camera_if_idle()` — stops and nulls it when `peer_connections` is empty.
6262

63-
### Telemetry (`intercomclient/telemetry.py``TelemetryClient`)
63+
### Telemetry (`splintercomclient/telemetry.py``TelemetryClient`)
6464
- `send(event, message="", level="INFO")` — synchronous; called via `asyncio.to_thread` from async contexts
6565
- Reads the current access token and `device_code` from `TokenStore` on each call
6666
- POSTs to `POST /api/v1/devices/{device_code}/telemetry/` with `Authorization: Bearer <token>`
@@ -80,13 +80,13 @@ ClientPython/
8080
| `disconnected` | `shutdown()` called (SIGINT/SIGTERM) |
8181
| `heartbeat` | Every 30 seconds from background `_heartbeat_loop` task |
8282

83-
### Configuration (`intercomclient/config.py`)
83+
### Configuration (`splintercomclient/config.py`)
8484
- All configurable via environment variables:
8585
- `HTTP_API_BASE_URL` — Backend API URL (default: `http://backend:8000`)
8686
- `WEBSOCKET_API_BASE_URL` — WebSocket URL (default: `ws://backend:8000`)
8787
- `VIDEO_SOURCE` — Camera device index (default: `0`)
88-
- `TOKEN_FILE_PATH` — Token file path (default: `~/.config/intercomclient/tokens.json`)
89-
- `OAUTH_CLIENT_ID` / `OAUTH_CLIENT_SECRET` — Fallback if `~/.config/intercom-api/oauth.json` not found
88+
- `TOKEN_FILE_PATH` — Token file path (default: `~/.config/splintercomclient/tokens.json`)
89+
- `OAUTH_CLIENT_ID` / `OAUTH_CLIENT_SECRET` — Fallback if `~/.config/splintercom-api/oauth.json` not found
9090
- `MAX_POLLING_TIME_MINS` — Device auth polling timeout (default: `5`)
9191
- Defaults: 320×240 resolution, 5 fps
9292

@@ -119,8 +119,8 @@ devices:
119119
`clientpython` depends on `utility` (healthy) — ensures device registration and token writing complete before the client starts.
120120

121121
### Shared Volumes
122-
- `device_oauth_config` — OAuth credentials from `utility` (`~/.config/intercom-api/oauth.json`)
123-
- `client_tokens` — Token file shared with `utility` (`~/.config/intercomclient/tokens.json`)
122+
- `device_oauth_config` — OAuth credentials from `utility` (`~/.config/splintercom-api/oauth.json`)
123+
- `client_tokens` — Token file shared with `utility` (`~/.config/splintercomclient/tokens.json`)
124124

125125
## Environment Variables
126126

@@ -129,7 +129,7 @@ devices:
129129
| `HTTP_API_BASE_URL` | `http://backend:8000` | Backend API base URL |
130130
| `WEBSOCKET_API_BASE_URL` | `ws://backend:8000` | WebSocket base URL |
131131
| `VIDEO_SOURCE` | `0` | Camera device index |
132-
| `TOKEN_FILE_PATH` | `~/.config/intercomclient/tokens.json` | Token storage path |
132+
| `TOKEN_FILE_PATH` | `~/.config/splintercomclient/tokens.json` | Token storage path |
133133
| `OAUTH_CLIENT_ID` | from `oauth.json` | OAuth client ID |
134134
| `OAUTH_CLIENT_SECRET` | from `oauth.json` | OAuth client secret |
135135
| `MAX_POLLING_TIME_MINS` | `5` | Device auth polling timeout |

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Production Dockerfile for Intercom ClientPython
1+
# Production Dockerfile for Splintercom ClientPython
22
# Multi-stage: build deps → slim runtime image
33
# Target: ARM64 (Raspberry Pi)
44

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Intercom Python Client
1+
# Splintercom Python Client
22

3-
Python device client that authenticates via OAuth2 device flow, streams camera video over WebRTC, and sends telemetry to the Intercom API.
3+
Python device client that authenticates via OAuth2 device flow, streams camera video over WebRTC, and sends telemetry to the Splintercom API.
44

55
## Tech Stack
66

@@ -39,11 +39,11 @@ Both workflows send a structured event to Honeycomb (`github-actions` dataset) a
3939
## Installation on Raspberry Pi (from .deb)
4040

4141
```bash
42-
sudo dpkg -i intercom-client_<version>_arm64.deb
42+
sudo dpkg -i splintercom-client_<version>_arm64.deb
4343

4444
# Configure
45-
sudo nano /etc/intercom-client/env
45+
sudo nano /etc/splintercom-client/env
4646

4747
# Enable and start
48-
sudo systemctl enable --now intercom-client
48+
sudo systemctl enable --now splintercom-client
4949
```

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.0+alpha-master-34
1+
0.0.0+alpha-master-35

main.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
from aiortc.sdp import candidate_from_sdp
1515
from requests import HTTPError
1616

17-
from intercomclient.camera_video_stream_track import (
17+
from splintercomclient.camera_video_stream_track import (
1818
CameraVideoStreamTrack,
1919
SharedCameraSource,
2020
)
21-
from intercomclient.config import Config
22-
from intercomclient.device_authorization import (
21+
from splintercomclient.config import Config
22+
from splintercomclient.device_authorization import (
2323
initiate_device_authorization,
2424
poll_for_token,
2525
refresh_tokens,
2626
)
27-
from intercomclient.otel import setup_telemetry
28-
from intercomclient.telemetry import TelemetryClient
29-
from intercomclient.token_store import TokenStatus, TokenStore
30-
from intercomclient.turn import fetch_turn_credentials
27+
from splintercomclient.otel import setup_telemetry
28+
from splintercomclient.telemetry import TelemetryClient
29+
from splintercomclient.token_store import TokenStatus, TokenStore
30+
from splintercomclient.turn import fetch_turn_credentials
3131

3232
logging.basicConfig(level=logging.INFO)
3333
LOG = logging.getLogger("pi-client")
@@ -377,7 +377,7 @@ async def shutdown(self):
377377

378378

379379
async def main():
380-
setup_telemetry("intercom-pi-client")
380+
setup_telemetry("splintercom-pi-client")
381381
config = Config()
382382
client = PiClient(config)
383383

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "intercomclientpython"
2+
name = "splintercomclientpython"
33
version = "0.4.0"
44
description = "Add your description here"
55
readme = "README.md"

intercomclient/camera_video_stream_track.py renamed to splintercomclient/camera_video_stream_track.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import cv2
66
from aiortc import VideoStreamTrack
77

8-
from intercomclient.config import Config
8+
from splintercomclient.config import Config
99

1010
LOG = logging.getLogger(__name__)
1111

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88

99
def load_oauth_credentials():
10-
"""Load OAuth credentials from ~/.config/intercom-api/oauth.json"""
11-
config_file = Path("~/.config/intercom-api/oauth.json").expanduser()
10+
"""Load OAuth credentials from ~/.config/splintercom-api/oauth.json"""
11+
config_file = Path("~/.config/splintercom-api/oauth.json").expanduser()
1212

1313
if config_file.exists():
1414
with open(config_file, "r") as f:
@@ -28,15 +28,15 @@ class Config:
2828
resolution: Tuple[int, int] = (320, 240)
2929
debug_mode: bool = True
3030
video_source: int = int(os.getenv("VIDEO_SOURCE", 0))
31-
output_dir_path: str = "/tmp/intercom_videos"
31+
output_dir_path: str = "/tmp/splintercom_videos"
3232
fourcc: str = "XVID"
3333
video_format: str = "avi"
3434
oauth_scope: str = "openid email profile"
3535
oauth_grant: str = "urn:ietf:params:oauth:grant-type:device_code"
3636
oauth_client_id: str = load_oauth_credentials()[0]
3737
oauth_client_secret: str = load_oauth_credentials()[1]
3838
token_file_path: Path = Path(
39-
os.getenv("TOKEN_FILE_PATH", "~/.config/intercomclient/tokens.json")
39+
os.getenv("TOKEN_FILE_PATH", "~/.config/splintercomclient/tokens.json")
4040
).expanduser()
4141
http_api_base_url: str = os.getenv("HTTP_API_BASE_URL", "wrong")
4242
websocket_api_base_url: str = os.getenv("WEBSOCKET_API_BASE_URL", "wrong")

0 commit comments

Comments
 (0)