devops-bot-sdk 1.7.62__tar.gz → 1.7.73__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.7.62 → devops_bot_sdk-1.7.73}/PKG-INFO +1 -1
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/devops_bot_sdk.egg-info/PKG-INFO +1 -1
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/devops_bot_sdk.egg-info/SOURCES.txt +4 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/__init__.py +2 -2
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/os_setup.py +83 -3
- devops_bot_sdk-1.7.73/sdk/agent_browser.py +138 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agentd.py +74 -11
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/activity.py +27 -8
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/cli.py +7 -4
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/client.py +38 -20
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/faqs.py +37 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/help_data/areas.json +40 -31
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/help_data/commands.json +1 -1
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/help_data/help.json +4 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/help_data/releases.json +50 -0
- devops_bot_sdk-1.7.73/sdk/help_data/snapshot.json +17 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/helpdesk.py +38 -2
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/helpdesk_kb.md +77 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ipc/handlers.py +87 -28
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/local_exec.py +7 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/run_auto.py +13 -3
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/tickets.py +50 -7
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/api.py +5 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/models.py +9 -2
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/server.py +3 -2
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/app.js +30 -2
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/help.html +1 -1
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/tickets.html +7 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/updater.py +3 -1
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_activity_os_setup.py +101 -1
- devops_bot_sdk-1.7.73/tests/test_agent_activity_routed_runs.py +380 -0
- devops_bot_sdk-1.7.73/tests/test_agent_browser.py +61 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_approval_park.py +21 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_panel_help.py +54 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_run_verdict_is_honest.py +72 -0
- devops_bot_sdk-1.7.73/tests/test_ticket_agent_mode.py +124 -0
- devops_bot_sdk-1.7.62/sdk/help_data/snapshot.json +0 -17
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/README.md +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/devops_bot_sdk.egg-info/dependency_links.txt +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/devops_bot_sdk.egg-info/entry_points.txt +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/devops_bot_sdk.egg-info/requires.txt +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/devops_bot_sdk.egg-info/top_level.txt +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/pyproject.toml +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/classifier.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/collectors/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/collectors/common.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/collectors/linux_auditd.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/collectors/macos_eslogger.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/collectors/windows_eventlog.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/models.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/recorder.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/redact.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/settings.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/shipper.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/activity/spool.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agent_builder.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agent_sharing.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/builder.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/chat.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/connectors.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/engines/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/engines/claude_code.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/engines/http.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/engines/mcp.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/engines/n8n.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/engines/shell.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/integrations.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/inventory.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/library/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/manifest.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/prompt_studio.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/prompt_template.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/prompt_vars.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/run_log.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/schedules.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/secrets.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/ticket_run.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/usage.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/agents/varstore.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ai_connectors.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/browser_profile.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/claude_usage.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/collectors/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/collectors/files.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/collectors/process.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/collectors/screenshot.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/config.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/crucial.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/custom_agents.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/deferred_tickets.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/departments.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/design_verify/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/design_verify/assets.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/design_verify/bootstrap.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/design_verify/browser.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/design_verify/compare.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/design_verify/loop.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/estimator.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/exceptions.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/fallback_handoff.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/firewall.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/formats.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/git_ops.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/github_fetch.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/github_ingest.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/graph_recon.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/graphify.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/help_actions.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/help_data/pages.json +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/hooks/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/hooks/crucial_guard.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/install_marker.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/instructions_template.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/intake.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ipc/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ipc/electron_bridge.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/journal.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/log_colors.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/memory_guard.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/model_policy.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/models/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/models/envelope.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/models/requests.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/models/responses.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/models/snapshots.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/phase_timer.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/plan_run.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/platform_compat.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/prd_progress.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/proof_readers.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/providers.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/py.typed +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/resume.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/router.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/schedule_tickets.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/schedule_timeline.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/scheduler.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/scope_plan.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/self_report.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/self_report_local.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/sse.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/swagger.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/task_file.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/task_types.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/test.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/test_env.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/test_pipeline.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ticket_board.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ticket_bulk.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ticket_fields.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ticket_plan.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ticket_pools.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/tiers/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/tiers/mini_agent.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/__init__.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/dashboard.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/health.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/ip_allowlist.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/jobs.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/runner.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/security.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/service.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/session.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/setup_manager.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/agents.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/chat.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/connectors.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/custom-agents.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/default-agents.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/faqs.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/index.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/new-agent.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/report.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/runs.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/schedules.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/setup.html +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/static/styles.css +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/ui/swagger.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/url_access.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/vps_health.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/vps_identity.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/sdk/write_hook.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/setup.cfg +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_activity_claude_runs.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_activity_collectors.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_activity_core.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_activity_live_tracking.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_activity_macos.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_activity_pipeline.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_activity.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_activity_tracking.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_builder.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_chat_features.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_crud_cli.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_listing.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_prompt_async.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_prompt_models.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_run_ticket.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_schedules.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_sharing.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agent_workspace_settings.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_agents_connectors_builder.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ai_connectors.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_allowed_tools_config.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_auto_agent_dispatch.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_auto_ticket_queue.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_backend_only_allowlist.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_browser_profile.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_cheap_tier.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_claude_usage_gate.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_client_jira_projects.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_config_token_diagnostics.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_configure_token_owner.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_connectors_runner.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_console_encoding.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_crash_recovery.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_create_safe_retry.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_deferred_tickets.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_departments.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_done_transition.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_epic_decompose_run.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_epic_inherited_agent_id.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_epic_session_isolation.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_estimator.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_fallback_cli.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_fallback_cli_upgrade.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_fallback_folder_changes.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_fallback_parity.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_fallback_rate_limit.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_fallback_streaming.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_faqs.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_firewall_open_on_update.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_formats.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_git_action.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_github_fetch.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_github_ingest.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_graph_off_by_default.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_graph_recon.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_graphify_build.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_graphify_hook_install.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_health.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_help_actions.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_help_attachments.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_help_questions.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_helpdesk.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_infographic_data.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_install_marker.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_instructions_template.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_intake_job_outcome.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_intake_plan_review.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_journal.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_limit_fallback_handoff.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_local_exec_provider.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_log_colors_backlog.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_mcp_route_contract.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_memory_guard.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_model_policy.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_panel_ticket_schedules.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_parallel_tickets.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_phase_timer.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_plan_ahead.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_plan_new_command.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_plan_run_activity.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_pool_pr_modes.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_pr_identity.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_prd_artifact.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_project_path_resolution.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_proof_readers.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_providers.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_quiet_run_log.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_recon_session_isolation.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_resume.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_router.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_run_auto_agent_only.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_run_outputs.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_schedule_api.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_schedule_outputs_and_plans.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_schedule_tickets.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_schedule_timeline.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_scheduler.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_scheduler_transient_retry.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_self_report.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_service_token_warning.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_stale_panel_restart.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_swagger_command.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_task_file_and_plan_run.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_task_file_format_doc.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_theme_switch.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_board.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_bulk.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_cli.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_detail_view.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_fields.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_plan.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_pools.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_run_resolve_by_id.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_schedule_and_agent.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ticket_speed_fixes.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_tier_flag_parity.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ui_bruteforce_guard.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ui_gate.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ui_lifespan.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_ui_no_native_dialogs.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_update_timer.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_updater_extras.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_updater_ignores_cwd.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_updater_pep668.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_updater_reports_the_truth.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_url_access.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_version_flag.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_vps_health.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_vps_only_reporting.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_windows_loop_identity.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_windows_panel_task.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_windows_stop_and_pidfile.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_windows_task_paths.py +0 -0
- {devops_bot_sdk-1.7.62 → devops_bot_sdk-1.7.73}/tests/test_write_hook.py +0 -0
|
@@ -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
|
|
@@ -281,6 +284,7 @@ tests/test_swagger_command.py
|
|
|
281
284
|
tests/test_task_file_and_plan_run.py
|
|
282
285
|
tests/test_task_file_format_doc.py
|
|
283
286
|
tests/test_theme_switch.py
|
|
287
|
+
tests/test_ticket_agent_mode.py
|
|
284
288
|
tests/test_ticket_board.py
|
|
285
289
|
tests/test_ticket_bulk.py
|
|
286
290
|
tests/test_ticket_cli.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""AgentOS Desktop SDK — thin HTTPS/SSE client for the Electron app.
|
|
2
2
|
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.73
|
|
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.
|
|
37
|
+
__version__ = "1.7.73" # 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
|
|
583
|
-
"""
|
|
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.
|
|
@@ -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={
|
|
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 {
|
|
572
|
-
task_id=
|
|
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
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
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 >
|
|
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
|
|
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
|
|
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)
|
|
@@ -74,14 +74,15 @@ Command surface:
|
|
|
74
74
|
|
|
75
75
|
agentos ticket create --project KEY --summary TEXT [--type T] [--priority P]
|
|
76
76
|
[--assignee EMAIL] [--description[-file] …] [--instructions[-file] …]
|
|
77
|
-
[--parent ID] [--status S] [--points N]
|
|
77
|
+
[--parent ID] [--status S] [--points N] [--agent-mode on|off]
|
|
78
78
|
File one ticket (POST /api/v1/tasks on the AI backend) and print its Jira
|
|
79
79
|
key. Type defaults to Task, priority to Medium, assignee to the token
|
|
80
|
-
owner (server-side).
|
|
80
|
+
owner (server-side). Agent mode defaults to off (runs without a WhatsApp
|
|
81
|
+
approval); `--agent-mode on` makes it wait for one. Validated locally first; a rejection prints the
|
|
81
82
|
backend's own messages.
|
|
82
83
|
agentos ticket update KEY_OR_ID [--summary …] [--description[-file] …]
|
|
83
84
|
[--instructions[-file] …] [--priority P] [--status S] [--points N]
|
|
84
|
-
[--assignee EMAIL] [--type T]
|
|
85
|
+
[--assignee EMAIL] [--type T] [--agent-mode on|off]
|
|
85
86
|
Change only the given fields (PATCH /api/v1/tasks/{id}). Takes a Jira key or
|
|
86
87
|
the platform id. See sdk.tickets — the Tickets page uses the same code.
|
|
87
88
|
agentos ticket list [--status S]… [--project KEY] [--limit N | --all] [--json]
|
|
@@ -1421,6 +1422,7 @@ _TICKET_FLAGS = {
|
|
|
1421
1422
|
"--priority": "priority", "--assignee": "assigneeEmail", "--status": "status",
|
|
1422
1423
|
"--points": "points", "--parent": "parentTaskId",
|
|
1423
1424
|
"--description": "description", "--instructions": "humanInstructions",
|
|
1425
|
+
"--agent-mode": "agentMode",
|
|
1424
1426
|
}
|
|
1425
1427
|
_TICKET_FILE_FLAGS = {"--description-file": "--description",
|
|
1426
1428
|
"--instructions-file": "--instructions"}
|
|
@@ -1437,9 +1439,10 @@ def _ticket_usage() -> None:
|
|
|
1437
1439
|
print(" agentos ticket create --project KEY --summary TEXT [--type TYPE] [--priority P]")
|
|
1438
1440
|
print(" [--assignee EMAIL] [--description TEXT | --description-file PATH]")
|
|
1439
1441
|
print(" [--instructions TEXT | --instructions-file PATH] [--parent ID] [--status S] [--points N]")
|
|
1442
|
+
print(" [--agent-mode on|off] # on = wait for a WhatsApp approval before it runs (default off)")
|
|
1440
1443
|
print(" agentos ticket update KEY_OR_ID [--summary TEXT] [--description TEXT | --description-file PATH]")
|
|
1441
1444
|
print(" [--instructions TEXT | --instructions-file PATH] [--priority P] [--status S]")
|
|
1442
|
-
print(" [--points N] [--assignee EMAIL] [--type TYPE]")
|
|
1445
|
+
print(" [--points N] [--assignee EMAIL] [--type TYPE] [--agent-mode on|off]")
|
|
1443
1446
|
print(" agentos ticket show KEY_OR_ID [--json] # summary, status, description, humanInstructions")
|
|
1444
1447
|
print(" agentos ticket bulk-update KEY… | --pool NAME [--status S] [--priority P] [--type T] [--points N]")
|
|
1445
1448
|
print(" [--assignee EMAIL] [--description TEXT|--description-file PATH] [--instructions TEXT|--instructions-file PATH]")
|