devops-bot-sdk 1.4.90__tar.gz → 1.4.92__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.90 → devops_bot_sdk-1.4.92}/PKG-INFO +1 -1
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/devops_bot_sdk.egg-info/PKG-INFO +1 -1
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/pyproject.toml +1 -1
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/__init__.py +2 -2
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/client.py +1 -1
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/git_ops.py +40 -12
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/ipc/handlers.py +22 -1
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/README.md +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/devops_bot_sdk.egg-info/SOURCES.txt +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/devops_bot_sdk.egg-info/dependency_links.txt +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/devops_bot_sdk.egg-info/entry_points.txt +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/devops_bot_sdk.egg-info/requires.txt +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/devops_bot_sdk.egg-info/top_level.txt +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/collectors/__init__.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/collectors/files.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/collectors/process.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/collectors/screenshot.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/config.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/crucial.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/exceptions.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/graphify.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/hooks/__init__.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/hooks/crucial_guard.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/ipc/__init__.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/ipc/electron_bridge.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/local_exec.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/models/__init__.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/models/envelope.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/models/requests.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/models/responses.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/models/snapshots.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/py.typed +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/run_auto.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/sse.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/test.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/test_pipeline.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/sdk/updater.py +0 -0
- {devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/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.92"
|
|
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.92
|
|
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.92"
|
|
34
34
|
__author__ = "AgentOS"
|
|
35
35
|
|
|
36
36
|
from sdk.client import BackendClient
|
|
@@ -72,6 +72,19 @@ async def _is_git_repo(path: str, env: dict) -> bool:
|
|
|
72
72
|
return rc == 0 and out == "true"
|
|
73
73
|
|
|
74
74
|
|
|
75
|
+
# A branch named exactly like a Jira ticket id (e.g. "LDA-6", "OCR-103"). The
|
|
76
|
+
# "name the branch exactly the ticket id" convention produces these, so a
|
|
77
|
+
# leftover checkout from a PREVIOUS ticket's run must be treated as a stale
|
|
78
|
+
# feature branch — never as a base to cut the next ticket's branch from.
|
|
79
|
+
_TICKET_BRANCH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9]{1,9}-\d+$")
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _is_work_branch(name: str) -> bool:
|
|
83
|
+
"""True when `name` is one of OUR generated work branches (feature/* or a
|
|
84
|
+
bare ticket id) — i.e. never a legitimate base."""
|
|
85
|
+
return name.startswith("feature/") or bool(_TICKET_BRANCH_RE.match(name))
|
|
86
|
+
|
|
87
|
+
|
|
75
88
|
async def detect_default_branch(path: str, env: dict) -> str:
|
|
76
89
|
"""Repo default branch — the PR base.
|
|
77
90
|
|
|
@@ -100,9 +113,10 @@ async def detect_default_branch(path: str, env: dict) -> str:
|
|
|
100
113
|
)
|
|
101
114
|
if rc == 0:
|
|
102
115
|
return cand
|
|
103
|
-
# 4. Last resort: the current branch, but never
|
|
116
|
+
# 4. Last resort: the current branch, but never one of our work branches
|
|
117
|
+
# (feature/* or a bare ticket id like "LDA-6").
|
|
104
118
|
rc, out, _ = await _run(["git", "rev-parse", "--abbrev-ref", "HEAD"], path, env)
|
|
105
|
-
if rc == 0 and out and not out
|
|
119
|
+
if rc == 0 and out and not _is_work_branch(out):
|
|
106
120
|
return out
|
|
107
121
|
return "main"
|
|
108
122
|
|
|
@@ -167,9 +181,10 @@ async def start_branch(
|
|
|
167
181
|
- `base` omitted → the repo's CURRENT checked-out branch (the branch the
|
|
168
182
|
user is actually working on); the feature branch is cut from local HEAD
|
|
169
183
|
so the user's working state is preserved. If HEAD is detached or already
|
|
170
|
-
one of OUR
|
|
171
|
-
a
|
|
172
|
-
|
|
184
|
+
one of OUR work branches — `feature/*` or a bare ticket-id branch like
|
|
185
|
+
"LDA-6" (a stale checkout from a prior ticket's run in a shared working
|
|
186
|
+
tree) — fall back to `detect_default_branch` so we never chain one
|
|
187
|
+
ticket's branch onto another's.
|
|
173
188
|
|
|
174
189
|
Returns {"branch", "base"} or None when the path isn't a git repo (e.g. a
|
|
175
190
|
fresh scratch dir) or the checkout failed. The returned `base` is the branch
|
|
@@ -210,7 +225,7 @@ async def start_branch(
|
|
|
210
225
|
# Default: base = the CURRENT checked-out branch (the user's working branch).
|
|
211
226
|
rc, cur, _ = await _run(["git", "rev-parse", "--abbrev-ref", "HEAD"], path, env)
|
|
212
227
|
cur = cur.strip() if rc == 0 else ""
|
|
213
|
-
if cur and cur != "HEAD" and not cur
|
|
228
|
+
if cur and cur != "HEAD" and not _is_work_branch(cur):
|
|
214
229
|
# Cut from local HEAD — preserve the user's working state, do not pull.
|
|
215
230
|
rc, _, _ = await _run(["git", "checkout", "-B", branch], path, env)
|
|
216
231
|
if rc != 0:
|
|
@@ -218,7 +233,8 @@ async def start_branch(
|
|
|
218
233
|
logger.info("git_ops.branch | %s ← current branch %s", branch, cur)
|
|
219
234
|
return {"branch": branch, "base": cur}
|
|
220
235
|
|
|
221
|
-
# HEAD detached or a stale
|
|
236
|
+
# HEAD detached or a stale work-branch checkout (feature/* or a previous
|
|
237
|
+
# ticket's id-named branch) → fall back to the repo default.
|
|
222
238
|
resolved = await detect_default_branch(path, env)
|
|
223
239
|
if resolved == branch:
|
|
224
240
|
resolved = "main"
|
|
@@ -300,7 +316,10 @@ async def finish_pr(
|
|
|
300
316
|
`gh auth login`). SSH alone covers git transport, not the PR.
|
|
301
317
|
|
|
302
318
|
Every failure path is logged so a missing PR is diagnosable instead of silent.
|
|
303
|
-
Returns {"pushed": bool, "pr_url": str | None, "pr_error": str | None
|
|
319
|
+
Returns {"pushed": bool, "pr_url": str | None, "pr_error": str | None,
|
|
320
|
+
"committed": bool, "pr_unavailable": bool} — `pr_unavailable` is True when
|
|
321
|
+
the box simply has no way to open a PR (no token AND no `gh`), which callers
|
|
322
|
+
treat as a warning rather than a failed PR attempt.
|
|
304
323
|
"""
|
|
305
324
|
path = str(Path(project_path).expanduser())
|
|
306
325
|
env = _git_env(github_token)
|
|
@@ -353,18 +372,27 @@ async def finish_pr(
|
|
|
353
372
|
pr_error = f"gh pr create failed: {gh_err[:200]}"
|
|
354
373
|
logger.warning("git_ops.gh_pr_failed branch=%s error=%s", branch, gh_err[:300])
|
|
355
374
|
|
|
375
|
+
pr_unavailable = False
|
|
356
376
|
if not pr_url and pr_error is None:
|
|
357
377
|
# Pushed, but no PR and no specific error captured above.
|
|
358
378
|
if github_token and owner_repo:
|
|
359
379
|
pr_error = "no PR created — REST API returned no URL"
|
|
360
380
|
elif not github_token and not shutil.which("gh"):
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
381
|
+
# This box CANNOT open a PR at all (no token, no gh) — SSH covers
|
|
382
|
+
# git transport only. Not a failed attempt: on SSH-only setups the
|
|
383
|
+
# PR is opened externally (platform/human), so flag it as
|
|
384
|
+
# `pr_unavailable` so the caller treats it as a warning, not a
|
|
385
|
+
# compliance failure.
|
|
386
|
+
pr_unavailable = True
|
|
387
|
+
pr_error = ("PR not opened from this machine — no GitHub token and "
|
|
388
|
+
"`gh` not installed (SSH covers push only). The PR must "
|
|
389
|
+
"be opened externally, or install gh + `gh auth login` / "
|
|
390
|
+
"provide a token.")
|
|
364
391
|
elif not shutil.which("gh"):
|
|
365
392
|
pr_error = "no PR created — missing GitHub token or unrecognized origin remote"
|
|
366
393
|
else:
|
|
367
394
|
pr_error = "no PR created"
|
|
368
395
|
logger.warning("git_ops.no_pr branch=%s reason=%s", branch, pr_error)
|
|
369
396
|
|
|
370
|
-
return {"pushed": pushed, "pr_url": pr_url, "pr_error": pr_error,
|
|
397
|
+
return {"pushed": pushed, "pr_url": pr_url, "pr_error": pr_error,
|
|
398
|
+
"committed": committed, "pr_unavailable": pr_unavailable}
|
|
@@ -2078,8 +2078,19 @@ async def _code_one_repo(
|
|
|
2078
2078
|
issues.append("in scope but produced 0 committed changes")
|
|
2079
2079
|
elif not pr.get("pushed"):
|
|
2080
2080
|
issues.append("branch was not pushed")
|
|
2081
|
-
elif not pr.get("pr_url"):
|
|
2081
|
+
elif not pr.get("pr_url") and not pr.get("pr_unavailable"):
|
|
2082
2082
|
issues.append(f"no PR opened ({(pr or {}).get('pr_error') or 'unknown'})")
|
|
2083
|
+
elif pr.get("pr_unavailable"):
|
|
2084
|
+
# Committed + pushed, but this box has NO way to open a PR (no
|
|
2085
|
+
# token, no gh — SSH transport only). The PR is opened
|
|
2086
|
+
# externally on such setups, so this is a WARNING, not a
|
|
2087
|
+
# compliance failure: the ticket still completes (Done).
|
|
2088
|
+
await send(Envelope(
|
|
2089
|
+
type="step_update", thread_id=thread_id,
|
|
2090
|
+
data={"status": "running",
|
|
2091
|
+
"current_step": f"[{name}] Pushed OK — PR to be opened "
|
|
2092
|
+
"externally (no token/gh on this machine)"},
|
|
2093
|
+
).model_dump())
|
|
2083
2094
|
else:
|
|
2084
2095
|
# Plain working folder (documentation / analyst deliverables, non-git):
|
|
2085
2096
|
# no branch/PR to verify, but it must still have PRODUCED something.
|
|
@@ -2878,6 +2889,7 @@ import re as _re # noqa: E402
|
|
|
2878
2889
|
_BASE_NOISE = {
|
|
2879
2890
|
"the", "a", "an", "this", "that", "new", "feature", "features",
|
|
2880
2891
|
"your", "same", "current", "default", "its", "please", "create",
|
|
2892
|
+
"origin", "latest", "upstream", "branch",
|
|
2881
2893
|
}
|
|
2882
2894
|
_BASE_DIRECTIVE_RES = [
|
|
2883
2895
|
# "branch from/off <base>" — most explicit, tried first. Greedy so a full
|
|
@@ -2885,6 +2897,15 @@ _BASE_DIRECTIVE_RES = [
|
|
|
2885
2897
|
_re.compile(r"branch(?:es|ed|ing)?\s+(?:from|off(?:\s+of)?)\s+(?:the\s+)?[\"'`]?([A-Za-z0-9._\-/]+)[\"'`]?(?:\s+branch)?\b", _re.I),
|
|
2886
2898
|
# "base branch: <base>" / "base is <base>"
|
|
2887
2899
|
_re.compile(r"base(?:\s+branch)?\s*(?:[:=]|\bis\b|\bshould\s+be\b)\s*[\"'`]?([A-Za-z0-9._\-/]+)[\"'`]?\b", _re.I),
|
|
2900
|
+
# Literal git-workflow steps: "git checkout <base>" (NOT -b/-B — that's the
|
|
2901
|
+
# NEW branch) and "git pull origin <base>". This is how the standard
|
|
2902
|
+
# Human Instructions template names the base ("git checkout main && git
|
|
2903
|
+
# pull origin main").
|
|
2904
|
+
_re.compile(r"git\s+checkout\s+(?!-)[\"'`]?([A-Za-z0-9._\-/]+)[\"'`]?", _re.I),
|
|
2905
|
+
_re.compile(r"git\s+pull\s+(?:origin\s+)?[\"'`]?([A-Za-z0-9._\-/]+)[\"'`]?", _re.I),
|
|
2906
|
+
# "open a PR into <base>" / "merge to <base>" / "PR Requirements (target: <base>"
|
|
2907
|
+
_re.compile(r"(?:PR|pull\s+request|merge[sd]?)\s+(?:in)?to\s+(?:the\s+)?[\"'`]?([A-Za-z0-9._\-/]+)[\"'`]?", _re.I),
|
|
2908
|
+
_re.compile(r"target\s*:\s*[\"'`]?([A-Za-z][A-Za-z0-9._\-/]*)[\"'`]?", _re.I),
|
|
2888
2909
|
# "from the <base> branch"
|
|
2889
2910
|
_re.compile(r"from\s+(?:the\s+)?[\"'`]?([A-Za-z0-9._\-/]+)[\"'`]?\s+branch\b", _re.I),
|
|
2890
2911
|
# loose "<base> branch" (e.g. "main branch") — last, most permissive.
|
|
File without changes
|
|
File without changes
|
{devops_bot_sdk-1.4.90 → devops_bot_sdk-1.4.92}/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
|