gridfleet-agent 0.1.0__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 (111) hide show
  1. gridfleet_agent-0.1.0/.gitignore +52 -0
  2. gridfleet_agent-0.1.0/PKG-INFO +99 -0
  3. gridfleet_agent-0.1.0/README.md +65 -0
  4. gridfleet_agent-0.1.0/agent_app/__init__.py +1 -0
  5. gridfleet_agent-0.1.0/agent_app/appium_process.py +1244 -0
  6. gridfleet_agent-0.1.0/agent_app/capabilities.py +137 -0
  7. gridfleet_agent-0.1.0/agent_app/cli.py +177 -0
  8. gridfleet_agent-0.1.0/agent_app/config.py +44 -0
  9. gridfleet_agent-0.1.0/agent_app/driver_doctor.py +241 -0
  10. gridfleet_agent-0.1.0/agent_app/host_telemetry.py +39 -0
  11. gridfleet_agent-0.1.0/agent_app/installer/__init__.py +1 -0
  12. gridfleet_agent-0.1.0/agent_app/installer/install.py +306 -0
  13. gridfleet_agent-0.1.0/agent_app/installer/plan.py +430 -0
  14. gridfleet_agent-0.1.0/agent_app/installer/status.py +155 -0
  15. gridfleet_agent-0.1.0/agent_app/installer/uninstall.py +86 -0
  16. gridfleet_agent-0.1.0/agent_app/installer/update.py +166 -0
  17. gridfleet_agent-0.1.0/agent_app/main.py +675 -0
  18. gridfleet_agent-0.1.0/agent_app/observability.py +101 -0
  19. gridfleet_agent-0.1.0/agent_app/pack/__init__.py +0 -0
  20. gridfleet_agent-0.1.0/agent_app/pack/adapter_dispatch.py +342 -0
  21. gridfleet_agent-0.1.0/agent_app/pack/adapter_loader.py +274 -0
  22. gridfleet_agent-0.1.0/agent_app/pack/adapter_registry.py +55 -0
  23. gridfleet_agent-0.1.0/agent_app/pack/adapter_types.py +184 -0
  24. gridfleet_agent-0.1.0/agent_app/pack/adapter_utils.py +53 -0
  25. gridfleet_agent-0.1.0/agent_app/pack/discovery.py +234 -0
  26. gridfleet_agent-0.1.0/agent_app/pack/dispatch.py +241 -0
  27. gridfleet_agent-0.1.0/agent_app/pack/host_identity.py +21 -0
  28. gridfleet_agent-0.1.0/agent_app/pack/manifest.py +182 -0
  29. gridfleet_agent-0.1.0/agent_app/pack/runtime.py +323 -0
  30. gridfleet_agent-0.1.0/agent_app/pack/runtime_policy.py +144 -0
  31. gridfleet_agent-0.1.0/agent_app/pack/runtime_registry.py +21 -0
  32. gridfleet_agent-0.1.0/agent_app/pack/sidecar_supervisor.py +259 -0
  33. gridfleet_agent-0.1.0/agent_app/pack/state.py +307 -0
  34. gridfleet_agent-0.1.0/agent_app/pack/tarball_fetch.py +108 -0
  35. gridfleet_agent-0.1.0/agent_app/pack/version_catalog.py +61 -0
  36. gridfleet_agent-0.1.0/agent_app/plugin_manager.py +185 -0
  37. gridfleet_agent-0.1.0/agent_app/py.typed +1 -0
  38. gridfleet_agent-0.1.0/agent_app/registration.py +125 -0
  39. gridfleet_agent-0.1.0/agent_app/terminal_pty.py +128 -0
  40. gridfleet_agent-0.1.0/agent_app/terminal_ws.py +145 -0
  41. gridfleet_agent-0.1.0/agent_app/tool_paths.py +58 -0
  42. gridfleet_agent-0.1.0/agent_app/tool_utils.py +101 -0
  43. gridfleet_agent-0.1.0/agent_app/tools_manager.py +428 -0
  44. gridfleet_agent-0.1.0/install.sh +380 -0
  45. gridfleet_agent-0.1.0/pyproject.toml +88 -0
  46. gridfleet_agent-0.1.0/tests/__init__.py +0 -0
  47. gridfleet_agent-0.1.0/tests/installer/test_cli_install.py +302 -0
  48. gridfleet_agent-0.1.0/tests/installer/test_install.py +433 -0
  49. gridfleet_agent-0.1.0/tests/installer/test_plan.py +179 -0
  50. gridfleet_agent-0.1.0/tests/installer/test_status.py +175 -0
  51. gridfleet_agent-0.1.0/tests/installer/test_uninstall.py +114 -0
  52. gridfleet_agent-0.1.0/tests/installer/test_update.py +252 -0
  53. gridfleet_agent-0.1.0/tests/pack/__init__.py +0 -0
  54. gridfleet_agent-0.1.0/tests/pack/conftest.py +10 -0
  55. gridfleet_agent-0.1.0/tests/pack/test_adapter_dispatch.py +864 -0
  56. gridfleet_agent-0.1.0/tests/pack/test_adapter_loader.py +466 -0
  57. gridfleet_agent-0.1.0/tests/pack/test_adapter_loader_cancel_path_leak.py +75 -0
  58. gridfleet_agent-0.1.0/tests/pack/test_adapter_loader_concurrent_load.py +76 -0
  59. gridfleet_agent-0.1.0/tests/pack/test_adapter_tarball_auth.py +89 -0
  60. gridfleet_agent-0.1.0/tests/pack/test_adapter_utils.py +33 -0
  61. gridfleet_agent-0.1.0/tests/pack/test_adapter_wiring.py +638 -0
  62. gridfleet_agent-0.1.0/tests/pack/test_appium_process_integration.py +255 -0
  63. gridfleet_agent-0.1.0/tests/pack/test_desired_manifest_features.py +50 -0
  64. gridfleet_agent-0.1.0/tests/pack/test_feature_action_routes.py +340 -0
  65. gridfleet_agent-0.1.0/tests/pack/test_host_identity.py +26 -0
  66. gridfleet_agent-0.1.0/tests/pack/test_manifest_parser.py +49 -0
  67. gridfleet_agent-0.1.0/tests/pack/test_pack_discovery_endpoint.py +88 -0
  68. gridfleet_agent-0.1.0/tests/pack/test_pack_state.py +439 -0
  69. gridfleet_agent-0.1.0/tests/pack/test_pack_state_client_auth.py +39 -0
  70. gridfleet_agent-0.1.0/tests/pack/test_pack_state_sidecar_reconcile.py +158 -0
  71. gridfleet_agent-0.1.0/tests/pack/test_runtime_github.py +133 -0
  72. gridfleet_agent-0.1.0/tests/pack/test_runtime_isolated_failures.py +107 -0
  73. gridfleet_agent-0.1.0/tests/pack/test_runtime_manager.py +198 -0
  74. gridfleet_agent-0.1.0/tests/pack/test_runtime_plugins.py +82 -0
  75. gridfleet_agent-0.1.0/tests/pack/test_runtime_policy.py +127 -0
  76. gridfleet_agent-0.1.0/tests/pack/test_sidecar_supervisor.py +441 -0
  77. gridfleet_agent-0.1.0/tests/pack/test_sidecar_supervisor_poll_stop_race.py +67 -0
  78. gridfleet_agent-0.1.0/tests/pack/test_state_loop.py +242 -0
  79. gridfleet_agent-0.1.0/tests/pack/test_state_loop_wired.py +57 -0
  80. gridfleet_agent-0.1.0/tests/pack/test_tarball_fetch.py +90 -0
  81. gridfleet_agent-0.1.0/tests/pack/test_tarball_fetch_concurrent_dedup.py +155 -0
  82. gridfleet_agent-0.1.0/tests/pack/test_version_catalog.py +37 -0
  83. gridfleet_agent-0.1.0/tests/test_agent_api.py +523 -0
  84. gridfleet_agent-0.1.0/tests/test_agent_api_more.py +311 -0
  85. gridfleet_agent-0.1.0/tests/test_appium_process.py +1190 -0
  86. gridfleet_agent-0.1.0/tests/test_appium_process_port_alloc_race.py +59 -0
  87. gridfleet_agent-0.1.0/tests/test_appium_process_restart_stop_race.py +86 -0
  88. gridfleet_agent-0.1.0/tests/test_appium_process_stop_start_lock_race.py +75 -0
  89. gridfleet_agent-0.1.0/tests/test_appium_process_watch_stop_race.py +67 -0
  90. gridfleet_agent-0.1.0/tests/test_capabilities.py +93 -0
  91. gridfleet_agent-0.1.0/tests/test_capabilities_more.py +76 -0
  92. gridfleet_agent-0.1.0/tests/test_cli.py +39 -0
  93. gridfleet_agent-0.1.0/tests/test_config.py +25 -0
  94. gridfleet_agent-0.1.0/tests/test_config_runtime_root.py +14 -0
  95. gridfleet_agent-0.1.0/tests/test_driver_doctor.py +142 -0
  96. gridfleet_agent-0.1.0/tests/test_host_telemetry.py +60 -0
  97. gridfleet_agent-0.1.0/tests/test_install_script.py +54 -0
  98. gridfleet_agent-0.1.0/tests/test_no_driver_imports.py +45 -0
  99. gridfleet_agent-0.1.0/tests/test_observability.py +49 -0
  100. gridfleet_agent-0.1.0/tests/test_package_metadata.py +15 -0
  101. gridfleet_agent-0.1.0/tests/test_plugin_manager.py +82 -0
  102. gridfleet_agent-0.1.0/tests/test_plugin_manager_more.py +215 -0
  103. gridfleet_agent-0.1.0/tests/test_registration.py +203 -0
  104. gridfleet_agent-0.1.0/tests/test_terminal_pty.py +59 -0
  105. gridfleet_agent-0.1.0/tests/test_terminal_ws.py +90 -0
  106. gridfleet_agent-0.1.0/tests/test_tools_and_utilities_more.py +218 -0
  107. gridfleet_agent-0.1.0/tests/test_tools_manager.py +169 -0
  108. gridfleet_agent-0.1.0/tests/test_tools_manager_extra.py +58 -0
  109. gridfleet_agent-0.1.0/uninstall.sh +75 -0
  110. gridfleet_agent-0.1.0/update.sh +40 -0
  111. gridfleet_agent-0.1.0/uv.lock +931 -0
@@ -0,0 +1,52 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .venv/
7
+ venv/
8
+ *.egg-info/
9
+ *.egg
10
+
11
+ # Testing
12
+ .pytest_cache/
13
+ .coverage
14
+ htmlcov/
15
+
16
+ # Frontend
17
+ frontend/node_modules/
18
+ frontend/dist/
19
+
20
+ # IDE
21
+ .idea/
22
+ .vscode/
23
+ *.swp
24
+ *.swo
25
+
26
+ # Environment
27
+ .env
28
+ .env.local
29
+ .env.*.local
30
+
31
+ # OS
32
+ .DS_Store
33
+ Thumbs.db
34
+
35
+ # Playwright
36
+ .playwright-mcp/
37
+
38
+
39
+ # Build output
40
+ dist/
41
+
42
+ # Misc
43
+ *.log
44
+ .idea
45
+ testing/screenshots
46
+ frontend/test-results
47
+
48
+ # Worktrees
49
+ .worktrees/
50
+
51
+ # Superpowers working docs
52
+ .superpowers/
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.4
2
+ Name: gridfleet-agent
3
+ Version: 0.1.0
4
+ Summary: GridFleet agent — runs on each host
5
+ Project-URL: Homepage, https://github.com/quidow/gridfleet
6
+ Project-URL: Repository, https://github.com/quidow/gridfleet
7
+ Project-URL: Documentation, https://github.com/quidow/gridfleet/tree/main/docs
8
+ Project-URL: Issues, https://github.com/quidow/gridfleet/issues
9
+ Project-URL: Security, https://github.com/quidow/gridfleet/security/advisories/new
10
+ Author: GridFleet contributors
11
+ License-Expression: Apache-2.0
12
+ Keywords: appium,gridfleet,selenium,testing
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Framework :: FastAPI
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: fastapi==0.136.1
22
+ Requires-Dist: httpx==0.28.1
23
+ Requires-Dist: packaging>=26.2
24
+ Requires-Dist: psutil==7.2.2
25
+ Requires-Dist: pydantic-settings==2.14.0
26
+ Requires-Dist: uvicorn[standard]==0.46.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: mypy>=1.20.2; extra == 'dev'
29
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
30
+ Requires-Dist: pytest-cov>=6.0; extra == 'dev'
31
+ Requires-Dist: pytest>=9.0.3; extra == 'dev'
32
+ Requires-Dist: ruff>=0.15.12; extra == 'dev'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # GridFleet Agent
36
+
37
+ `gridfleet-agent` is the host-side service package for GridFleet device hosts.
38
+
39
+ This package currently provides the runnable agent service entry point:
40
+
41
+ ```bash
42
+ gridfleet-agent serve
43
+ ```
44
+
45
+ It also provides a safe installer preview:
46
+
47
+ ```bash
48
+ gridfleet-agent install --dry-run --manager-url http://manager.example.com:8000
49
+ ```
50
+
51
+ The dry run performs host-tool discovery and renders the planned `config.env` and service definition without writing files or starting services.
52
+
53
+ Real installs use a dedicated virtual environment under `/opt/gridfleet-agent/venv`:
54
+
55
+ ```bash
56
+ python3 -m venv /opt/gridfleet-agent/venv
57
+ /opt/gridfleet-agent/venv/bin/pip install gridfleet-agent
58
+ /opt/gridfleet-agent/venv/bin/gridfleet-agent install --no-start --manager-url http://manager.example.com:8000
59
+ ```
60
+
61
+ `--no-start` writes the config and service files but does not enable or start the host service yet.
62
+
63
+ To also enable/start the service and poll local health:
64
+
65
+ ```bash
66
+ /opt/gridfleet-agent/venv/bin/gridfleet-agent install --start --manager-url http://manager.example.com:8000
67
+ ```
68
+
69
+ After local health passes, `--start` also checks whether the host appears in the manager host list. Pending registration is reported as a warning because host approval may still require operator action.
70
+
71
+ For a one-command bootstrap from a release checkout or raw GitHub URL:
72
+
73
+ ```bash
74
+ VERSION=0.3.0 sudo -E bash scripts/install-agent.sh --manager-url http://manager.example.com:8000
75
+ ```
76
+
77
+ Inspect local installation state without changing anything:
78
+
79
+ ```bash
80
+ gridfleet-agent status
81
+ ```
82
+
83
+ The status command reads `config.env`, checks the local service manager when available, polls local health, and redacts stored secrets.
84
+
85
+ Upgrade the dedicated agent venv package and restart the host service:
86
+
87
+ ```bash
88
+ sudo -E /opt/gridfleet-agent/venv/bin/gridfleet-agent update --to 0.3.0
89
+ ```
90
+
91
+ The update command waits for local Appium nodes reported by `/agent/health` to drain before upgrading the package or restarting the service. Use `gridfleet-agent update --dry-run --to 0.3.0` to preview the drain, pip upgrade, service restart, and local health-check steps.
92
+
93
+ Uninstall requires explicit confirmation:
94
+
95
+ ```bash
96
+ gridfleet-agent uninstall --yes
97
+ ```
98
+
99
+ Use `--keep-config` or `--keep-agent-dir` when you want to preserve local configuration or downloaded runtime state.
@@ -0,0 +1,65 @@
1
+ # GridFleet Agent
2
+
3
+ `gridfleet-agent` is the host-side service package for GridFleet device hosts.
4
+
5
+ This package currently provides the runnable agent service entry point:
6
+
7
+ ```bash
8
+ gridfleet-agent serve
9
+ ```
10
+
11
+ It also provides a safe installer preview:
12
+
13
+ ```bash
14
+ gridfleet-agent install --dry-run --manager-url http://manager.example.com:8000
15
+ ```
16
+
17
+ The dry run performs host-tool discovery and renders the planned `config.env` and service definition without writing files or starting services.
18
+
19
+ Real installs use a dedicated virtual environment under `/opt/gridfleet-agent/venv`:
20
+
21
+ ```bash
22
+ python3 -m venv /opt/gridfleet-agent/venv
23
+ /opt/gridfleet-agent/venv/bin/pip install gridfleet-agent
24
+ /opt/gridfleet-agent/venv/bin/gridfleet-agent install --no-start --manager-url http://manager.example.com:8000
25
+ ```
26
+
27
+ `--no-start` writes the config and service files but does not enable or start the host service yet.
28
+
29
+ To also enable/start the service and poll local health:
30
+
31
+ ```bash
32
+ /opt/gridfleet-agent/venv/bin/gridfleet-agent install --start --manager-url http://manager.example.com:8000
33
+ ```
34
+
35
+ After local health passes, `--start` also checks whether the host appears in the manager host list. Pending registration is reported as a warning because host approval may still require operator action.
36
+
37
+ For a one-command bootstrap from a release checkout or raw GitHub URL:
38
+
39
+ ```bash
40
+ VERSION=0.3.0 sudo -E bash scripts/install-agent.sh --manager-url http://manager.example.com:8000
41
+ ```
42
+
43
+ Inspect local installation state without changing anything:
44
+
45
+ ```bash
46
+ gridfleet-agent status
47
+ ```
48
+
49
+ The status command reads `config.env`, checks the local service manager when available, polls local health, and redacts stored secrets.
50
+
51
+ Upgrade the dedicated agent venv package and restart the host service:
52
+
53
+ ```bash
54
+ sudo -E /opt/gridfleet-agent/venv/bin/gridfleet-agent update --to 0.3.0
55
+ ```
56
+
57
+ The update command waits for local Appium nodes reported by `/agent/health` to drain before upgrading the package or restarting the service. Use `gridfleet-agent update --dry-run --to 0.3.0` to preview the drain, pip upgrade, service restart, and local health-check steps.
58
+
59
+ Uninstall requires explicit confirmation:
60
+
61
+ ```bash
62
+ gridfleet-agent uninstall --yes
63
+ ```
64
+
65
+ Use `--keep-config` or `--keep-agent-dir` when you want to preserve local configuration or downloaded runtime state.
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"