unitlab 2.3.14__tar.gz → 2.3.15__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unitlab
3
- Version: 2.3.14
3
+ Version: 2.3.15
4
4
  Home-page: https://github.com/teamunitlab/unitlab-sdk
5
5
  Author: Unitlab Inc.
6
6
  Author-email: team@unitlab.ai
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name="unitlab",
5
- version="2.3.14",
5
+ version="2.3.15",
6
6
  license="MIT",
7
7
  author="Unitlab Inc.",
8
8
  author_email="team@unitlab.ai",
@@ -146,13 +146,27 @@ def run_agent(
146
146
  if not device_id:
147
147
  import uuid
148
148
  import platform
149
+ from pathlib import Path
150
+
149
151
  # Try environment variable first
150
152
  device_id = os.getenv('DEVICE_ID')
151
153
  if not device_id:
152
- # Generate a unique ID based on hostname and random UUID
153
- hostname = platform.node().replace('.', '-').replace(' ', '-')[:20]
154
- random_suffix = str(uuid.uuid4())[:8]
155
- device_id = f"{hostname}-{random_suffix}"
154
+ # Try to load saved device ID
155
+ device_id_file = Path.home() / '.unitlab' / 'device_id'
156
+ device_id_file.parent.mkdir(exist_ok=True, parents=True)
157
+
158
+ if device_id_file.exists():
159
+ device_id = device_id_file.read_text().strip()
160
+ print(f"📌 Using saved device ID: {device_id}")
161
+ else:
162
+ # Generate a unique ID based on hostname and random UUID
163
+ hostname = platform.node().replace('.', '-').replace(' ', '-')[:20]
164
+ random_suffix = str(uuid.uuid4())[:8]
165
+ device_id = f"{hostname}-{random_suffix}"
166
+
167
+ # Save for future runs
168
+ device_id_file.write_text(device_id)
169
+ print(f"📝 Generated and saved device ID: {device_id}")
156
170
 
157
171
 
158
172
  # Create client and initialize device agent
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unitlab
3
- Version: 2.3.14
3
+ Version: 2.3.15
4
4
  Home-page: https://github.com/teamunitlab/unitlab-sdk
5
5
  Author: Unitlab Inc.
6
6
  Author-email: team@unitlab.ai
File without changes
File without changes
File without changes
File without changes
File without changes