agent-shell-py 0.4.0__tar.gz → 0.5.1__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 (194) hide show
  1. agent_shell_py-0.5.1/.github/dependabot.yml +44 -0
  2. agent_shell_py-0.5.1/.github/workflows/build.yml +46 -0
  3. agent_shell_py-0.5.1/.github/workflows/ci.yml +42 -0
  4. agent_shell_py-0.5.1/.github/workflows/nix-cache.yml +91 -0
  5. agent_shell_py-0.5.1/.github/workflows/nix-check.yml +36 -0
  6. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/.github/workflows/publish.yml +2 -2
  7. agent_shell_py-0.5.1/.gitignore +27 -0
  8. agent_shell_py-0.5.1/AGENTS.md +154 -0
  9. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/PKG-INFO +6 -1
  10. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/README.md +5 -0
  11. agent_shell_py-0.5.1/default.nix +11 -0
  12. agent_shell_py-0.5.1/docs/architecture/class_diagram.md +501 -0
  13. agent_shell_py-0.5.1/docs/architecture/dependency_boundaries.md +88 -0
  14. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/docs/development/agent_parameter_comparison.md +113 -1
  15. agent_shell_py-0.5.1/docs/development/import_linter_audit.md +79 -0
  16. agent_shell_py-0.5.1/docs/development/issue_25_plan.md +64 -0
  17. agent_shell_py-0.5.1/docs/development/package_management.md +64 -0
  18. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/docs/examples.md +138 -1
  19. agent_shell_py-0.5.1/docs/nix.md +124 -0
  20. agent_shell_py-0.5.1/flake.lock +161 -0
  21. agent_shell_py-0.5.1/flake.nix +376 -0
  22. agent_shell_py-0.5.1/pyproject.toml +133 -0
  23. agent_shell_py-0.5.1/shell.nix +2 -0
  24. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/__init__.py +4 -1
  25. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/_version.py +2 -2
  26. agent_shell_py-0.5.1/src/agent_shell/adapters/agent_adapter_protocol.py +3 -0
  27. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/claude_code_adapter.py +46 -30
  28. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/codex_adapter.py +25 -29
  29. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/copilot_cli_adapter.py +38 -33
  30. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/cursor_adapter.py +31 -30
  31. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/grok_adapter.py +27 -27
  32. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/opencode_adapter.py +37 -31
  33. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/pi_adapter.py +76 -30
  34. agent_shell_py-0.5.1/src/agent_shell/adapters/pi_resources.py +97 -0
  35. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/response.py +15 -3
  36. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/tool_denial.py +6 -0
  37. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/execution.py +7 -79
  38. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/interactive.py +43 -34
  39. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/interactive_terminal.py +117 -64
  40. agent_shell_py-0.5.1/src/agent_shell/models/resources.py +25 -0
  41. agent_shell_py-0.5.1/src/agent_shell/ports/__init__.py +1 -0
  42. agent_shell_py-0.4.0/src/agent_shell/adapters/agent_adapter_protocol.py → agent_shell_py-0.5.1/src/agent_shell/ports/agent.py +7 -2
  43. agent_shell_py-0.5.1/src/agent_shell/ports/execution.py +84 -0
  44. agent_shell_py-0.5.1/src/agent_shell/ports/interactive.py +68 -0
  45. agent_shell_py-0.5.1/src/agent_shell/ports/resources.py +28 -0
  46. agent_shell_py-0.5.1/src/agent_shell/resources.py +162 -0
  47. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/shell.py +65 -33
  48. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/tmux.py +101 -1
  49. agent_shell_py-0.5.1/tests/e2e/test_interactive_attachment_e2e.py +60 -0
  50. agent_shell_py-0.5.1/tests/e2e/test_session_resources_e2e.py +190 -0
  51. agent_shell_py-0.5.1/tests/integration/test_architecture.py +296 -0
  52. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_execution_host.py +1 -1
  53. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_herdr_execution_host.py +10 -10
  54. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_interactive_agents.py +1 -1
  55. agent_shell_py-0.5.1/tests/integration/test_interactive_attachment.py +342 -0
  56. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_interactive_terminal.py +5 -3
  57. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_process_lifecycle.py +1 -1
  58. agent_shell_py-0.5.1/tests/integration/test_session_resources.py +779 -0
  59. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_terminal_window_execution_host.py +3 -3
  60. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_tmux_execution_host.py +3 -3
  61. agent_shell_py-0.5.1/tests/unit/test_interactive_attachment.py +93 -0
  62. agent_shell_py-0.5.1/tests/unit/test_port_exports.py +36 -0
  63. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_shell.py +10 -10
  64. agent_shell_py-0.5.1/tests/unit/test_shell_cancellation.py +32 -0
  65. agent_shell_py-0.5.1/uv.lock +244 -0
  66. agent_shell_py-0.4.0/.github/workflows/build.yml +0 -35
  67. agent_shell_py-0.4.0/.github/workflows/ci.yml +0 -29
  68. agent_shell_py-0.4.0/.gitignore +0 -11
  69. agent_shell_py-0.4.0/AGENTS.md +0 -310
  70. agent_shell_py-0.4.0/docs/development/package_management.md +0 -24
  71. agent_shell_py-0.4.0/pyproject.toml +0 -33
  72. agent_shell_py-0.4.0/tests/unit/test_shell_cancellation.py +0 -72
  73. agent_shell_py-0.4.0/uv.lock +0 -104
  74. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/.python-version +0 -0
  75. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/LICENSE +0 -0
  76. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/docs/assets/agentshell-banner.png +0 -0
  77. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/docs/assets/agentshell-banner.svg +0 -0
  78. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/docs/development/disabled_tools.md +0 -0
  79. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/docs/development/info.md +0 -0
  80. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/docs/development/total_token_count.md +0 -0
  81. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/examples/interactive_demo.py +0 -0
  82. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/skills/delegating-code-review/SKILL.md +0 -0
  83. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/skills/invoking-cli-agents/SKILL.md +0 -0
  84. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/skills/invoking-cli-agents/api-reference.md +0 -0
  85. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/__init__.py +0 -0
  86. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/health.py +0 -0
  87. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/model_discovery.py +0 -0
  88. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/outcome.py +0 -0
  89. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/process_failure.py +0 -0
  90. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/adapters/stderr_format.py +0 -0
  91. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/herdr.py +0 -0
  92. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/herdr_protocol.py +0 -0
  93. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/herdr_worker.py +0 -0
  94. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/interactive_event_writer.py +0 -0
  95. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/interactive_worker.py +0 -0
  96. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/models/__init__.py +0 -0
  97. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/models/agent.py +0 -0
  98. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/process_cleanup.py +0 -0
  99. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/process_guardian.py +0 -0
  100. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/terminal_protocol.py +0 -0
  101. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/terminal_window.py +0 -0
  102. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/terminal_worker.py +0 -0
  103. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/tmux_bridge.py +0 -0
  104. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/tmux_ownership.py +0 -0
  105. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/src/agent_shell/tmux_protocol.py +0 -0
  106. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/__init__.py +0 -0
  107. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/conftest.py +0 -0
  108. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/__init__.py +0 -0
  109. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_claude_code_e2e.py +0 -0
  110. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_codex_e2e.py +0 -0
  111. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_copilot_cli_e2e.py +0 -0
  112. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_cursor_e2e.py +0 -0
  113. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_execution_host_e2e.py +0 -0
  114. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_grok_e2e.py +0 -0
  115. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_health_check_e2e.py +0 -0
  116. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_interactive_harness_e2e.py +0 -0
  117. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_model_discovery_e2e.py +0 -0
  118. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_opencode_e2e.py +0 -0
  119. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_pi_e2e.py +0 -0
  120. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_pi_packages_e2e.py +0 -0
  121. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_terminal_window_execution_host_e2e.py +0 -0
  122. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/e2e/test_tmux_execution_host_e2e.py +0 -0
  123. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/__init__.py +0 -0
  124. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_claude_code_integration.py +0 -0
  125. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_claude_code_mcp_integration.py +0 -0
  126. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_codex_integration.py +0 -0
  127. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_codex_mcp_integration.py +0 -0
  128. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_copilot_cli_integration.py +0 -0
  129. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_copilot_cli_mcp_integration.py +0 -0
  130. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_cursor_integration.py +0 -0
  131. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_cursor_mcp_integration.py +0 -0
  132. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_grok_integration.py +0 -0
  133. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_grok_mcp_integration.py +0 -0
  134. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_health_check_integration.py +0 -0
  135. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_model_discovery_integration.py +0 -0
  136. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_opencode_integration.py +0 -0
  137. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_opencode_mcp_integration.py +0 -0
  138. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_packages_unsupported.py +0 -0
  139. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_pi_integration.py +0 -0
  140. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_pi_mcp_integration.py +0 -0
  141. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/integration/test_pi_packages.py +0 -0
  142. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/__init__.py +0 -0
  143. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/adapter_matrix.py +0 -0
  144. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/codex_fixtures.py +0 -0
  145. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/copilot_fixtures.py +0 -0
  146. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/cursor_fixtures.py +0 -0
  147. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/fixtures.py +0 -0
  148. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/grok_fixtures.py +0 -0
  149. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/opencode_fixtures.py +0 -0
  150. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/pi_fixtures.py +0 -0
  151. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_adapter_transport.py +0 -0
  152. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_cancel.py +0 -0
  153. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_codex_cancel.py +0 -0
  154. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_codex_execute.py +0 -0
  155. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_codex_parse_event.py +0 -0
  156. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_codex_warnings.py +0 -0
  157. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_copilot_cli_cancel.py +0 -0
  158. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_copilot_cli_execute.py +0 -0
  159. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_copilot_cli_parse_event.py +0 -0
  160. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_copilot_cli_stream.py +0 -0
  161. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_cursor_cancel.py +0 -0
  162. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_cursor_execute.py +0 -0
  163. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_cursor_parse_event.py +0 -0
  164. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_cursor_warnings.py +0 -0
  165. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_execute.py +0 -0
  166. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_execute_outcome.py +0 -0
  167. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_grok_cancel.py +0 -0
  168. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_grok_execute.py +0 -0
  169. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_grok_parse_event.py +0 -0
  170. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_grok_warnings.py +0 -0
  171. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_health_probe.py +0 -0
  172. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_mcp_server_spec.py +0 -0
  173. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_model_discovery.py +0 -0
  174. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_models.py +0 -0
  175. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_opencode_cancel.py +0 -0
  176. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_opencode_execute.py +0 -0
  177. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_opencode_parse_event.py +0 -0
  178. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_opencode_spawn.py +0 -0
  179. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_opencode_stream.py +0 -0
  180. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_package_spec.py +0 -0
  181. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_parse_event.py +0 -0
  182. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_pi_cancel.py +0 -0
  183. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_pi_execute.py +0 -0
  184. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_pi_parse_event.py +0 -0
  185. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_pi_warnings.py +0 -0
  186. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_process_cleanup.py +0 -0
  187. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_process_group_registration.py +0 -0
  188. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_public_exports.py +0 -0
  189. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_response_aggregation.py +0 -0
  190. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_shell_mcp.py +0 -0
  191. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_stderr_format.py +0 -0
  192. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_stream.py +0 -0
  193. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_terminal_window_execution_host.py +0 -0
  194. {agent_shell_py-0.4.0 → agent_shell_py-0.5.1}/tests/unit/test_tool_denial.py +0 -0
@@ -0,0 +1,44 @@
1
+ # Dependabot version updates for the flake inputs and pinned Actions.
2
+ #
3
+ # Python dependencies are deliberately NOT listed for scheduled version
4
+ # updates. The package has zero runtime requirements; Nix consumes the locked
5
+ # dev group from uv.lock, so routine bumps churn that closure without changing
6
+ # the library's runtime. Dependabot security updates require the repository's
7
+ # dependency graph and Dependabot alerts to be enabled, and target known
8
+ # advisories.
9
+ #
10
+ # Two limits of the `nix` ecosystem, so a future reader does not rediscover
11
+ # them: it updates flake.lock only and never a ref pinned in flake.nix, and it
12
+ # does not run on private repositories.
13
+ #
14
+ # For github-actions updates, Dependabot rewrites a trailing version comment
15
+ # when it recognizes the existing version and the new SHA maps to a recognized
16
+ # version tag. Otherwise it may leave the old annotation unchanged.
17
+ #
18
+ # Docs: https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
19
+ version: 2
20
+ updates:
21
+ # nix flake inputs: flake.nix and flake.lock
22
+ - package-ecosystem: "nix"
23
+ directory: "/"
24
+ schedule:
25
+ interval: "weekly"
26
+ # Group all input bumps into one PR per week so a routine refresh costs one
27
+ # review rather than one per input. The pyproject-nix trio is follows-linked,
28
+ # so bumping them together is also the only way to test a compatible set.
29
+ groups:
30
+ flake-inputs:
31
+ patterns:
32
+ - "*"
33
+ open-pull-requests-limit: 5
34
+ commit-message:
35
+ prefix: "chore(deps)"
36
+
37
+ # GitHub Actions, including the SHA-pinned actions in the publishing jobs.
38
+ - package-ecosystem: "github-actions"
39
+ directory: "/.github/workflows"
40
+ schedule:
41
+ interval: "weekly"
42
+ open-pull-requests-limit: 5
43
+ commit-message:
44
+ prefix: "chore(deps)"
@@ -0,0 +1,46 @@
1
+ name: Build
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
+ with:
21
+ fetch-depth: 0
22
+ persist-credentials: false
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
26
+
27
+ - name: Set up Python 3.12
28
+ run: uv python install 3.12
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --locked --group dev
32
+
33
+ - name: Check architecture boundaries
34
+ run: uv run --no-sync lint-imports --no-cache
35
+
36
+ - name: Run unit and integration tests
37
+ run: uv run --no-sync pytest tests/unit tests/integration -v
38
+
39
+ - name: Build package
40
+ run: uv build
41
+
42
+ - name: Upload build artifacts
43
+ uses: actions/upload-artifact@v7
44
+ with:
45
+ name: dist
46
+ path: dist/
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["**"]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ python-version: ["3.12"]
23
+
24
+ steps:
25
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26
+ with:
27
+ persist-credentials: false
28
+
29
+ - name: Install uv
30
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
31
+
32
+ - name: Set up Python ${{ matrix.python-version }}
33
+ run: uv python install ${{ matrix.python-version }}
34
+
35
+ - name: Install dependencies
36
+ run: uv sync --locked --group dev
37
+
38
+ - name: Check architecture boundaries
39
+ run: uv run --no-sync lint-imports --no-cache
40
+
41
+ - name: Run unit and integration tests
42
+ run: uv run --no-sync pytest tests/unit tests/integration -v
@@ -0,0 +1,91 @@
1
+ name: Nix Cache
2
+
3
+ # Publishes the Nix-built package and the `nix flake check` closures to Cachix so
4
+ # contributor dev shells and later CI jobs substitute instead of rebuilding the
5
+ # uv2nix Python environment.
6
+ #
7
+ # Pull requests never publish here: forks have no token, and unmerged artifacts
8
+ # should not land in a shared cache.
9
+ on:
10
+ push:
11
+ branches:
12
+ - main
13
+ workflow_dispatch: null
14
+
15
+ permissions: {}
16
+
17
+ concurrency:
18
+ group: nix-cache
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ publish:
23
+ # Forks never have the token and must not publish; a manual dispatch only
24
+ # publishes when it runs on the default branch of the upstream repository.
25
+ if: >-
26
+ github.repository == 'ScottRBK/agent-shell' &&
27
+ (github.event_name == 'push' || github.ref == 'refs/heads/main')
28
+ runs-on: ubuntu-latest
29
+ # Cold cache builds the uv2nix closure plus the check environments.
30
+ timeout-minutes: 60
31
+ permissions:
32
+ contents: read
33
+ steps:
34
+ # This job receives the CACHIX_AUTH_TOKEN write secret, so the actions it
35
+ # runs are pinned by commit SHA rather than by mutable tag.
36
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
37
+ with:
38
+ persist-credentials: false
39
+
40
+ # v31.11.3: the bundled installer certificate bundle was updated to drop
41
+ # compromised certificates. Pinned by SHA for the same reason as above.
42
+ - name: Install Nix
43
+ uses: cachix/install-nix-action@3dc140bfc76c49fbd4dd958429132e3746bcb086 # v31.11.5
44
+ with:
45
+ extra_nix_config: |
46
+ experimental-features = nix-command flakes
47
+
48
+ # Fail loudly instead of silently "publishing" nothing: cachix-action
49
+ # falls back to a read-only pull when the token is absent.
50
+ - name: Check CACHIX_AUTH_TOKEN
51
+ env:
52
+ CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
53
+ run: |
54
+ if [ -z "$CACHIX_AUTH_TOKEN" ]; then
55
+ echo "::error::repository secret CACHIX_AUTH_TOKEN is not set"
56
+ exit 1
57
+ fi
58
+
59
+ # cachix-action otherwise uses a cachix already on PATH or installs one
60
+ # from the mutable https://cachix.org/api/v1/install endpoint. Pinning the
61
+ # action alone leaves that executable unpinned while it holds the write
62
+ # token, so resolve one from the nixpkgs revision this flake locks: it is
63
+ # content-addressed, reviewable in flake.lock, and substituted rather than
64
+ # downloaded from an endpoint that can change under us.
65
+ - name: Resolve pinned cachix
66
+ id: cachix
67
+ run: |
68
+ set -euo pipefail
69
+ rev=$(nix eval --raw --impure \
70
+ --expr '(builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked.rev')
71
+ out=$(nix build --no-link --print-out-paths "github:NixOS/nixpkgs/${rev}#cachix")
72
+ echo "cachix from nixpkgs ${rev}: ${out}"
73
+ echo "bin=${out}/bin/cachix" >> "$GITHUB_OUTPUT"
74
+
75
+ # Installs a post-build hook, so every store path built below is pushed
76
+ # as it is produced.
77
+ - name: Publish to Cachix
78
+ uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17
79
+ with:
80
+ name: agent-shell
81
+ authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
82
+ cachixBin: ${{ steps.cachix.outputs.bin }}
83
+
84
+ - name: Build and publish the package
85
+ run: nix build .#agent-shell-py
86
+
87
+ # The check closures are the valuable half of the cache: they carry the
88
+ # uv2nix-built environment and pinned tool set that every later
89
+ # `nix flake check` would otherwise rebuild from scratch.
90
+ - name: Build and publish the check environments
91
+ run: nix flake check
@@ -0,0 +1,36 @@
1
+ name: Nix check
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ flake-check:
18
+ runs-on: ubuntu-latest
19
+ # The publisher allows 60 minutes for a cold Nix closure build; use the same
20
+ # budget here so a lock refresh does not turn a slow check into a false fail.
21
+ timeout-minutes: 60
22
+ steps:
23
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24
+ with:
25
+ persist-credentials: false
26
+
27
+ # No project Cachix substituter is configured in this workflow, so its
28
+ # project-specific check outputs, including tests, must be built here.
29
+ - name: Install Nix
30
+ uses: cachix/install-nix-action@75c75c31ebece974e48ebc36b4ad125bd97bd97b1 # v31.11.3
31
+ with:
32
+ extra_nix_config: |
33
+ experimental-features = nix-command flakes
34
+
35
+ - name: Run flake checks
36
+ run: nix flake check
@@ -12,12 +12,12 @@ jobs:
12
12
  id-token: write # Required for trusted publishing
13
13
 
14
14
  steps:
15
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
15
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16
16
  with:
17
17
  fetch-depth: 0
18
18
 
19
19
  - name: Install uv
20
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
20
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
21
21
 
22
22
  - name: Build package
23
23
  run: uv build
@@ -0,0 +1,27 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+ src/agent_shell/_version.py
9
+
10
+ # Virtual environments
11
+ .venv
12
+
13
+ # Local Pi workspace data
14
+ /.pi/
15
+
16
+ # Local credentials
17
+ /.env
18
+
19
+ # Local SonarQube configuration and scanner output
20
+ /.sonarqube/
21
+
22
+ # Nix build results
23
+ result
24
+ result-*
25
+
26
+ # Generated by git-hooks.nix
27
+ .pre-commit-config.yaml
@@ -0,0 +1,154 @@
1
+ # Agent Shell
2
+
3
+ A lightweight, async Python package that executes CLI coding agents headlessly and returns output
4
+ through a unified interface. Each agent's CLI differences are hidden behind a common adapter
5
+ protocol, so consuming code never changes regardless of which agent is running underneath.
6
+
7
+ ## Architecture
8
+
9
+ Before any planning, discussion of solution or code change work begins, you must read the
10
+ [architecture class diagram](docs/architecture/class_diagram.md). It documents the interfaces,
11
+ execution hosts, isolation policies, interactive sessions, and API behaviour.
12
+
13
+ Keep agent-specific CLI flags, raw output parsing, configuration formats, and workarounds in
14
+ that agent's adapter or agent-specific helpers. Shared code must use protocols and normalised
15
+ models, not agent-name branches, concrete-adapter checks, private adapter state, or copied
16
+ agent-specific logic. Host-specific terminal/process details belong in execution hosts.
17
+ Concrete agent-adapter imports are permitted only in `shell.py` for construction/selection;
18
+ shared helpers under `adapters/` are not exempt. Import Linter contracts in `pyproject.toml`
19
+ enforce the [dependency boundaries](docs/architecture/dependency_boundaries.md), including
20
+ indirect imports. New inner code uses `ports/`, not implementation-bearing compatibility
21
+ facades. New top-level modules and adapter helpers must be classified in the contracts.
22
+ Review must still catch copied agent-specific logic and dynamic imports.
23
+ If a shared contract cannot express a feature, discuss the boundary change before adding a
24
+ workaround or weakening the test.
25
+
26
+ ## Supported Agents
27
+
28
+ - [x] Claude Code
29
+ - [x] OpenCode
30
+ - [x] Copilot CLI
31
+ - [x] Codex
32
+ - [x] Pi
33
+ - [x] Cursor
34
+ - [x] Grok
35
+
36
+ ## MCP Server Configuration
37
+
38
+ `AgentShell` exposes a unified API for registering MCP servers across all supported agents:
39
+
40
+ ```python
41
+ from agent_shell.shell import AgentShell
42
+ from agent_shell.models.agent import AgentType, MCPServerSpec, MCPServerType
43
+
44
+ shell = AgentShell(agent_type=AgentType.CLAUDE_CODE)
45
+
46
+ await shell.add_mcp_server(MCPServerSpec(
47
+ name="forgetful",
48
+ type=MCPServerType.STDIO,
49
+ command="uvx",
50
+ args=["forgetful-ai"],
51
+ env={"FORGETFUL_API_KEY": "..."},
52
+ ))
53
+ ```
54
+
55
+ All adapters write to user-scope configuration:
56
+
57
+ | Agent | Mechanism | Location |
58
+ |-------|-----------|----------|
59
+ | Claude Code | `claude mcp add --scope user` subprocess | `~/.claude.json` (managed by CLI) |
60
+ | OpenCode | direct JSON file write | `~/.config/opencode/opencode.json` |
61
+ | Copilot CLI | direct JSON file write | `~/.copilot/mcp-config.json` |
62
+ | Codex | `codex mcp add` subprocess | Codex config |
63
+ | Cursor | direct JSON file write | `~/.cursor/mcp.json` |
64
+ | Grok | `grok mcp add --scope user` subprocess | `~/.grok/config.toml` (managed by CLI) |
65
+
66
+ Adds are idempotent (update existing entries with the same name). Cursor preserves native fields
67
+ that `MCPServerSpec` cannot represent when an update keeps the same transport, and writes its file
68
+ atomically with user-only permissions. Removes warn rather than raise when the named server is not
69
+ found. Claude Code listing reads the user-scope `mcpServers`
70
+ entries from `~/.claude.json` directly, avoiding the health checks and human-readable output of
71
+ `claude mcp list`. Cursor manages user-scope MCP entries directly in `~/.cursor/mcp.json` because
72
+ its `mcp` subcommands have no add/remove commands. Grok listing reads user-scope `mcp_servers`
73
+ entries from `~/.grok/config.toml` directly for the same reason. Pi's MCP add/remove/list methods
74
+ raise `NotImplementedError`.
75
+
76
+ ## Package Management
77
+
78
+ See [package management](docs/development/package_management.md) for the API, Pi behaviour,
79
+ scope, and validation details.
80
+
81
+ ## Test Philosophy
82
+
83
+ Tests validate real functionality, not code coverage metrics. Three tiers, each with a distinct
84
+ purpose:
85
+
86
+ | Tier | Scope | Runs in CI | Real CLI calls |
87
+ |------|-------|-----------|----------------|
88
+ | **Unit** | Isolated parsing, adapter resolution, input validation | Yes | No |
89
+ | **Integration** | Shell -> adapter -> parser, with mocked agent subprocess | Yes | No |
90
+ | **E2E** | Real CLI calls; usually real API costs | No (local only) | Yes |
91
+
92
+ The model-discovery E2E test is the exception: it calls all seven real CLIs but only reads
93
+ metadata, so it sends no inference request and incurs no model-token cost.
94
+
95
+ Integration tests mirror the E2E tests but substitute mocked subprocesses emitting captured CLI
96
+ output fixtures. This lets CI validate the full class interaction chain without credentials or API
97
+ spend. E2E tests remain local smoke tests for the real agents.
98
+
99
+ All tests follow the **AAA pattern** (Arrange, Act, Assert).
100
+
101
+ ```bash
102
+ # Architecture contracts (development dependency only)
103
+ uv run --locked lint-imports --no-cache
104
+
105
+ # CI suite (unit + integration, including deliberate boundary violations in temp copies)
106
+ uv run --locked pytest tests/unit tests/integration -v
107
+
108
+ # Full suite including E2E (requires agent CLI + credentials)
109
+ uv run pytest -v
110
+ ```
111
+
112
+ ## Nix
113
+
114
+ The repository ships a flake (flake-parts + uv2nix) that builds the locked `uv.lock`
115
+ environment reproducibly. The `uv` workflow above remains the primary dev loop; Nix adds
116
+ reproducibility and checks, it does not replace `uv`.
117
+
118
+ ```bash
119
+ nix develop # locked python 3.12 + pytest + uv + ruff, hooks auto-installed
120
+ nix build .#agent-shell-py # the library, installed into a python3.12 site-packages
121
+ nix flake check # pre-commit hooks + zero-runtime-deps + built-import + unit & integration tests (with import contracts)
122
+ nix fmt # format gate (default stage only: nixfmt, deadnix, statix)
123
+ ```
124
+
125
+ Rules that are easy to get wrong:
126
+
127
+ - **Inside `nix develop`, `uv` is for lockfile operations only** (`uv add`, `uv lock`).
128
+ `UV_NO_SYNC=1` stops uv syncing packages *into* a venv; it does not stop uv creating one. `uv run`
129
+ also resolves its own interpreter rather than the shell's, so it can build a stray,
130
+ dependency-free `.venv` around a different Python. Run `pytest` directly in the shell.
131
+ - **`tests/e2e` never runs in a Nix build or check.** It calls real agent CLIs and incurs API
132
+ cost. Checks scope to `tests/unit` + `tests/integration` and pass `-m "not e2e"`; the sandbox
133
+ has no network, so a test that needs one fails closed.
134
+ - **`ruff` and `typos` are wired at the `manual` stage**, so a green `nix flake check` does not
135
+ mean they ran. The repo has no lint config yet; run them deliberately with
136
+ `pre-commit run ruff --hook-stage manual --all-files` and do not promote them to a default
137
+ stage without deciding the lint configuration with the maintainer.
138
+ - **No FHS paths in tests, with two recorded exceptions.** There is no `/usr/bin/env` or
139
+ `/bin/true` inside the Nix sandbox, and `/bin/true` is absent on NixOS outright — use
140
+ `sys.executable` for generated shebangs and `shutil.which` for binaries. Generated fake binaries
141
+ written into `tmp_path` as payload and put on `PATH` may use `#!/bin/sh`, which does exist in the
142
+ sandbox and on NixOS. The two `#!/usr/bin/env node` shebangs in `test_interactive_agents.py` are
143
+ guarded by a `shutil.which("node")` skip, so they pass by skipping rather than by portability.
144
+ - **Version stamping**: pure builds report `0.0.0+dev` because the flake source carries no `.git`.
145
+ Releases stamp the tag with `AGENT_SHELL_VERSION=$(git describe --tags --abbrev=0)` — the
146
+ `--abbrev=0` is required, raw `git describe` output is not a valid PEP 440 version.
147
+ - **Do not add version literals to `flake.nix`.**
148
+
149
+ See [docs/nix.md](docs/nix.md) for the full guide and the practice-matrix decisions.
150
+
151
+ ## CI/CD
152
+
153
+ - **CI**: Runs architecture contracts and unit + integration tests on every push and PR
154
+ - **Build**: Triggers on `v*` tags, runs contracts/tests then builds release artifacts
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agent-shell-py
3
- Version: 0.4.0
3
+ Version: 0.5.1
4
4
  Summary: A lightweight abstraction for executing CLI coding agents headlessly
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -118,3 +118,8 @@ follow_up = await shell.execute(
118
118
 
119
119
  See [more examples](docs/examples.md) for isolation and execution hosts, failure handling,
120
120
  streaming, model discovery, health checks, tool restrictions, MCP servers, packages, and logging.
121
+
122
+ ## Guides
123
+
124
+ - [Nix](docs/nix.md) — reproducible dev shell, build and checks from `uv.lock`, plus
125
+ `nix-build` / `nix-shell` entry points for Nix without flakes enabled.
@@ -109,3 +109,8 @@ follow_up = await shell.execute(
109
109
 
110
110
  See [more examples](docs/examples.md) for isolation and execution hosts, failure handling,
111
111
  streaming, model discovery, health checks, tool restrictions, MCP servers, packages, and logging.
112
+
113
+ ## Guides
114
+
115
+ - [Nix](docs/nix.md) — reproducible dev shell, build and checks from `uv.lock`, plus
116
+ `nix-build` / `nix-shell` entry points for Nix without flakes enabled.
@@ -0,0 +1,11 @@
1
+ # nix-build entry point (flake-compat); the flake is the source of truth.
2
+ (import (
3
+ let
4
+ lock = builtins.fromJSON (builtins.readFile ./flake.lock);
5
+ node = lock.nodes.${lock.nodes.root.inputs.flake-compat}.locked;
6
+ in
7
+ fetchTarball {
8
+ url = "https://github.com/${node.owner}/${node.repo}/archive/${node.rev}.tar.gz";
9
+ sha256 = node.narHash;
10
+ }
11
+ ) { src = ./.; }).defaultNix