devops-bot-sdk 1.4.66__tar.gz → 1.4.70__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.
Files changed (38) hide show
  1. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/PKG-INFO +1 -1
  2. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/devops_bot_sdk.egg-info/PKG-INFO +1 -1
  3. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/pyproject.toml +1 -1
  4. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/__init__.py +2 -2
  5. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/client.py +1 -1
  6. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/ipc/handlers.py +69 -8
  7. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/run_auto.py +50 -1
  8. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/README.md +0 -0
  9. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/devops_bot_sdk.egg-info/SOURCES.txt +0 -0
  10. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/devops_bot_sdk.egg-info/dependency_links.txt +0 -0
  11. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/devops_bot_sdk.egg-info/entry_points.txt +0 -0
  12. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/devops_bot_sdk.egg-info/requires.txt +0 -0
  13. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/devops_bot_sdk.egg-info/top_level.txt +0 -0
  14. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/collectors/__init__.py +0 -0
  15. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/collectors/files.py +0 -0
  16. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/collectors/process.py +0 -0
  17. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/collectors/screenshot.py +0 -0
  18. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/config.py +0 -0
  19. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/crucial.py +0 -0
  20. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/exceptions.py +0 -0
  21. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/git_ops.py +0 -0
  22. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/graphify.py +0 -0
  23. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/hooks/__init__.py +0 -0
  24. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/hooks/crucial_guard.py +0 -0
  25. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/ipc/__init__.py +0 -0
  26. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/ipc/electron_bridge.py +0 -0
  27. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/local_exec.py +0 -0
  28. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/models/__init__.py +0 -0
  29. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/models/envelope.py +0 -0
  30. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/models/requests.py +0 -0
  31. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/models/responses.py +0 -0
  32. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/models/snapshots.py +0 -0
  33. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/py.typed +0 -0
  34. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/sse.py +0 -0
  35. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/test.py +0 -0
  36. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/test_pipeline.py +0 -0
  37. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/sdk/updater.py +0 -0
  38. {devops_bot_sdk-1.4.66 → devops_bot_sdk-1.4.70}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devops-bot-sdk
3
- Version: 1.4.66
3
+ Version: 1.4.70
4
4
  Summary: DevOps Bot Desktop SDK — thin client for the AgentOS Electron desktop app
5
5
  Author: noumanaziz2128
6
6
  License-Expression: LicenseRef-Proprietary
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devops-bot-sdk
3
- Version: 1.4.66
3
+ Version: 1.4.70
4
4
  Summary: DevOps Bot Desktop SDK — thin client for the AgentOS Electron desktop app
5
5
  Author: noumanaziz2128
6
6
  License-Expression: LicenseRef-Proprietary
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devops-bot-sdk"
7
- version = "1.4.66"
7
+ version = "1.4.70"
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.66
3
+ Version: 1.4.70
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.66"
33
+ __version__ = "1.4.70"
34
34
  __author__ = "AgentOS"
35
35
 
36
36
  from sdk.client import BackendClient
@@ -58,7 +58,7 @@ def _notify_status(task_id: str, status: str) -> None:
58
58
  pass
59
59
 
60
60
 
61
- SDK_VERSION = "1.4.66"
61
+ SDK_VERSION = "1.4.70"
62
62
  _POLL_INTERVAL = 3.0
63
63
  _POLL_TIMEOUT = 600.0
64
64
  _ORCHESTRATE_TIMEOUT = 2700.0 # 45 min — covers approval wait + VPS execution time
@@ -521,14 +521,13 @@ def _build_epic_prompt(jira_key: str, summary: str, description: str | None,
521
521
  ' {\n'
522
522
  ' "summary": "Short imperative story title (a JIRA task summary)",\n'
523
523
  ' "description": "The story in the USER STORY FORMAT below (Markdown).",\n'
524
- ' "humanInstructions": "Operator instructions to implement THIS story. MUST '
525
- "repeat the same project location/path and constraints from the epic so the "
526
- 'coding run works in the right place.",\n'
527
524
  ' "assigneeEmail": "dev@company.com",\n'
528
525
  ' "points": 5\n'
529
526
  " }\n"
530
527
  " ]\n"
531
528
  "}\n\n"
529
+ "Do NOT produce humanInstructions for the stories — created stories are clean "
530
+ "user-story artifacts; implementation instructions are added later.\n"
532
531
  "Create as many stories as the epic genuinely needs (do not pad or truncate "
533
532
  "artificially); each story must be independently implementable.\n"
534
533
  "assigneeEmail is OPTIONAL per story: set it ONLY when the epic explicitly "
@@ -594,6 +593,34 @@ def _epic_inherited_fields(task: dict) -> dict:
594
593
  return {k: v for k, v in fields.items() if v}
595
594
 
596
595
 
596
+ # Lines that name a directory to WRITE the generated user stories into (distinct
597
+ # from a code repo path). Matches story/file/folder/directory/mkdir/write hints
598
+ # and skips repo lines (github URL / "path:").
599
+ _STORIES_DIR_HINT = re.compile(
600
+ r"\b(user\s+stor|stories|mkdir|directory|folder|write|\.md)\b", re.I,
601
+ )
602
+
603
+
604
+ def _extract_stories_dir(text: str | None) -> str | None:
605
+ """A directory the instructions ask the user stories to be WRITTEN into, or None.
606
+
607
+ Scans lines that mention stories/files/a directory (but not code-repo lines that
608
+ carry a GitHub URL or a "path:" repo label) and returns the first filesystem path
609
+ found — e.g. "Create a new directory at /home/me/new_tasks and write the stories".
610
+ """
611
+ if not text:
612
+ return None
613
+ for line in text.splitlines():
614
+ low = line.lower()
615
+ if "github.com" in low or "path:" in low:
616
+ continue # a code repo line, not a stories-output directory
617
+ if _STORIES_DIR_HINT.search(line):
618
+ p = _extract_path_from_text(line)
619
+ if p:
620
+ return p
621
+ return None
622
+
623
+
597
624
  # ── Ticket validation gate (Epics + USER-driven Stories) ────────────────────
598
625
  # A strict quality gate: before the bot actions an Epic or a USER-created Story it
599
626
  # checks the ticket meets the required standard. On failure it posts a harsh,
@@ -790,12 +817,12 @@ async def _handle_epic(
790
817
  ).model_dump())
791
818
  return
792
819
 
793
- # 2. Mark the Epic Done with the detailed description + plan.
794
- epic_desc = (doc.get("epic_description") or description or summary or "")[:20000]
820
+ # 2. Mark the Epic Done. Do NOT touch the Epic's description the parent Epic's
821
+ # description stays exactly as the human wrote it; only the status and the AI
822
+ # plan are recorded.
795
823
  plan = (doc.get("plan") or "")[:8000]
796
824
  await client.update_task_ml(
797
- tid, {"status": "Done", "description": epic_desc, "initialAiPlan": plan},
798
- model_used=_EPIC_MODELS,
825
+ tid, {"status": "Done", "initialAiPlan": plan}, model_used=_EPIC_MODELS,
799
826
  )
800
827
  await send(Envelope(
801
828
  type="step_update", thread_id=thread_id,
@@ -824,7 +851,9 @@ async def _handle_epic(
824
851
  "status": "To Do",
825
852
  "summary": str(st.get("summary", "")).strip()[:250],
826
853
  "description": str(st.get("description", "") or "")[:20000],
827
- "humanInstructions": str(st.get("humanInstructions") or human or "")[:20000] or None,
854
+ # NO humanInstructions on AI-created stories they are clean user-story
855
+ # artifacts; implementation instructions (repos/branch/etc.) are added
856
+ # later at the story/task stage, not baked in by the Epic.
828
857
  "parentTaskId": tid,
829
858
  }
830
859
  if child_email:
@@ -839,6 +868,38 @@ async def _handle_epic(
839
868
  data={"current_step": f" ↳ created To Do task: {fields['summary']}"},
840
869
  ).model_dump())
841
870
 
871
+ # 3b. Optionally ALSO write each story as a Markdown file to a directory named in
872
+ # the instructions (e.g. "create /home/me/new_tasks and write the user stories
873
+ # there"). This is IN ADDITION to the Story tickets. Best-effort — a file-write
874
+ # failure never fails the Epic.
875
+ stories_dir = _extract_stories_dir(human)
876
+ if stories_dir:
877
+ from pathlib import Path
878
+ try:
879
+ d = Path(stories_dir).expanduser()
880
+ d.mkdir(parents=True, exist_ok=True) # create from scratch
881
+ written = 0
882
+ for i, st in enumerate(stories[:_MAX_EPIC_STORIES], 1):
883
+ if not isinstance(st, dict) or not (st.get("summary") or "").strip():
884
+ continue
885
+ title = str(st.get("summary", "")).strip()
886
+ slug = re.sub(r"[^a-z0-9]+", "-", title.lower()).strip("-")[:50] or f"story-{i}"
887
+ content = f"# {title}\n\n{str(st.get('description', '') or '').strip()}\n"
888
+ (d / f"{i:02d}-{slug}.md").write_text(content, encoding="utf-8")
889
+ written += 1
890
+ await client.log_activity(f"Epic {jira_key}: wrote {written} user-story file(s) to {stories_dir}")
891
+ await send(Envelope(
892
+ type="step_update", thread_id=thread_id,
893
+ data={"jira_task_id": tid,
894
+ "current_step": f"Epic {jira_key}: wrote {written} user-story file(s) to {stories_dir}"},
895
+ ).model_dump())
896
+ except Exception as exc: # noqa: BLE001
897
+ await send(Envelope(
898
+ type="step_update", thread_id=thread_id,
899
+ data={"jira_task_id": tid,
900
+ "current_step": f"Epic {jira_key}: could not write story files to {stories_dir} — {str(exc)[:120]}"},
901
+ ).model_dump())
902
+
842
903
  await client.log_activity(
843
904
  f"Epic {jira_key}: Done — created {len(created)}/{len(stories)} To Do user Story(ies)"
844
905
  )
@@ -15,6 +15,7 @@ Commands:
15
15
  coding; no keys = all To Do Stories (alias: stories)
16
16
  agentos-auto stop ask the running loop to pause after the current task
17
17
  agentos-auto status show whether the background loop is running / stop pending
18
+ agentos-auto logs [-f] print the loop log (~/.agentos/auto.log); -f to follow live
18
19
  agentos-auto update upgrade the SDK to the latest version
19
20
 
20
21
  Options:
@@ -261,6 +262,50 @@ def _parse_ticket_keys(argv: list[str]) -> list[str]:
261
262
  return out
262
263
 
263
264
 
265
+ def _show_logs(argv: list[str]) -> None:
266
+ """`agentos-auto logs [-f] [--lines N]` — print the loop's log (~/.agentos/auto.log).
267
+
268
+ Prints the last N lines (default 200); with -f/--follow, then streams new lines
269
+ live (Ctrl-C to stop). Pure-Python tail — works on any platform, no `tail` needed.
270
+ """
271
+ import time
272
+
273
+ follow = "-f" in argv or "--follow" in argv
274
+ n = 200
275
+ if "--lines" in argv:
276
+ try:
277
+ n = max(1, int(argv[argv.index("--lines") + 1]))
278
+ except (IndexError, ValueError):
279
+ pass
280
+
281
+ if not _LOG_FILE.exists():
282
+ print(f"no log yet at {_LOG_FILE} — start a run with `agentos-auto`.")
283
+ print(f"per-run claude transcripts: {_AGENTOS_DIR / 'logs'}")
284
+ return
285
+
286
+ try:
287
+ tail = _LOG_FILE.read_text(encoding="utf-8", errors="replace").splitlines()[-n:]
288
+ except Exception as exc: # noqa: BLE001
289
+ print(f"could not read {_LOG_FILE}: {exc}")
290
+ return
291
+ for line in tail:
292
+ print(line)
293
+
294
+ if follow:
295
+ print(f"\n— following {_LOG_FILE} (Ctrl-C to stop) —", flush=True)
296
+ try:
297
+ with open(_LOG_FILE, "r", encoding="utf-8", errors="replace") as f:
298
+ f.seek(0, 2) # jump to end; only stream NEW lines
299
+ while True:
300
+ line = f.readline()
301
+ if line:
302
+ print(line, end="", flush=True)
303
+ else:
304
+ time.sleep(0.5)
305
+ except KeyboardInterrupt:
306
+ pass
307
+
308
+
264
309
  _current_task: str | None = None
265
310
 
266
311
 
@@ -464,6 +509,10 @@ def main() -> None:
464
509
  print("stop pending: yes" if _stop_requested() else "stop pending: no")
465
510
  return
466
511
 
512
+ if cmd == "logs":
513
+ _show_logs(argv)
514
+ return
515
+
467
516
  if cmd in ("run", "resume", "ticket", "tickets", "story", "stories"):
468
517
  # Run modes:
469
518
  # run/resume → the whole To Do queue
@@ -528,7 +577,7 @@ def main() -> None:
528
577
  _run_loop(workspace_root, only_keys, stories_only)
529
578
  return
530
579
 
531
- print(f"unknown command '{cmd}'. use: run | resume | ticket | story | stop | status | update")
580
+ print(f"unknown command '{cmd}'. use: run | resume | ticket | story | stop | status | logs | update")
532
581
  sys.exit(1)
533
582
 
534
583