devops-bot-sdk 1.4.17__tar.gz → 1.4.19__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.
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/PKG-INFO +1 -1
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/devops_bot_sdk.egg-info/PKG-INFO +1 -1
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/pyproject.toml +1 -1
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/__init__.py +2 -2
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/client.py +1 -1
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/updater.py +72 -31
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/README.md +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/devops_bot_sdk.egg-info/SOURCES.txt +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/devops_bot_sdk.egg-info/dependency_links.txt +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/devops_bot_sdk.egg-info/entry_points.txt +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/devops_bot_sdk.egg-info/requires.txt +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/devops_bot_sdk.egg-info/top_level.txt +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/collectors/__init__.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/collectors/files.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/collectors/process.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/collectors/screenshot.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/config.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/crucial.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/exceptions.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/git_ops.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/graphify.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/hooks/__init__.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/hooks/crucial_guard.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/ipc/__init__.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/ipc/electron_bridge.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/ipc/handlers.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/local_exec.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/models/__init__.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/models/envelope.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/models/requests.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/models/responses.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/models/snapshots.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/py.typed +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/run_auto.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/sse.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/test.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/sdk/test_pipeline.py +0 -0
- {devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/setup.cfg +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "devops-bot-sdk"
|
|
7
|
-
version = "1.4.
|
|
7
|
+
version = "1.4.19"
|
|
8
8
|
description = "DevOps Bot Desktop SDK — thin client for the AgentOS Electron desktop app"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "LicenseRef-Proprietary"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""AgentOS Desktop SDK — thin HTTPS/SSE client for the Electron app.
|
|
2
2
|
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.19
|
|
4
4
|
|
|
5
5
|
Public surface:
|
|
6
6
|
BackendClient.from_config() — create client from ~/.agentos/config.toml
|
|
@@ -30,7 +30,7 @@ Rules:
|
|
|
30
30
|
- All data egress through submit_webhook only
|
|
31
31
|
"""
|
|
32
32
|
|
|
33
|
-
__version__ = "1.4.
|
|
33
|
+
__version__ = "1.4.19"
|
|
34
34
|
__author__ = "AgentOS"
|
|
35
35
|
|
|
36
36
|
from sdk.client import BackendClient
|
|
@@ -36,7 +36,7 @@ from sdk.sse import _check_status, stream_with_reconnect
|
|
|
36
36
|
|
|
37
37
|
logger = logging.getLogger(__name__)
|
|
38
38
|
|
|
39
|
-
SDK_VERSION = "1.4.
|
|
39
|
+
SDK_VERSION = "1.4.19"
|
|
40
40
|
_POLL_INTERVAL = 3.0
|
|
41
41
|
_POLL_TIMEOUT = 600.0
|
|
42
42
|
_ORCHESTRATE_TIMEOUT = 2700.0 # 45 min — covers approval wait + VPS execution time
|
|
@@ -183,43 +183,65 @@ def _fetch_github_token() -> str | None:
|
|
|
183
183
|
|
|
184
184
|
# ── Core update logic ─────────────────────────────────────────────────────────
|
|
185
185
|
|
|
186
|
-
def
|
|
187
|
-
"""
|
|
186
|
+
def _install_candidates() -> list[str]:
|
|
187
|
+
"""Ordered pip targets: detected URL → SSH → token-HTTPS branch → PyPI dist."""
|
|
188
|
+
cands = list(_unique([_detect_install_url(), _GITHUB_SSH]))
|
|
189
|
+
gh_token = _fetch_github_token()
|
|
190
|
+
if gh_token:
|
|
191
|
+
cands.append(f"git+https://{gh_token}@github.com/{_GITHUB_REPO}.git@{_sdk_branch()}")
|
|
192
|
+
cands.append(_DIST)
|
|
193
|
+
return cands
|
|
188
194
|
|
|
189
|
-
Tries candidates in order:
|
|
190
|
-
1. Original install URL (from direct_url.json)
|
|
191
|
-
2. GitHub SSH URL
|
|
192
|
-
3. GitHub HTTPS URL using token from /ml-api/github/token
|
|
193
|
-
4. PyPI dist name
|
|
194
|
-
Stops at the first success.
|
|
195
|
-
"""
|
|
196
|
-
flags = _pip_flags()
|
|
197
195
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
196
|
+
def _pip_install(url: str, *, force: bool = False) -> bool:
|
|
197
|
+
"""pip install --upgrade <url>. force=True adds --force-reinstall (repair)."""
|
|
198
|
+
extra = ["--force-reinstall", "--no-deps"] if force else []
|
|
199
|
+
try:
|
|
200
|
+
subprocess.run(
|
|
201
|
+
[sys.executable, "-m", "pip", "install", "--upgrade", "--quiet",
|
|
202
|
+
*extra, *_pip_flags(), url],
|
|
203
|
+
check=True, capture_output=True,
|
|
204
|
+
)
|
|
205
|
+
return True
|
|
206
|
+
except Exception: # noqa: BLE001
|
|
207
|
+
return False
|
|
208
208
|
|
|
209
|
-
# 1 + 2: detected URL and SSH fallback
|
|
210
|
-
for url in _unique([_detect_install_url(), _GITHUB_SSH]):
|
|
211
|
-
if _pip_upgrade(url):
|
|
212
|
-
return True
|
|
213
209
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
210
|
+
def _verify_install() -> bool:
|
|
211
|
+
"""True if the installed SDK imports cleanly in a FRESH process.
|
|
212
|
+
|
|
213
|
+
Guards against a partial/corrupt upgrade — on Windows the running
|
|
214
|
+
``agentos-auto.exe`` / loaded package files can't be replaced mid-pip, which
|
|
215
|
+
can leave ``sdk`` importable but missing submodules (e.g. local_exec)."""
|
|
216
|
+
try:
|
|
217
|
+
r = subprocess.run(
|
|
218
|
+
[sys.executable, "-c",
|
|
219
|
+
"import sdk, sdk.local_exec, sdk.ipc.handlers, sdk.run_auto"],
|
|
220
|
+
capture_output=True, timeout=90,
|
|
221
|
+
)
|
|
222
|
+
return r.returncode == 0
|
|
223
|
+
except Exception: # noqa: BLE001
|
|
224
|
+
return False
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _repair_install() -> bool:
|
|
228
|
+
"""Force-reinstall to recover from a corrupt upgrade; verifies the result."""
|
|
229
|
+
for url in _install_candidates():
|
|
230
|
+
if _pip_install(url, force=True) and _verify_install():
|
|
219
231
|
return True
|
|
232
|
+
return False
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def self_update() -> bool:
|
|
236
|
+
"""Upgrade the installed SDK via pip. Returns True on success.
|
|
220
237
|
|
|
221
|
-
|
|
222
|
-
|
|
238
|
+
Tries candidates in order (detected URL → SSH → token-HTTPS → PyPI),
|
|
239
|
+
stopping at the first success.
|
|
240
|
+
"""
|
|
241
|
+
for url in _install_candidates():
|
|
242
|
+
if _pip_install(url):
|
|
243
|
+
return True
|
|
244
|
+
return False
|
|
223
245
|
|
|
224
246
|
|
|
225
247
|
def auto_update(quiet: bool = False) -> tuple[bool, str, str | None]:
|
|
@@ -274,6 +296,25 @@ def auto_update_and_reexec(module: str, argv: list[str]) -> None:
|
|
|
274
296
|
if os.getenv("AGENTOS_NO_UPDATE") or os.getenv("_AGENTOS_REEXEC"):
|
|
275
297
|
return
|
|
276
298
|
updated, _cur, _latest = auto_update(quiet=False)
|
|
299
|
+
|
|
300
|
+
# A self-upgrade of a RUNNING package can land broken on Windows (the active
|
|
301
|
+
# agentos-auto.exe / loaded files can't be replaced mid-pip — pip uninstalls
|
|
302
|
+
# the old then can't write the new, leaving sdk partial or removed). NEVER run
|
|
303
|
+
# on a corrupt install: verify it imports, repair (force-reinstall) if not, and
|
|
304
|
+
# abort with manual instructions only if repair also fails.
|
|
305
|
+
if not _verify_install():
|
|
306
|
+
print("⚠ the SDK looks incomplete after update — repairing …")
|
|
307
|
+
if not _repair_install():
|
|
308
|
+
print(
|
|
309
|
+
"error: the SDK self-update left the install broken and auto-repair "
|
|
310
|
+
"failed.\n reinstall it manually, then re-run agentos-auto:\n"
|
|
311
|
+
f' "{sys.executable}" -m pip install --force-reinstall '
|
|
312
|
+
f'"git+https://github.com/{_GITHUB_REPO}.git@{_sdk_branch()}"'
|
|
313
|
+
)
|
|
314
|
+
sys.exit(1)
|
|
315
|
+
print("✓ repaired.")
|
|
316
|
+
updated = True # repaired → restart on the fixed install
|
|
317
|
+
|
|
277
318
|
if not updated:
|
|
278
319
|
return
|
|
279
320
|
print("restarting on the updated version …\n")
|
|
File without changes
|
|
File without changes
|
{devops_bot_sdk-1.4.17 → devops_bot_sdk-1.4.19}/devops_bot_sdk.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|