devops-bot-sdk 1.7.65__tar.gz → 1.7.74__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 (320) hide show
  1. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/PKG-INFO +1 -1
  2. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/devops_bot_sdk.egg-info/PKG-INFO +1 -1
  3. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/devops_bot_sdk.egg-info/SOURCES.txt +4 -0
  4. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/__init__.py +2 -2
  5. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/os_setup.py +87 -4
  6. devops_bot_sdk-1.7.74/sdk/agent_browser.py +138 -0
  7. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agentd.py +74 -11
  8. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/activity.py +27 -8
  9. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/client.py +38 -20
  10. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/faqs.py +34 -0
  11. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/help_data/areas.json +33 -33
  12. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/help_data/help.json +4 -0
  13. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/help_data/releases.json +30 -0
  14. devops_bot_sdk-1.7.74/sdk/help_data/snapshot.json +17 -0
  15. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/helpdesk.py +38 -2
  16. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/helpdesk_kb.md +68 -0
  17. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ipc/handlers.py +87 -28
  18. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/local_exec.py +7 -0
  19. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/api.py +5 -0
  20. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/models.py +6 -2
  21. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/server.py +3 -2
  22. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/service.py +99 -2
  23. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/app.js +25 -2
  24. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/help.html +1 -1
  25. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/updater.py +3 -1
  26. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_activity_os_setup.py +101 -1
  27. devops_bot_sdk-1.7.74/tests/test_agent_activity_routed_runs.py +380 -0
  28. devops_bot_sdk-1.7.74/tests/test_agent_browser.py +61 -0
  29. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_panel_help.py +54 -0
  30. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_run_verdict_is_honest.py +72 -0
  31. devops_bot_sdk-1.7.74/tests/test_service_user_manager.py +93 -0
  32. devops_bot_sdk-1.7.65/sdk/help_data/snapshot.json +0 -17
  33. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/README.md +0 -0
  34. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/devops_bot_sdk.egg-info/dependency_links.txt +0 -0
  35. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/devops_bot_sdk.egg-info/entry_points.txt +0 -0
  36. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/devops_bot_sdk.egg-info/requires.txt +0 -0
  37. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/devops_bot_sdk.egg-info/top_level.txt +0 -0
  38. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/pyproject.toml +0 -0
  39. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/__init__.py +0 -0
  40. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/classifier.py +0 -0
  41. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/collectors/__init__.py +0 -0
  42. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/collectors/common.py +0 -0
  43. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/collectors/linux_auditd.py +0 -0
  44. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/collectors/macos_eslogger.py +0 -0
  45. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/collectors/windows_eventlog.py +0 -0
  46. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/models.py +0 -0
  47. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/recorder.py +0 -0
  48. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/redact.py +0 -0
  49. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/settings.py +0 -0
  50. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/shipper.py +0 -0
  51. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/activity/spool.py +0 -0
  52. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agent_builder.py +0 -0
  53. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agent_sharing.py +0 -0
  54. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/__init__.py +0 -0
  55. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/builder.py +0 -0
  56. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/chat.py +0 -0
  57. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/connectors.py +0 -0
  58. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/engines/__init__.py +0 -0
  59. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/engines/claude_code.py +0 -0
  60. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/engines/http.py +0 -0
  61. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/engines/mcp.py +0 -0
  62. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/engines/n8n.py +0 -0
  63. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/engines/shell.py +0 -0
  64. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/integrations.py +0 -0
  65. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/inventory.py +0 -0
  66. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/library/__init__.py +0 -0
  67. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/manifest.py +0 -0
  68. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/prompt_studio.py +0 -0
  69. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/prompt_template.py +0 -0
  70. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/prompt_vars.py +0 -0
  71. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/run_log.py +0 -0
  72. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/schedules.py +0 -0
  73. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/secrets.py +0 -0
  74. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/ticket_run.py +0 -0
  75. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/usage.py +0 -0
  76. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/agents/varstore.py +0 -0
  77. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ai_connectors.py +0 -0
  78. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/browser_profile.py +0 -0
  79. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/claude_usage.py +0 -0
  80. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/cli.py +0 -0
  81. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/collectors/__init__.py +0 -0
  82. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/collectors/files.py +0 -0
  83. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/collectors/process.py +0 -0
  84. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/collectors/screenshot.py +0 -0
  85. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/config.py +0 -0
  86. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/crucial.py +0 -0
  87. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/custom_agents.py +0 -0
  88. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/deferred_tickets.py +0 -0
  89. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/departments.py +0 -0
  90. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/design_verify/__init__.py +0 -0
  91. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/design_verify/assets.py +0 -0
  92. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/design_verify/bootstrap.py +0 -0
  93. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/design_verify/browser.py +0 -0
  94. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/design_verify/compare.py +0 -0
  95. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/design_verify/loop.py +0 -0
  96. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/estimator.py +0 -0
  97. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/exceptions.py +0 -0
  98. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/fallback_handoff.py +0 -0
  99. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/firewall.py +0 -0
  100. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/formats.py +0 -0
  101. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/git_ops.py +0 -0
  102. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/github_fetch.py +0 -0
  103. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/github_ingest.py +0 -0
  104. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/graph_recon.py +0 -0
  105. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/graphify.py +0 -0
  106. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/help_actions.py +0 -0
  107. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/help_data/commands.json +0 -0
  108. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/help_data/pages.json +0 -0
  109. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/hooks/__init__.py +0 -0
  110. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/hooks/crucial_guard.py +0 -0
  111. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/install_marker.py +0 -0
  112. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/instructions_template.py +0 -0
  113. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/intake.py +0 -0
  114. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ipc/__init__.py +0 -0
  115. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ipc/electron_bridge.py +0 -0
  116. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/journal.py +0 -0
  117. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/log_colors.py +0 -0
  118. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/memory_guard.py +0 -0
  119. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/model_policy.py +0 -0
  120. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/models/__init__.py +0 -0
  121. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/models/envelope.py +0 -0
  122. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/models/requests.py +0 -0
  123. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/models/responses.py +0 -0
  124. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/models/snapshots.py +0 -0
  125. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/phase_timer.py +0 -0
  126. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/plan_run.py +0 -0
  127. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/platform_compat.py +0 -0
  128. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/prd_progress.py +0 -0
  129. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/proof_readers.py +0 -0
  130. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/providers.py +0 -0
  131. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/py.typed +0 -0
  132. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/resume.py +0 -0
  133. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/router.py +0 -0
  134. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/run_auto.py +0 -0
  135. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/schedule_tickets.py +0 -0
  136. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/schedule_timeline.py +0 -0
  137. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/scheduler.py +0 -0
  138. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/scope_plan.py +0 -0
  139. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/self_report.py +0 -0
  140. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/self_report_local.py +0 -0
  141. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/sse.py +0 -0
  142. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/swagger.py +0 -0
  143. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/task_file.py +0 -0
  144. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/task_types.py +0 -0
  145. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/test.py +0 -0
  146. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/test_env.py +0 -0
  147. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/test_pipeline.py +0 -0
  148. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ticket_board.py +0 -0
  149. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ticket_bulk.py +0 -0
  150. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ticket_fields.py +0 -0
  151. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ticket_plan.py +0 -0
  152. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ticket_pools.py +0 -0
  153. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/tickets.py +0 -0
  154. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/tiers/__init__.py +0 -0
  155. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/tiers/mini_agent.py +0 -0
  156. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/__init__.py +0 -0
  157. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/dashboard.py +0 -0
  158. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/health.py +0 -0
  159. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/ip_allowlist.py +0 -0
  160. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/jobs.py +0 -0
  161. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/runner.py +0 -0
  162. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/security.py +0 -0
  163. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/session.py +0 -0
  164. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/setup_manager.py +0 -0
  165. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/agents.html +0 -0
  166. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/chat.html +0 -0
  167. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/connectors.html +0 -0
  168. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/custom-agents.html +0 -0
  169. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/default-agents.html +0 -0
  170. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/faqs.html +0 -0
  171. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/index.html +0 -0
  172. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/new-agent.html +0 -0
  173. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/report.html +0 -0
  174. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/runs.html +0 -0
  175. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/schedules.html +0 -0
  176. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/setup.html +0 -0
  177. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/styles.css +0 -0
  178. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/static/tickets.html +0 -0
  179. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/ui/swagger.py +0 -0
  180. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/url_access.py +0 -0
  181. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/vps_health.py +0 -0
  182. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/vps_identity.py +0 -0
  183. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/sdk/write_hook.py +0 -0
  184. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/setup.cfg +0 -0
  185. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_activity_claude_runs.py +0 -0
  186. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_activity_collectors.py +0 -0
  187. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_activity_core.py +0 -0
  188. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_activity_live_tracking.py +0 -0
  189. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_activity_macos.py +0 -0
  190. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_activity_pipeline.py +0 -0
  191. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_activity.py +0 -0
  192. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_activity_tracking.py +0 -0
  193. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_builder.py +0 -0
  194. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_chat_features.py +0 -0
  195. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_crud_cli.py +0 -0
  196. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_listing.py +0 -0
  197. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_prompt_async.py +0 -0
  198. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_prompt_models.py +0 -0
  199. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_run_ticket.py +0 -0
  200. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_schedules.py +0 -0
  201. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_sharing.py +0 -0
  202. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agent_workspace_settings.py +0 -0
  203. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_agents_connectors_builder.py +0 -0
  204. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ai_connectors.py +0 -0
  205. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_allowed_tools_config.py +0 -0
  206. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_approval_park.py +0 -0
  207. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_auto_agent_dispatch.py +0 -0
  208. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_auto_ticket_queue.py +0 -0
  209. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_backend_only_allowlist.py +0 -0
  210. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_browser_profile.py +0 -0
  211. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_cheap_tier.py +0 -0
  212. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_claude_usage_gate.py +0 -0
  213. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_client_jira_projects.py +0 -0
  214. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_config_token_diagnostics.py +0 -0
  215. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_configure_token_owner.py +0 -0
  216. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_connectors_runner.py +0 -0
  217. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_console_encoding.py +0 -0
  218. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_crash_recovery.py +0 -0
  219. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_create_safe_retry.py +0 -0
  220. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_deferred_tickets.py +0 -0
  221. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_departments.py +0 -0
  222. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_done_transition.py +0 -0
  223. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_epic_decompose_run.py +0 -0
  224. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_epic_inherited_agent_id.py +0 -0
  225. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_epic_session_isolation.py +0 -0
  226. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_estimator.py +0 -0
  227. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_fallback_cli.py +0 -0
  228. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_fallback_cli_upgrade.py +0 -0
  229. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_fallback_folder_changes.py +0 -0
  230. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_fallback_parity.py +0 -0
  231. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_fallback_rate_limit.py +0 -0
  232. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_fallback_streaming.py +0 -0
  233. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_faqs.py +0 -0
  234. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_firewall_open_on_update.py +0 -0
  235. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_formats.py +0 -0
  236. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_git_action.py +0 -0
  237. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_github_fetch.py +0 -0
  238. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_github_ingest.py +0 -0
  239. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_graph_off_by_default.py +0 -0
  240. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_graph_recon.py +0 -0
  241. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_graphify_build.py +0 -0
  242. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_graphify_hook_install.py +0 -0
  243. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_health.py +0 -0
  244. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_help_actions.py +0 -0
  245. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_help_attachments.py +0 -0
  246. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_help_questions.py +0 -0
  247. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_helpdesk.py +0 -0
  248. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_infographic_data.py +0 -0
  249. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_install_marker.py +0 -0
  250. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_instructions_template.py +0 -0
  251. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_intake_job_outcome.py +0 -0
  252. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_intake_plan_review.py +0 -0
  253. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_journal.py +0 -0
  254. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_limit_fallback_handoff.py +0 -0
  255. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_local_exec_provider.py +0 -0
  256. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_log_colors_backlog.py +0 -0
  257. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_mcp_route_contract.py +0 -0
  258. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_memory_guard.py +0 -0
  259. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_model_policy.py +0 -0
  260. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_panel_ticket_schedules.py +0 -0
  261. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_parallel_tickets.py +0 -0
  262. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_phase_timer.py +0 -0
  263. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_plan_ahead.py +0 -0
  264. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_plan_new_command.py +0 -0
  265. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_plan_run_activity.py +0 -0
  266. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_pool_pr_modes.py +0 -0
  267. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_pr_identity.py +0 -0
  268. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_prd_artifact.py +0 -0
  269. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_project_path_resolution.py +0 -0
  270. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_proof_readers.py +0 -0
  271. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_providers.py +0 -0
  272. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_quiet_run_log.py +0 -0
  273. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_recon_session_isolation.py +0 -0
  274. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_resume.py +0 -0
  275. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_router.py +0 -0
  276. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_run_auto_agent_only.py +0 -0
  277. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_run_outputs.py +0 -0
  278. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_schedule_api.py +0 -0
  279. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_schedule_outputs_and_plans.py +0 -0
  280. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_schedule_tickets.py +0 -0
  281. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_schedule_timeline.py +0 -0
  282. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_scheduler.py +0 -0
  283. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_scheduler_transient_retry.py +0 -0
  284. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_self_report.py +0 -0
  285. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_service_token_warning.py +0 -0
  286. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_stale_panel_restart.py +0 -0
  287. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_swagger_command.py +0 -0
  288. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_task_file_and_plan_run.py +0 -0
  289. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_task_file_format_doc.py +0 -0
  290. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_theme_switch.py +0 -0
  291. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_agent_mode.py +0 -0
  292. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_board.py +0 -0
  293. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_bulk.py +0 -0
  294. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_cli.py +0 -0
  295. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_detail_view.py +0 -0
  296. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_fields.py +0 -0
  297. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_plan.py +0 -0
  298. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_pools.py +0 -0
  299. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_run_resolve_by_id.py +0 -0
  300. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_schedule_and_agent.py +0 -0
  301. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ticket_speed_fixes.py +0 -0
  302. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_tier_flag_parity.py +0 -0
  303. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ui_bruteforce_guard.py +0 -0
  304. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ui_gate.py +0 -0
  305. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ui_lifespan.py +0 -0
  306. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_ui_no_native_dialogs.py +0 -0
  307. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_update_timer.py +0 -0
  308. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_updater_extras.py +0 -0
  309. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_updater_ignores_cwd.py +0 -0
  310. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_updater_pep668.py +0 -0
  311. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_updater_reports_the_truth.py +0 -0
  312. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_url_access.py +0 -0
  313. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_version_flag.py +0 -0
  314. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_vps_health.py +0 -0
  315. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_vps_only_reporting.py +0 -0
  316. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_windows_loop_identity.py +0 -0
  317. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_windows_panel_task.py +0 -0
  318. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_windows_stop_and_pidfile.py +0 -0
  319. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_windows_task_paths.py +0 -0
  320. {devops_bot_sdk-1.7.65 → devops_bot_sdk-1.7.74}/tests/test_write_hook.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devops-bot-sdk
3
- Version: 1.7.65
3
+ Version: 1.7.74
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.7.65
3
+ Version: 1.7.74
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
@@ -7,6 +7,7 @@ devops_bot_sdk.egg-info/entry_points.txt
7
7
  devops_bot_sdk.egg-info/requires.txt
8
8
  devops_bot_sdk.egg-info/top_level.txt
9
9
  sdk/__init__.py
10
+ sdk/agent_browser.py
10
11
  sdk/agent_builder.py
11
12
  sdk/agent_sharing.py
12
13
  sdk/agentd.py
@@ -180,7 +181,9 @@ tests/test_activity_macos.py
180
181
  tests/test_activity_os_setup.py
181
182
  tests/test_activity_pipeline.py
182
183
  tests/test_agent_activity.py
184
+ tests/test_agent_activity_routed_runs.py
183
185
  tests/test_agent_activity_tracking.py
186
+ tests/test_agent_browser.py
184
187
  tests/test_agent_builder.py
185
188
  tests/test_agent_chat_features.py
186
189
  tests/test_agent_crud_cli.py
@@ -276,6 +279,7 @@ tests/test_scheduler.py
276
279
  tests/test_scheduler_transient_retry.py
277
280
  tests/test_self_report.py
278
281
  tests/test_service_token_warning.py
282
+ tests/test_service_user_manager.py
279
283
  tests/test_stale_panel_restart.py
280
284
  tests/test_swagger_command.py
281
285
  tests/test_task_file_and_plan_run.py
@@ -1,6 +1,6 @@
1
1
  """AgentOS Desktop SDK — thin HTTPS/SSE client for the Electron app.
2
2
 
3
- Version: 1.7.65
3
+ Version: 1.7.74
4
4
 
5
5
  Public surface:
6
6
  BackendClient.from_config() — create client from ~/.agentos/config.toml
@@ -34,7 +34,7 @@ Rules:
34
34
  - All data egress through submit_webhook only
35
35
  """
36
36
 
37
- __version__ = "1.7.65" # SINGLE SOURCE OF TRUTH — bump on every change; pyproject,
37
+ __version__ = "1.7.74" # SINGLE SOURCE OF TRUTH — bump on every change; pyproject,
38
38
  __author__ = "AgentOS" # sdk.client.SDK_VERSION and the UI server version all read this.
39
39
 
40
40
  from sdk.client import BackendClient
@@ -521,7 +521,7 @@ def _ensure_macos() -> tuple[bool, list[str], str]:
521
521
 
522
522
  # ── Entry point ─────────────────────────────────────────────────────────────
523
523
 
524
- def ensure(apply: bool = True) -> tuple[bool, str]:
524
+ def ensure(apply: bool = True, interactive: bool = False) -> tuple[bool, str]:
525
525
  """Make this machine record human activity. ``(changed, message)``; never raises.
526
526
 
527
527
  ``changed`` is True when the panel must be restarted to pick the change up (the
@@ -529,6 +529,13 @@ def ensure(apply: bool = True) -> tuple[bool, str]:
529
529
  just switched on. The
530
530
  message is ``""`` when there was nothing to do (the normal case after the first
531
531
  run), the commands to run when unprivileged, or the reason it could not finish.
532
+
533
+ ``interactive=True`` is for a command a PERSON just ran (``agentos-ui install``,
534
+ ``agentos-auto update``): when unprivileged and a terminal is attached, it asks
535
+ for elevation itself (``sudo`` password prompt on Linux/macOS, a UAC prompt on
536
+ Windows) instead of printing commands nobody runs. That printed message is why
537
+ most installs stayed at "agent runs only". A background update (no terminal)
538
+ never prompts.
532
539
  """
533
540
  try:
534
541
  if _opted_out():
@@ -544,6 +551,11 @@ def ensure(apply: bool = True) -> tuple[bool, str]:
544
551
  return False, "" # set up already (by hand, or by an earlier run)
545
552
  if apply and sysname == "linux" and _sudo_without_password():
546
553
  return _ensure_via_sudo()
554
+ if apply and interactive and _has_terminal():
555
+ elevated = (_ensure_via_uac() if sysname == "windows"
556
+ else _ensure_via_sudo(prompt=True))
557
+ if elevated is not None:
558
+ return elevated
547
559
  import shlex
548
560
 
549
561
  cmd = " ".join(shlex.quote(a) for a in _privileged_argv())
@@ -579,14 +591,82 @@ def _sudo_without_password() -> bool:
579
591
  return _run(["sudo", "-n", "true"], timeout=15)[0] == 0
580
592
 
581
593
 
582
- def _ensure_via_sudo() -> tuple[bool, str]:
583
- """Run the privileged half as root through ``sudo -n``, as THIS user's ``SUDO_USER``.
594
+ def _has_terminal() -> bool:
595
+ """Is a person at a terminal who can answer a sudo / UAC prompt? Never raises.
596
+
597
+ Unix checks the controlling terminal, not stdin: ``curl ... | bash`` pipes the
598
+ bootstrap into stdin, yet sudo still prompts on ``/dev/tty``. A scheduled update
599
+ (systemd timer, cron, Task Scheduler) has neither, so it never prompts.
600
+ """
601
+ try:
602
+ if _system() == "windows":
603
+ return any(s is not None and s.isatty() for s in (sys.stdin, sys.stdout))
604
+ with open("/dev/tty"):
605
+ return True
606
+ except Exception: # noqa: BLE001 — no terminal
607
+ return False
608
+
609
+
610
+ def _ensure_via_uac() -> tuple[bool, str] | None:
611
+ """Windows: re-run the privileged half elevated, through a UAC prompt.
612
+
613
+ ``None`` when elevation cannot even be attempted (the caller then prints the
614
+ manual commands); a declined prompt is reported as such. Same interpreter, so
615
+ the same installation runs elevated, hidden, and is waited for.
616
+ """
617
+ before = settings.audit_enabled()
618
+ ps = shutil.which("powershell") or shutil.which("pwsh")
619
+ if not ps:
620
+ return None
621
+
622
+ def q(text: str) -> str:
623
+ return "'" + text.replace("'", "''") + "'"
624
+
625
+ print("Activity audit needs administrator rights - approve the Windows prompt "
626
+ "(UAC) to turn it on.", flush=True)
627
+ script = (
628
+ f"$p = Start-Process -FilePath {q(sys.executable)} "
629
+ "-ArgumentList '-m','sdk.activity.os_setup' -Verb RunAs -Wait -PassThru "
630
+ "-WindowStyle Hidden; exit $p.ExitCode"
631
+ )
632
+ rc, out = _run([ps, "-NoProfile", "-NonInteractive", "-Command", script], timeout=1800)
633
+ if rc != 0:
634
+ logger.warning("activity.os_setup.uac_failed rc=%s out=%s", rc, out[-300:])
635
+ if "cancel" in out.lower():
636
+ return False, ("activity audit not set up - the administrator prompt was "
637
+ "declined. Run `agentos activity-setup` from an elevated "
638
+ "PowerShell to turn it on.")
639
+ return False, f"activity audit setup incomplete (elevated run, exit {rc})"
640
+ changed = settings.audit_enabled() and not before
641
+ return changed, ("activity audit enabled (as administrator)" if changed else "")
642
+
643
+
644
+ def _ensure_via_sudo(prompt: bool = False) -> tuple[bool, str] | None:
645
+ """Run the privileged half as root through ``sudo``, as THIS user's ``SUDO_USER``.
584
646
 
585
647
  The root run writes the flag into this user's ``.env`` and grants this user the
586
648
  audit log, so the panel (this user) picks both up. Same interpreter, so the same
587
649
  installation is what runs — never whatever ``agentos`` is first on root's PATH.
650
+
651
+ ``prompt=False`` is ``sudo -n`` (never asks). ``prompt=True`` lets sudo ask for
652
+ the password on the terminal, for a command a person just ran; it returns
653
+ ``None`` when there is no ``sudo`` to ask with.
588
654
  """
589
655
  before = settings.audit_enabled()
656
+ if prompt:
657
+ if not shutil.which("sudo"):
658
+ return None
659
+ print("Activity audit needs root - sudo may ask for your password.", flush=True)
660
+ try:
661
+ # Not _run: the prompt and the setup's own output must reach the terminal.
662
+ rc = subprocess.run(["sudo", *_privileged_argv()], timeout=1800).returncode
663
+ except Exception as exc: # noqa: BLE001 — timeout, sudo vanished
664
+ return False, f"activity audit setup incomplete (via sudo): {exc}"
665
+ if rc != 0:
666
+ logger.warning("activity.os_setup.sudo_prompt_failed rc=%s", rc)
667
+ return False, f"activity audit setup incomplete (via sudo, exit {rc})"
668
+ changed = settings.audit_enabled() and not before
669
+ return changed, ("activity audit enabled (via sudo)" if changed else "")
590
670
  rc, out = _run(["sudo", "-n", *_privileged_argv()], timeout=1800)
591
671
  lines = [ln.strip() for ln in out.splitlines() if ln.strip()]
592
672
  # cli() prints the outcome first ("activity audit …") and a restart hint after it.
@@ -636,7 +716,10 @@ def _privileged_argv() -> list[str]:
636
716
 
637
717
  def cli(argv: list[str]) -> int:
638
718
  """``agentos activity-setup [--check]`` — run (or just report) the OS audit setup."""
639
- changed, msg = ensure(apply="--check" not in argv)
719
+ # Typed by a person, so ask for sudo / UAC rather than print commands. The root
720
+ # child of that prompt (and of `sudo -n`) is already privileged and never asks.
721
+ check = "--check" in argv
722
+ changed, msg = ensure(apply=not check, interactive=not check)
640
723
  if msg:
641
724
  print(msg)
642
725
  elif not changed:
@@ -0,0 +1,138 @@
1
+ """Browser automation for agent runs — ``agent-browser``, driven through Bash.
2
+
3
+ Why this exists: an agent run (a custom agent, a department agent, a ticket run)
4
+ is a headless ``claude -p`` whose tools are the configured allowlist plus the MCP
5
+ servers this machine happens to have. A VPS has no browser MCP, so an agent asked
6
+ to "log in to the DevOps Bot panel and reassign these tickets" had no way to open
7
+ a page at all. It reported that it could not log in, and nothing said why.
8
+
9
+ The SDK already ships the piece that fixes this: ``agent-browser`` (bootstrapped
10
+ on demand by ``sdk.design_verify.bootstrap`` for the design loop and the
11
+ private-link reader). It is a plain CLI, so any run with ``Bash`` can drive it —
12
+ no new tool grant, no MCP wiring, nothing that differs between ``claude`` and the
13
+ ``ad`` fallback. This module only:
14
+
15
+ 1. makes sure it is installed when a run needs it, and
16
+ 2. tells the run it exists and how to use it, including how to type a secret
17
+ without the value ever appearing in the transcript.
18
+
19
+ Install policy: if the binary is already on PATH it is advertised on every run.
20
+ If not, it is installed only for a run whose prompt looks like it needs a browser
21
+ (a URL, "browser", "log in", "website", …) — a first install can take minutes,
22
+ and most runs never open a page. A failed install is NOT silent: the run is told
23
+ the browser is unavailable and why, so it says that instead of guessing.
24
+
25
+ Off with ``AGENTOS_AGENT_BROWSER=0``. Nothing here raises.
26
+ """
27
+ from __future__ import annotations
28
+
29
+ import asyncio
30
+ import logging
31
+ import os
32
+ import re
33
+ import shutil
34
+
35
+ logger = logging.getLogger(__name__)
36
+
37
+ ENABLE_ENV = "AGENTOS_AGENT_BROWSER"
38
+ BINARY = "agent-browser"
39
+
40
+ # Words that mean "this run will open a web page". Deliberately broad: a false
41
+ # positive costs one (cached) install, a false negative is an agent that cannot
42
+ # do its job.
43
+ _NEEDS_BROWSER = re.compile(
44
+ r"https?://|\bbrowser\b|\blog ?in\b|\bsign ?in\b|\bwebsite\b|\bweb ?page\b|"
45
+ r"\bweb ?app\b|\bportal\b|\bdashboard\b|\bpanel\b|\bclick\b|\bform\b|"
46
+ r"\bplaywright\b|\bselenium\b|\bpuppeteer\b|\bscrape\b|\bnavigate\b",
47
+ re.IGNORECASE,
48
+ )
49
+
50
+ # Env keys the SDK itself sets on a run — not credentials the agent was given.
51
+ _INTERNAL_PREFIXES = ("AGENTOS_", "CLAUDE_", "ANTHROPIC_", "GH_", "GITHUB_")
52
+
53
+
54
+ def enabled() -> bool:
55
+ return os.environ.get(ENABLE_ENV, "1").strip().lower() not in ("0", "false", "no", "off")
56
+
57
+
58
+ def needs_browser(prompt: str) -> bool:
59
+ return bool(_NEEDS_BROWSER.search(prompt or ""))
60
+
61
+
62
+ async def ensure(prompt: str) -> tuple[bool, str]:
63
+ """``(available, reason)``. Installs only when the prompt needs a browser."""
64
+ if shutil.which(BINARY):
65
+ return True, "installed"
66
+ if not needs_browser(prompt):
67
+ return False, ""
68
+ try:
69
+ from sdk.design_verify.bootstrap import ensure_agent_browser
70
+ res = await asyncio.to_thread(ensure_agent_browser)
71
+ except Exception as exc: # noqa: BLE001 — a missing browser must never stop a run
72
+ logger.warning("agent_browser.bootstrap_failed err=%s", exc)
73
+ return False, str(exc)
74
+ if not res.ok:
75
+ logger.warning("agent_browser.unavailable reason=%s", res.reason)
76
+ return res.ok, res.reason
77
+
78
+
79
+ def secret_names(extra_env: dict[str, str] | None) -> list[str]:
80
+ """Names (never values) of the credentials this run was handed as env vars."""
81
+ return sorted(
82
+ k for k in (extra_env or {})
83
+ if k and k.upper() == k and not k.startswith(_INTERNAL_PREFIXES)
84
+ )
85
+
86
+
87
+ def prompt_block(available: bool, reason: str = "", secrets: list[str] | None = None) -> str:
88
+ """The note appended to a run's prompt. Empty when there is nothing to say."""
89
+ if not available:
90
+ if not reason:
91
+ return ""
92
+ return (
93
+ "=== Browser automation ===\n"
94
+ "A web browser is NOT available on this machine for this run: "
95
+ f"{reason.strip()[:300]}\n"
96
+ "If the task needs a browser, say so plainly in your result, quoting that "
97
+ "reason. Do not claim you logged in or clicked anything."
98
+ )
99
+ lines = [
100
+ "=== Browser automation (available) ===",
101
+ "You can drive a real web browser with the `agent-browser` CLI through Bash. "
102
+ "Use it for any task that needs a web page: logging in, clicking, filling "
103
+ "forms, moving or reassigning items in a web app, reading a page behind a login.",
104
+ "Core loop:",
105
+ " agent-browser open <url> # navigate",
106
+ " agent-browser snapshot -i # interactive elements with @e refs",
107
+ " agent-browser fill @e3 \"text\" # type into a field",
108
+ " agent-browser click @e5 # click",
109
+ " agent-browser press Enter # key press",
110
+ " agent-browser wait --load networkidle",
111
+ " agent-browser get text @e7 # read an element",
112
+ " agent-browser screenshot /tmp/x.png # check what the page shows",
113
+ " agent-browser close # when finished",
114
+ "Re-run `snapshot -i` after every navigation or page change: @e refs go stale. "
115
+ "Run `agent-browser --help` if a command or flag is not accepted.",
116
+ "Verify each step from the page itself (snapshot or screenshot) before "
117
+ "reporting it done. If a login fails, report the page's error message.",
118
+ ]
119
+ if secrets:
120
+ lines += [
121
+ "Credentials for this run are environment variables: "
122
+ + ", ".join(f"${n}" for n in secrets) + ".",
123
+ "Type them by reference so the value never appears in your output or the "
124
+ "log, e.g. `agent-browser fill @e2 \"$" + secrets[0] + "\"`. Never echo, "
125
+ "print or write a credential's value.",
126
+ ]
127
+ return "\n".join(lines)
128
+
129
+
130
+ async def prompt_note(prompt: str, tools: list[str], extra_env: dict[str, str] | None) -> str:
131
+ """The block for this run, or "" when the run has no Bash or the feature is off."""
132
+ if not enabled() or "Bash" not in tools:
133
+ return ""
134
+ try:
135
+ available, reason = await ensure(prompt)
136
+ return prompt_block(available, reason, secret_names(extra_env))
137
+ except Exception: # noqa: BLE001 — a note must never stop a run
138
+ return ""
@@ -300,6 +300,7 @@ async def _dispatch_agent_run(
300
300
  manifest: "AgentManifest", client: BackendClient, task: dict | None = None,
301
301
  *, auto_approve: bool = False,
302
302
  extra_variables: dict | None = None, extra_secrets: dict | None = None,
303
+ agent_id: str = "",
303
304
  ) -> dict:
304
305
  """Run ONE loaded ``AgentManifest`` end to end, for one trigger firing.
305
306
 
@@ -326,10 +327,47 @@ async def _dispatch_agent_run(
326
327
  (UI / API / CLI), where a human already clicked Run — so the agent's
327
328
  ``approval.policy`` WhatsApp gate is skipped for this single run.
328
329
 
330
+ ``agent_id`` is the backend ``agents.id`` when the caller already knows it
331
+ (an agent-routed ticket's ``agentId``). It is handed to the activity recorder
332
+ so the ``agent_activities`` row is attributed by id, not re-derived from the
333
+ name — see :func:`sdk.agents.activity.emit`.
334
+
335
+ Every exit records exactly ONE activity event — a run that executed, but also
336
+ one refused up front (missing inputs, unwired engine), one whose backend
337
+ orchestrate failed, one whose approval was not granted, and one that ended
338
+ without ever reaching ``awaiting_approval``. Before, only the "approved and
339
+ executed" branch recorded, so every other outcome of an autonomous ticket run
340
+ left nothing in ``agent_activities``.
341
+
329
342
  Returns an outcome dict — ``{status, task_id, result, ok, error}`` — for the
330
343
  on-demand callers; the daemon's trigger loops ignore the return value.
331
344
  """
332
345
  outcome: dict = {"status": "", "task_id": "", "result": "", "ok": False, "error": ""}
346
+
347
+ # How this run was triggered — carried into the `agent_activities` line so the
348
+ # feed distinguishes a cron firing from a ticket trigger from a human "Run".
349
+ _activity_kind = "run-ticket" if auto_approve else ("ticket_label" if task else "scheduled")
350
+ _ticket_id = str((task or {}).get("id") or "")
351
+ _recorded = {"done": False} # one activity event per dispatch, whatever the exit
352
+
353
+ async def _record_not_run(reason: str, task_ref: str = "") -> None:
354
+ """Record a dispatch that ended WITHOUT the agent executing.
355
+
356
+ Platform feed only (``activity.emit``), deliberately not ``record_run``:
357
+ the local usage ledger counts runs, and nothing ran. Never raises.
358
+ """
359
+ if _recorded["done"]:
360
+ return
361
+ _recorded["done"] = True
362
+ ref = task_ref or _ticket_id
363
+ try:
364
+ await activity.emit(
365
+ manifest.name, _activity_kind, {"ok": False, "error": reason}, 0.0,
366
+ client=client, detail=f"task {ref}" if ref else "",
367
+ task_id=ref, agent_id=agent_id,
368
+ )
369
+ except Exception as exc: # noqa: BLE001 — reporting must never break dispatch
370
+ logger.debug("agentd.record_not_run_failed agent=%s err=%s", manifest.name, exc)
333
371
  from sdk.agents import integrations as integrations_mod
334
372
  from sdk.agents import manifest as manifest_mod
335
373
  from sdk.agents import secrets as agent_secrets
@@ -389,6 +427,7 @@ async def _dispatch_agent_run(
389
427
  f"{'it' if len(missing) == 1 else 'them'}. Nothing was run."
390
428
  )
391
429
  logger.info("agentd.missing_inputs agent=%s missing=%s", manifest.name, missing)
430
+ await _record_not_run(f"not run — missing inputs: {', '.join(missing)}")
392
431
  return outcome
393
432
  if used_inputs:
394
433
  logger.info(
@@ -406,6 +445,7 @@ async def _dispatch_agent_run(
406
445
  "agentd.engine_not_wired engine=%s agent=%s", manifest.engine, manifest.name,
407
446
  )
408
447
  outcome["error"] = f"engine '{manifest.engine}' is not wired (only claude_code)."
448
+ await _record_not_run(f"not run — {outcome['error']}")
409
449
  return outcome
410
450
 
411
451
  prompt_text = manifest.prompt
@@ -426,14 +466,18 @@ async def _dispatch_agent_run(
426
466
  local_execution=True,
427
467
  dev_engine="claude_code",
428
468
  jira_task_id=jira_task_id,
429
- metadata={"custom_agent_id": manifest.name, "custom_agent_name": manifest.name},
469
+ metadata={
470
+ "custom_agent_id": manifest.name, "custom_agent_name": manifest.name,
471
+ # The backend `agents.id`, when known. The AI backend tags every
472
+ # pipeline activity row of this run with it (`Task identified as`,
473
+ # `Planning`, `Awaiting approval`, …) — `custom_agent_id` above is a
474
+ # NAME and cannot be used for `agent_activities.agent_id`, an FK.
475
+ **({"agent_id": agent_id} if agent_id else {}),
476
+ },
430
477
  )
431
478
 
432
479
  policy = manifest.approval.policy
433
480
  handled: set[str] = set() # session/task ids already round-tripped by this dispatch
434
- # How this run was triggered — carried into the `agent_activities` line so the
435
- # feed distinguishes a cron firing from a ticket trigger from a human "Run".
436
- _activity_kind = "run-ticket" if auto_approve else ("ticket_label" if task else "scheduled")
437
481
 
438
482
  async def _on_status_update(status: str, state: dict) -> None:
439
483
  if status != "awaiting_approval":
@@ -442,6 +486,11 @@ async def _dispatch_agent_run(
442
486
  if not task_id or task_id in handled:
443
487
  return
444
488
  handled.add(task_id)
489
+ # The activity row belongs to the TICKET. The backend's status state does
490
+ # not always carry `jira_task_id`, and then `task_id` above is the
491
+ # orchestrate SESSION id — fine for the approval_reply round-trip, wrong
492
+ # for the feed (an agent-routed run showed "task <session uuid>").
493
+ activity_task = _ticket_id or task_id
445
494
 
446
495
  if auto_approve or policy == "never":
447
496
  # No human in the loop for this run — agentd IS the approver
@@ -455,6 +504,7 @@ async def _dispatch_agent_run(
455
504
  "agentd.go_ahead_failed agent=%s task=%s err=%s",
456
505
  manifest.name, task_id, exc,
457
506
  )
507
+ await _record_not_run(f"not run — go-ahead failed: {exc}", activity_task)
458
508
  return
459
509
  else:
460
510
  # "always" / "crucial_only" — wait for the human's WhatsApp reply,
@@ -466,6 +516,8 @@ async def _dispatch_agent_run(
466
516
  "agentd.approval_not_granted agent=%s task=%s decision=%s",
467
517
  manifest.name, task_id, decision,
468
518
  )
519
+ await _record_not_run(f"not run — approval {decision or 'not granted'}",
520
+ activity_task)
469
521
  return
470
522
 
471
523
  # Approved (by agentd or by the human) — do the work on THIS machine.
@@ -565,11 +617,12 @@ async def _dispatch_agent_run(
565
617
  # reaches this function (cron schedule, ticket label, on-demand
566
618
  # run-on-ticket from the UI / CLI / desktop IPC), so a VPS agent run is
567
619
  # recorded exactly once regardless of origin — see sdk.agents.activity.
620
+ _recorded["done"] = True
568
621
  await activity.record_run(
569
622
  manifest.name, _activity_kind, local_result,
570
623
  time.monotonic() - _started, client=client,
571
- detail=f"task {task_id}" if task_id else "",
572
- task_id=task_id or "",
624
+ detail=f"task {activity_task}" if activity_task else "",
625
+ task_id=activity_task or "", agent_id=agent_id,
573
626
  )
574
627
  outcome.update({
575
628
  "task_id": task_id,
@@ -587,11 +640,14 @@ async def _dispatch_agent_run(
587
640
  _audit.agent_run_finished(
588
641
  _audit_run_id, ok=False, agent_name=manifest.name, detail=str(exc)[:500],
589
642
  )
590
- await activity.record_run(
591
- manifest.name, _activity_kind, {"ok": False, "error": str(exc)},
592
- 0.0, client=client, detail=f"task {task_id}" if task_id else "",
593
- task_id=task_id or "",
594
- )
643
+ if not _recorded["done"]:
644
+ _recorded["done"] = True
645
+ await activity.record_run(
646
+ manifest.name, _activity_kind, {"ok": False, "error": str(exc)},
647
+ 0.0, client=client,
648
+ detail=f"task {activity_task}" if activity_task else "",
649
+ task_id=activity_task or "", agent_id=agent_id,
650
+ )
595
651
  return
596
652
 
597
653
  # FINALIZE — same field names sdk.local_exec.run_claude_local's result
@@ -621,12 +677,19 @@ async def _dispatch_agent_run(
621
677
  except Exception as exc: # noqa: BLE001
622
678
  logger.warning("agentd.orchestrate_failed agent=%s err=%s", manifest.name, exc)
623
679
  outcome["error"] = str(exc)
680
+ await _record_not_run(f"not run — orchestrate failed: {str(exc)[:200]}")
624
681
  return outcome
625
682
 
626
683
  logger.info(
627
684
  "agentd.run_complete agent=%s status=%s", manifest.name, getattr(result, "status", ""),
628
685
  )
629
686
  outcome["status"] = getattr(result, "status", "") or ""
687
+ # The backend run ended without ever pausing at `awaiting_approval`, so the
688
+ # agent never executed on this machine — still one activity event, not none.
689
+ await _record_not_run(
690
+ f"not run — backend run ended with status '{outcome['status'] or 'unknown'}' "
691
+ "before the agent executed"
692
+ )
630
693
  return outcome
631
694
 
632
695
 
@@ -110,14 +110,14 @@ def drain(bucket: str) -> list[str]:
110
110
  return _LINE_BUF.pop(str(bucket), [])
111
111
 
112
112
 
113
- def _lines_block(lines: list[str]) -> str:
113
+ def _lines_block(lines: list[str], max_chars: int = _LINE_BUF_MAX_CHARS) -> str:
114
114
  """The recorded lines as one bounded block, newest-biased."""
115
- if not lines:
115
+ if not lines or max_chars <= 0:
116
116
  return ""
117
117
  out: list[str] = []
118
118
  total = 0
119
119
  for line in reversed(lines): # newest first, then re-reverse
120
- if total + len(line) + 1 > _LINE_BUF_MAX_CHARS:
120
+ if total + len(line) + 1 > max_chars:
121
121
  break
122
122
  out.append(line)
123
123
  total += len(line) + 1
@@ -209,7 +209,8 @@ def mirror_to_auto_log(name: str, kind: str, result: dict | None,
209
209
 
210
210
  async def emit(name: str, kind: str, result: dict | None, duration_s: float = 0.0,
211
211
  *, client: "BackendClient | None" = None, detail: str = "",
212
- task_id: str = "", lines: list[str] | None = None) -> bool:
212
+ task_id: str = "", lines: list[str] | None = None,
213
+ agent_id: str = "") -> bool:
213
214
  """Emit ONE ``{activity, agentId[, taskId]}`` event for a finished agent run.
214
215
 
215
216
  Returns True when the webhook accepted it, False otherwise (unknown agent,
@@ -217,12 +218,22 @@ async def emit(name: str, kind: str, result: dict | None, duration_s: float = 0.
217
218
 
218
219
  ``task_id`` attributes a ticket-triggered run to its ticket. A scheduled or
219
220
  CLI run has no ticket and omits it.
221
+
222
+ ``agent_id`` is the backend ``agents.id`` when the caller already KNOWS it —
223
+ an agent-routed ticket carries it as ``agentId``. It is used as-is, and the
224
+ NAME lookup (``resolve_agent_id``) is only the fallback. Re-deriving a known
225
+ id from the name was why agent-routed autonomous runs never reached
226
+ ``agent_activities``: routing resolves the id against the AI backend's
227
+ custom + department (+ org-common) listings, while the name lookup searches
228
+ the gateway's personal + department listing — so an agent routing could find
229
+ was "not a backend agent" here, and that miss was negative-cached for the
230
+ life of the process.
220
231
  """
221
232
  try:
222
233
  if client is None:
223
234
  from sdk.client import BackendClient
224
235
  client = BackendClient.from_config()
225
- agent_id = await client.resolve_agent_id(name)
236
+ agent_id = (agent_id or "").strip() or await client.resolve_agent_id(name)
226
237
  if not agent_id:
227
238
  # Local-only agent → not tracked. This used to return in silence,
228
239
  # which is why "the webhook never fires" had no diagnosable cause:
@@ -236,7 +247,15 @@ async def emit(name: str, kind: str, result: dict | None, duration_s: float = 0.
236
247
  "still in the local ledger and in agent_outputs/.", name)
237
248
  return False
238
249
  activity_text = describe(name, kind, result, duration_s, detail)
239
- block = _lines_block(lines or [])
250
+ # The block is budgeted against the gateway limit HERE, after the summary
251
+ # line. `client._fit_activity` keeps the TAIL of an over-long text, so
252
+ # appending an unbounded block (up to 4000 chars against a ~2000 limit)
253
+ # cut the summary off every time: each `agent_activities` row began with
254
+ # "…" mid-way through a raw stream-json event, and "Ran agent 'X' — ok"
255
+ # never reached the feed.
256
+ from sdk.client import _ACTIVITY_MAX_CHARS
257
+ budget = _ACTIVITY_MAX_CHARS - len(activity_text) - 1
258
+ block = _lines_block(lines or [], max_chars=min(_LINE_BUF_MAX_CHARS, budget))
240
259
  if block:
241
260
  activity_text += "\n" + block
242
261
  return await client.log_agent_activity(activity_text, agent_id, task_id=task_id)
@@ -247,7 +266,7 @@ async def emit(name: str, kind: str, result: dict | None, duration_s: float = 0.
247
266
 
248
267
  async def record_run(name: str, kind: str, result: dict | None, duration_s: float = 0.0,
249
268
  *, client: "BackendClient | None" = None, detail: str = "",
250
- task_id: str = "") -> None:
269
+ task_id: str = "", agent_id: str = "") -> None:
251
270
  """Record a finished run to BOTH sinks: local ledger, then platform feed.
252
271
 
253
272
  The ledger write happens first and independently of the webhook, so a
@@ -280,4 +299,4 @@ async def record_run(name: str, kind: str, result: dict | None, duration_s: floa
280
299
  lines = []
281
300
 
282
301
  await emit(name, kind, res, duration_s, client=client, detail=detail,
283
- task_id=task_id, lines=lines)
302
+ task_id=task_id, lines=lines, agent_id=agent_id)