In-memory representation of the pointer file. Mirrors the on-disk JSON schema 1:1. Fields ------ bridge_id Client-generated stable identity. Survives across restarts — the daemon picks a new one only if the pointer is dropped. environment_id Server-assign
| 61 | |
| 62 | @dataclass |
| 63 | class BridgePointer: |
| 64 | """In-memory representation of the pointer file. Mirrors the |
| 65 | on-disk JSON schema 1:1. |
| 66 | |
| 67 | Fields |
| 68 | ------ |
| 69 | bridge_id |
| 70 | Client-generated stable identity. Survives across restarts — |
| 71 | the daemon picks a new one only if the pointer is dropped. |
| 72 | environment_id |
| 73 | Server-assigned env id from the most recent registration. |
| 74 | session_id |
| 75 | Currently-active session id; may be ``None`` when no session |
| 76 | is running (e.g., right after init but before first poll). |
| 77 | machine_name |
| 78 | Hostname captured at write time. ``read_pointer`` rejects |
| 79 | the file if this doesn't match the current host. |
| 80 | dir |
| 81 | Working directory captured at write time. Rejected on mismatch. |
| 82 | created_at_ms / updated_at_ms |
| 83 | Milliseconds since epoch. ``created_at`` is set once; |
| 84 | ``updated_at`` bumps on every write. |
| 85 | """ |
| 86 | |
| 87 | bridge_id: str |
| 88 | environment_id: str |
| 89 | session_id: str | None |
| 90 | machine_name: str |
| 91 | dir: str |
| 92 | created_at_ms: int |
| 93 | updated_at_ms: int |
| 94 | |
| 95 | def to_json(self) -> dict[str, object]: |
| 96 | d = asdict(self) |
| 97 | d['schema_version'] = _SCHEMA_VERSION |
| 98 | return d |
| 99 | |
| 100 | |
| 101 | def _pointer_path(working_dir: str) -> str: |
no outgoing calls
no test coverage detected