sagent 0.2.0__tar.gz → 0.2.2__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 (559) hide show
  1. {sagent-0.2.0 → sagent-0.2.2}/.pre-commit-config.yaml +23 -24
  2. {sagent-0.2.0 → sagent-0.2.2}/CHANGELOG.md +65 -0
  3. {sagent-0.2.0 → sagent-0.2.2}/PKG-INFO +118 -38
  4. {sagent-0.2.0 → sagent-0.2.2}/README.md +78 -23
  5. sagent-0.2.2/docs/api.md +159 -0
  6. sagent-0.2.2/docs/architecture.md +78 -0
  7. {sagent-0.2.0 → sagent-0.2.2}/docs/cli.md +47 -63
  8. sagent-0.2.2/docs/compaction.md +119 -0
  9. sagent-0.2.2/docs/concepts.md +51 -0
  10. sagent-0.2.2/docs/providers.md +187 -0
  11. {sagent-0.2.0 → sagent-0.2.2}/docs/security.md +6 -13
  12. {sagent-0.2.0 → sagent-0.2.2}/docs/selfhosted.md +14 -16
  13. sagent-0.2.2/docs/sessions.md +84 -0
  14. sagent-0.2.2/docs/streaming.md +108 -0
  15. sagent-0.2.2/docs/tools.md +265 -0
  16. {sagent-0.2.0 → sagent-0.2.2}/docs/tutorial.md +51 -35
  17. {sagent-0.2.0 → sagent-0.2.2}/pyproject.toml +128 -55
  18. {sagent-0.2.0 → sagent-0.2.2}/sagent/__main__.py +1 -1
  19. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/agent.py +228 -144
  20. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/agent_test.py +925 -49
  21. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/agents_md.py +86 -40
  22. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/agents_md_test.py +279 -12
  23. sagent-0.2.2/sagent/agent/assets/compactor_cut_off.md +1 -0
  24. sagent-0.2.2/sagent/agent/assets/compactor_partial_up_to.md +3 -0
  25. sagent-0.2.2/sagent/agent/assets/compactor_recent_from.md +1 -0
  26. sagent-0.2.2/sagent/agent/assets/compactor_recent_up_to.md +1 -0
  27. sagent-0.2.2/sagent/agent/assets/compactor_resume.md +1 -0
  28. sagent-0.2.2/sagent/agent/assets/compactor_resume_proactive.md +1 -0
  29. sagent-0.2.2/sagent/agent/assets/compactor_skill_elided.md +1 -0
  30. sagent-0.2.2/sagent/agent/assets/compactor_user_guidance.md +8 -0
  31. sagent-0.2.2/sagent/agent/assets/compactor_verify.md +7 -0
  32. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/cache_test.py +14 -5
  33. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/compactor.py +454 -606
  34. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/compactor_test.py +1569 -220
  35. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/environment_test.py +4 -1
  36. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/pruner.py +35 -47
  37. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/pruner_test.py +210 -17
  38. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/scrunch.py +4 -2
  39. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/scrunch_test.py +161 -1
  40. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/team.py +500 -78
  41. sagent-0.2.2/sagent/agent/team_test.py +2180 -0
  42. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/types.py +29 -7
  43. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/types_test.py +4 -4
  44. sagent-0.2.2/sagent/host/__init__.py +1 -0
  45. sagent-0.2.2/sagent/host/daemon.py +263 -0
  46. sagent-0.2.2/sagent/host/daemon_test.py +2038 -0
  47. sagent-0.2.2/sagent/host/server.py +1214 -0
  48. sagent-0.2.2/sagent/host/server_test.py +1489 -0
  49. sagent-0.2.2/sagent/host/session.py +484 -0
  50. sagent-0.2.2/sagent/host/session_test.py +520 -0
  51. sagent-0.2.2/sagent/host/settings.py +285 -0
  52. sagent-0.2.2/sagent/host/settings_test.py +198 -0
  53. sagent-0.2.2/sagent/host/strings.py +433 -0
  54. sagent-0.2.2/sagent/host/strings_test.py +338 -0
  55. sagent-0.2.2/sagent/host/testing.py +181 -0
  56. sagent-0.2.2/sagent/host/testing_test.py +75 -0
  57. sagent-0.2.2/sagent/host/tls.py +134 -0
  58. sagent-0.2.2/sagent/host/tls_test.py +91 -0
  59. sagent-0.2.2/sagent/host/wire.py +402 -0
  60. sagent-0.2.2/sagent/host/wire_test.py +204 -0
  61. sagent-0.2.2/sagent/layering_test.py +79 -0
  62. sagent-0.2.2/sagent/lib/asyncio_stalls.py +88 -0
  63. sagent-0.2.2/sagent/lib/asyncio_stalls_test.py +80 -0
  64. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/files/glob.py +8 -11
  65. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/files/glob_test.py +76 -4
  66. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/files/grep.py +302 -211
  67. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/files/grep_test.py +729 -177
  68. sagent-0.2.2/sagent/lib/files/owner_only.py +77 -0
  69. sagent-0.2.2/sagent/lib/files/owner_only_test.py +191 -0
  70. sagent-0.2.2/sagent/lib/files/source_version.py +61 -0
  71. sagent-0.2.2/sagent/lib/files/source_version_test.py +73 -0
  72. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/files/walk_test.py +33 -0
  73. sagent-0.2.2/sagent/lib/posix/attach.py +333 -0
  74. sagent-0.2.2/sagent/lib/posix/attach_test.py +1132 -0
  75. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/posix/child.py +42 -13
  76. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/posix/child_test.py +101 -4
  77. sagent-0.2.2/sagent/lib/posix/detached.py +138 -0
  78. sagent-0.2.2/sagent/lib/posix/detached_test.py +161 -0
  79. sagent-0.2.2/sagent/lib/posix/host.py +598 -0
  80. sagent-0.2.2/sagent/lib/posix/host_test.py +1196 -0
  81. sagent-0.2.2/sagent/lib/posix/pids.py +239 -0
  82. sagent-0.2.2/sagent/lib/posix/pids_test.py +462 -0
  83. sagent-0.2.2/sagent/lib/posix/relay.py +707 -0
  84. sagent-0.2.2/sagent/lib/posix/relay_test.py +1936 -0
  85. sagent-0.2.2/sagent/lib/posix/sockets.py +117 -0
  86. sagent-0.2.2/sagent/lib/posix/sockets_test.py +241 -0
  87. sagent-0.2.2/sagent/lib/posix/terminal.py +659 -0
  88. sagent-0.2.2/sagent/lib/posix/terminal_test.py +1555 -0
  89. sagent-0.2.2/sagent/lib/testing/checks.py +134 -0
  90. sagent-0.2.2/sagent/lib/testing/checks_test.py +187 -0
  91. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/testing/resources.py +43 -13
  92. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/testing/resources_test.py +254 -4
  93. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/testing/wheel.py +12 -5
  94. sagent-0.2.2/sagent/lib/yaml.py +158 -0
  95. sagent-0.2.2/sagent/lib/yaml_test.py +199 -0
  96. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/capability.py +24 -14
  97. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/capability_test.py +112 -38
  98. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/context.py +1 -1
  99. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/context_test.py +3 -7
  100. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/cost.py +21 -32
  101. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/cost_test.py +71 -14
  102. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/exceptions_test.py +8 -0
  103. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/image.py +4 -1
  104. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/image_test.py +27 -3
  105. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/scripted.py +6 -4
  106. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/scripted_test.py +14 -4
  107. sagent-0.2.2/sagent/model/token_accounting.py +302 -0
  108. sagent-0.2.2/sagent/model/token_accounting_test.py +449 -0
  109. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/types.py +11 -2
  110. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/types_test.py +2 -0
  111. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/anthropic.yaml +5 -1
  112. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/api.py +100 -37
  113. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/api_test.py +105 -27
  114. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/cli.py +50 -31
  115. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/cli_test.py +172 -29
  116. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/login.py +62 -83
  117. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/login_test.py +155 -18
  118. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/wire.py +18 -19
  119. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/wire_test.py +78 -34
  120. sagent-0.2.2/sagent/providers/azure/__init__.py +1 -0
  121. sagent-0.2.2/sagent/providers/azure/api.py +28 -0
  122. sagent-0.2.2/sagent/providers/azure/api_test.py +97 -0
  123. sagent-0.2.2/sagent/providers/azure/azure.yaml +8 -0
  124. sagent-0.2.2/sagent/providers/bedrock/__init__.py +1 -0
  125. sagent-0.2.2/sagent/providers/bedrock/api.py +40 -0
  126. sagent-0.2.2/sagent/providers/bedrock/api_test.py +106 -0
  127. sagent-0.2.2/sagent/providers/bedrock/bedrock.yaml +10 -0
  128. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/catalog.py +122 -146
  129. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/catalog_test.py +253 -137
  130. sagent-0.2.2/sagent/providers/cerebras/__init__.py +1 -0
  131. sagent-0.2.2/sagent/providers/cerebras/api.py +28 -0
  132. sagent-0.2.2/sagent/providers/cerebras/api_test.py +64 -0
  133. sagent-0.2.2/sagent/providers/cerebras/cerebras.yaml +41 -0
  134. sagent-0.2.2/sagent/providers/cloudflare/__init__.py +1 -0
  135. sagent-0.2.2/sagent/providers/cloudflare/api.py +33 -0
  136. sagent-0.2.2/sagent/providers/cloudflare/api_test.py +44 -0
  137. sagent-0.2.2/sagent/providers/cloudflare/cloudflare.yaml +25 -0
  138. sagent-0.2.2/sagent/providers/cohere/__init__.py +1 -0
  139. sagent-0.2.2/sagent/providers/cohere/api.py +186 -0
  140. sagent-0.2.2/sagent/providers/cohere/api_test.py +310 -0
  141. sagent-0.2.2/sagent/providers/cohere/cohere.yaml +36 -0
  142. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/dashscope/api.py +1 -0
  143. sagent-0.2.2/sagent/providers/deepinfra/__init__.py +1 -0
  144. sagent-0.2.2/sagent/providers/deepinfra/api.py +28 -0
  145. sagent-0.2.2/sagent/providers/deepinfra/api_test.py +63 -0
  146. sagent-0.2.2/sagent/providers/deepinfra/deepinfra.yaml +38 -0
  147. sagent-0.2.2/sagent/providers/deepseek/__init__.py +1 -0
  148. sagent-0.2.2/sagent/providers/deepseek/api.py +38 -0
  149. sagent-0.2.2/sagent/providers/deepseek/api_test.py +65 -0
  150. sagent-0.2.2/sagent/providers/deepseek/deepseek.yaml +49 -0
  151. sagent-0.2.2/sagent/providers/fireworks/__init__.py +1 -0
  152. sagent-0.2.2/sagent/providers/fireworks/api.py +37 -0
  153. sagent-0.2.2/sagent/providers/fireworks/api_test.py +66 -0
  154. sagent-0.2.2/sagent/providers/fireworks/fireworks.yaml +41 -0
  155. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/google/api.py +41 -31
  156. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/google/api_test.py +38 -18
  157. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/google/cli.py +35 -28
  158. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/google/cli_test.py +530 -22
  159. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/google/wire.py +78 -26
  160. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/google/wire_test.py +59 -29
  161. sagent-0.2.2/sagent/providers/groq/__init__.py +1 -0
  162. sagent-0.2.2/sagent/providers/groq/api.py +37 -0
  163. sagent-0.2.2/sagent/providers/groq/api_test.py +72 -0
  164. sagent-0.2.2/sagent/providers/groq/groq.yaml +39 -0
  165. sagent-0.2.2/sagent/providers/huggingface/__init__.py +1 -0
  166. sagent-0.2.2/sagent/providers/huggingface/api.py +32 -0
  167. sagent-0.2.2/sagent/providers/huggingface/api_test.py +65 -0
  168. sagent-0.2.2/sagent/providers/huggingface/huggingface.yaml +40 -0
  169. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/llamacpp/server.py +48 -37
  170. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/llamacpp/server_test.py +134 -24
  171. sagent-0.2.2/sagent/providers/lmstudio/__init__.py +1 -0
  172. sagent-0.2.2/sagent/providers/lmstudio/api.py +25 -0
  173. sagent-0.2.2/sagent/providers/lmstudio/api_test.py +32 -0
  174. sagent-0.2.2/sagent/providers/lmstudio/lmstudio.yaml +23 -0
  175. sagent-0.2.2/sagent/providers/login.py +696 -0
  176. sagent-0.2.2/sagent/providers/login_test.py +920 -0
  177. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/minimax/api.py +1 -0
  178. sagent-0.2.2/sagent/providers/mistral/__init__.py +1 -0
  179. sagent-0.2.2/sagent/providers/mistral/api.py +38 -0
  180. sagent-0.2.2/sagent/providers/mistral/api_test.py +91 -0
  181. sagent-0.2.2/sagent/providers/mistral/mistral.yaml +38 -0
  182. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/moonshot/api.py +1 -0
  183. sagent-0.2.2/sagent/providers/nvidia/__init__.py +1 -0
  184. sagent-0.2.2/sagent/providers/nvidia/api.py +34 -0
  185. sagent-0.2.2/sagent/providers/nvidia/api_test.py +35 -0
  186. sagent-0.2.2/sagent/providers/nvidia/nvidia.yaml +13 -0
  187. sagent-0.2.2/sagent/providers/ollama/__init__.py +1 -0
  188. sagent-0.2.2/sagent/providers/ollama/api.py +25 -0
  189. sagent-0.2.2/sagent/providers/ollama/api_test.py +37 -0
  190. sagent-0.2.2/sagent/providers/ollama/ollama.yaml +23 -0
  191. sagent-0.2.2/sagent/providers/openai/api.py +137 -0
  192. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/api_test.py +63 -0
  193. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/chat.py +168 -14
  194. sagent-0.2.2/sagent/providers/openai/chat_test.py +1028 -0
  195. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/compat.py +104 -39
  196. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/compat_test.py +173 -13
  197. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/lease.py +15 -7
  198. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/lease_test.py +29 -1
  199. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/login.py +138 -184
  200. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/login_test.py +312 -150
  201. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/responses.py +16 -24
  202. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/responses_test.py +186 -24
  203. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/sub.py +18 -8
  204. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/sub_test.py +92 -27
  205. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/token_count.py +4 -12
  206. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/token_count_test.py +133 -0
  207. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/wire.py +40 -10
  208. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/wire_test.py +164 -8
  209. sagent-0.2.2/sagent/providers/openrouter/__init__.py +1 -0
  210. sagent-0.2.2/sagent/providers/openrouter/api.py +42 -0
  211. sagent-0.2.2/sagent/providers/openrouter/api_test.py +50 -0
  212. sagent-0.2.2/sagent/providers/openrouter/openrouter.yaml +37 -0
  213. sagent-0.2.2/sagent/providers/perplexity/__init__.py +1 -0
  214. sagent-0.2.2/sagent/providers/perplexity/api.py +51 -0
  215. sagent-0.2.2/sagent/providers/perplexity/api_test.py +55 -0
  216. sagent-0.2.2/sagent/providers/perplexity/perplexity.yaml +43 -0
  217. sagent-0.2.2/sagent/providers/replicate/__init__.py +1 -0
  218. sagent-0.2.2/sagent/providers/replicate/api.py +168 -0
  219. sagent-0.2.2/sagent/providers/replicate/api_test.py +262 -0
  220. sagent-0.2.2/sagent/providers/replicate/replicate.yaml +9 -0
  221. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/resources.py +3 -2
  222. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/resources_test.py +114 -30
  223. sagent-0.2.2/sagent/providers/retry.py +61 -0
  224. sagent-0.2.2/sagent/providers/retry_test.py +133 -0
  225. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/selfhosted/calls.py +7 -7
  226. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/selfhosted/calls_test.py +15 -0
  227. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/selfhosted/server.py +16 -16
  228. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/selfhosted/server_test.py +281 -16
  229. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/selfhosted/vision.py +15 -12
  230. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/selfhosted/vision_test.py +114 -0
  231. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/table.py +75 -53
  232. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/table_test.py +462 -28
  233. sagent-0.2.2/sagent/providers/testing.py +116 -0
  234. sagent-0.2.2/sagent/providers/testing_test.py +59 -0
  235. sagent-0.2.2/sagent/providers/together/__init__.py +1 -0
  236. sagent-0.2.2/sagent/providers/together/api.py +28 -0
  237. sagent-0.2.2/sagent/providers/together/api_test.py +66 -0
  238. sagent-0.2.2/sagent/providers/together/together.yaml +41 -0
  239. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/tool_server.py +4 -4
  240. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/tool_server_test.py +24 -9
  241. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/types.py +24 -9
  242. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/types_test.py +36 -30
  243. sagent-0.2.2/sagent/providers/vertex/__init__.py +1 -0
  244. sagent-0.2.2/sagent/providers/vertex/api.py +117 -0
  245. sagent-0.2.2/sagent/providers/vertex/api_test.py +211 -0
  246. sagent-0.2.2/sagent/providers/vertex/vertex.yaml +33 -0
  247. sagent-0.2.2/sagent/providers/workload_identity.py +162 -0
  248. sagent-0.2.2/sagent/providers/workload_identity_test.py +216 -0
  249. sagent-0.2.2/sagent/providers/xai/__init__.py +1 -0
  250. sagent-0.2.2/sagent/providers/xai/api.py +31 -0
  251. sagent-0.2.2/sagent/providers/xai/api_test.py +67 -0
  252. sagent-0.2.2/sagent/providers/xai/xai.yaml +42 -0
  253. sagent-0.2.2/sagent/providers/zai/__init__.py +1 -0
  254. sagent-0.2.2/sagent/providers/zai/api.py +39 -0
  255. sagent-0.2.2/sagent/providers/zai/api_test.py +66 -0
  256. sagent-0.2.2/sagent/providers/zai/zai.yaml +41 -0
  257. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/context.py +10 -6
  258. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/context_test.py +42 -11
  259. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/runtime.py +102 -86
  260. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/runtime_test.py +275 -159
  261. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/tape.py +9 -8
  262. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/tape_test.py +6 -21
  263. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/types.py +45 -0
  264. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/types_test.py +21 -2
  265. {sagent-0.2.0 → sagent-0.2.2}/sagent/scripts/check_wheel.py +4 -11
  266. {sagent-0.2.0 → sagent-0.2.2}/sagent/scripts/check_wheel_test.py +44 -1
  267. {sagent-0.2.0 → sagent-0.2.2}/sagent/scripts/convert_sessions.py +20 -1
  268. {sagent-0.2.0 → sagent-0.2.2}/sagent/scripts/convert_sessions_test.py +51 -2
  269. {sagent-0.2.0 → sagent-0.2.2}/sagent/scripts/swebench.py +7 -6
  270. {sagent-0.2.0 → sagent-0.2.2}/sagent/scripts/swebench_test.py +444 -44
  271. sagent-0.2.2/sagent/session/jsonl.py +332 -0
  272. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/jsonl_test.py +203 -8
  273. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/legacy_journal.py +44 -34
  274. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/legacy_journal_test.py +426 -3
  275. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/projects.py +37 -28
  276. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/projects_test.py +37 -23
  277. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/recording.py +9 -5
  278. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/recording_test.py +10 -0
  279. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/types.py +543 -50
  280. sagent-0.2.2/sagent/session/types_test.py +592 -0
  281. sagent-0.2.2/sagent/settings/__init__.py +5 -0
  282. sagent-0.2.2/sagent/settings/exceptions.py +32 -0
  283. sagent-0.2.2/sagent/settings/exceptions_test.py +27 -0
  284. sagent-0.2.2/sagent/settings/flags.py +189 -0
  285. sagent-0.2.2/sagent/settings/flags_test.py +147 -0
  286. {sagent-0.2.0/sagent/tui → sagent-0.2.2/sagent}/settings/harvest.py +1 -1
  287. {sagent-0.2.0/sagent/tui → sagent-0.2.2/sagent}/settings/harvest_test.py +2 -2
  288. {sagent-0.2.0/sagent/tui → sagent-0.2.2/sagent}/settings/match.py +1 -1
  289. {sagent-0.2.0/sagent/tui → sagent-0.2.2/sagent}/settings/match_test.py +2 -2
  290. {sagent-0.2.0/sagent/tui → sagent-0.2.2/sagent}/settings/types.py +4 -7
  291. {sagent-0.2.0/sagent/tui → sagent-0.2.2/sagent}/settings/types_test.py +2 -10
  292. {sagent-0.2.0 → sagent-0.2.2}/sagent/skills/watch/SKILL.md +6 -5
  293. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/agent_self.py +41 -23
  294. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/agent_self_test.py +109 -9
  295. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/agent_send.py +41 -21
  296. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/agent_send_test.py +144 -4
  297. sagent-0.2.0/sagent/tools/session.py → sagent-0.2.2/sagent/tools/agent_session.py +75 -59
  298. sagent-0.2.0/sagent/tools/session_test.py → sagent-0.2.2/sagent/tools/agent_session_test.py +171 -52
  299. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/agent_spawn.py +110 -55
  300. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/agent_spawn_test.py +829 -57
  301. sagent-0.2.2/sagent/tools/agent_tool.py +56 -0
  302. sagent-0.2.2/sagent/tools/agent_tool_test.py +409 -0
  303. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/agentself.md +3 -1
  304. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/agentspawn.md +7 -3
  305. sagent-0.2.2/sagent/tools/assets/grep.md +12 -0
  306. sagent-0.2.2/sagent/tools/assets/remotetool.md +11 -0
  307. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/session.md +5 -2
  308. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/background_task.py +20 -10
  309. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/background_task_test.py +16 -11
  310. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/bash.py +46 -24
  311. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/bash_test.py +333 -98
  312. sagent-0.2.2/sagent/tools/builtin.py +133 -0
  313. sagent-0.2.2/sagent/tools/builtin_test.py +81 -0
  314. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/command_analyzer.py +91 -81
  315. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/command_analyzer_test.py +248 -16
  316. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/display.py +48 -52
  317. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/display_test.py +24 -83
  318. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/edit.py +23 -24
  319. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/edit_test.py +15 -6
  320. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/function.py +118 -22
  321. sagent-0.2.2/sagent/tools/function_test.py +390 -0
  322. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/glob_tool.py +19 -8
  323. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/grep.py +269 -64
  324. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/grep_test.py +387 -14
  325. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/list.py +8 -8
  326. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/list_test.py +6 -4
  327. sagent-0.2.2/sagent/tools/mcp.py +1206 -0
  328. sagent-0.2.2/sagent/tools/mcp_auth.py +522 -0
  329. sagent-0.2.2/sagent/tools/mcp_auth_test.py +790 -0
  330. sagent-0.2.2/sagent/tools/mcp_settings.py +342 -0
  331. sagent-0.2.2/sagent/tools/mcp_settings_test.py +323 -0
  332. sagent-0.2.2/sagent/tools/mcp_test.py +1672 -0
  333. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/memory.py +43 -12
  334. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/memory_test.py +93 -4
  335. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_author.py +44 -28
  336. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_author_test.py +125 -17
  337. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_common.py +4 -4
  338. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_common_test.py +3 -3
  339. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_details.py +24 -22
  340. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_details_test.py +17 -13
  341. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_fetch.py +18 -14
  342. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_fetch_test.py +11 -19
  343. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_search.py +10 -14
  344. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/paper_search_test.py +5 -10
  345. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/play_audio.py +13 -8
  346. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/read.py +53 -35
  347. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/read_test.py +149 -22
  348. sagent-0.2.2/sagent/tools/remote.py +806 -0
  349. sagent-0.2.2/sagent/tools/remote_settings.py +164 -0
  350. sagent-0.2.2/sagent/tools/remote_settings_test.py +99 -0
  351. sagent-0.2.2/sagent/tools/remote_test.py +1024 -0
  352. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/skill.py +55 -20
  353. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/skill_test.py +99 -18
  354. sagent-0.2.2/sagent/tools/testing.py +60 -0
  355. sagent-0.2.2/sagent/tools/testing_test.py +95 -0
  356. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/types.py +40 -13
  357. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/types_test.py +32 -10
  358. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/watch.py +6 -8
  359. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/watch_test.py +122 -3
  360. sagent-0.2.2/sagent/tools/web_browser.py +136 -0
  361. sagent-0.2.2/sagent/tools/web_browser_test.py +324 -0
  362. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/web_fetch.py +9 -12
  363. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/web_fetch_test.py +19 -36
  364. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/web_search.py +12 -16
  365. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/web_search_test.py +18 -23
  366. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/write.py +8 -8
  367. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/write_test.py +4 -4
  368. sagent-0.2.2/sagent/tui/assets/holidays.yaml +928 -0
  369. sagent-0.2.2/sagent/tui/assets/themes/dark.yaml +27 -0
  370. sagent-0.2.2/sagent/tui/assets/themes/default.yaml +58 -0
  371. sagent-0.2.2/sagent/tui/assets/themes/light.yaml +27 -0
  372. sagent-0.2.2/sagent/tui/assets/themes/terminal.yaml +42 -0
  373. sagent-0.2.2/sagent/tui/console.py +757 -0
  374. sagent-0.2.2/sagent/tui/console_test.py +1528 -0
  375. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/diff.py +107 -103
  376. sagent-0.2.2/sagent/tui/diff_test.py +655 -0
  377. sagent-0.2.2/sagent/tui/holiday.py +750 -0
  378. sagent-0.2.2/sagent/tui/holiday_test.py +782 -0
  379. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/main.py +553 -186
  380. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/main_test.py +2711 -276
  381. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/markdown.py +162 -13
  382. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/markdown_test.py +154 -8
  383. sagent-0.2.2/sagent/tui/peers_test.py +76 -0
  384. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/prompt.py +30 -14
  385. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/prompt_test.py +77 -19
  386. sagent-0.2.2/sagent/tui/recording.py +190 -0
  387. sagent-0.2.2/sagent/tui/recording_test.py +68 -0
  388. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/render.py +167 -116
  389. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/render_test.py +454 -125
  390. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/replay_test.py +16 -85
  391. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/settings/model.py +12 -18
  392. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/settings/model_test.py +127 -11
  393. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/settings/runtime.py +2 -1
  394. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/settings/runtime_test.py +33 -1
  395. sagent-0.2.2/sagent/tui/settings/screen.py +113 -0
  396. sagent-0.2.2/sagent/tui/settings/screen_test.py +140 -0
  397. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/settings/tool.py +3 -2
  398. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/settings/tool_test.py +11 -2
  399. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/slash.py +335 -102
  400. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/slash_test.py +532 -127
  401. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/status_test.py +1 -1
  402. sagent-0.2.2/sagent/tui/theme.py +555 -0
  403. sagent-0.2.2/sagent/tui/theme_test.py +741 -0
  404. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/tree.py +28 -26
  405. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/tree_test.py +224 -5
  406. sagent-0.2.2/sagent/tui/types.py +601 -0
  407. sagent-0.2.2/sagent/tui/types_test.py +339 -0
  408. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/views.py +14 -9
  409. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/views_test.py +297 -54
  410. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/welcome.py +100 -59
  411. sagent-0.2.2/sagent/tui/welcome_test.py +915 -0
  412. {sagent-0.2.0 → sagent-0.2.2}/tests/wheel_test.py +56 -1
  413. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/__main__.py +1 -1
  414. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/fakes.py +31 -7
  415. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/fakes_test.py +47 -5
  416. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/gate.py +163 -73
  417. sagent-0.2.2/tools/gate/gate_test.py +628 -0
  418. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/spool_test.py +15 -1
  419. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/worker_count.py +9 -4
  420. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/worker_count_test.py +116 -2
  421. {sagent-0.2.0 → sagent-0.2.2}/tools/testing/__main__.py +1 -1
  422. {sagent-0.2.0 → sagent-0.2.2}/tools/testing/coverage_summary.py +5 -4
  423. {sagent-0.2.0 → sagent-0.2.2}/tools/testing/coverage_summary_test.py +18 -13
  424. sagent-0.2.2/tools/testing/listing.py +285 -0
  425. sagent-0.2.2/tools/testing/listing_test.py +722 -0
  426. {sagent-0.2.0 → sagent-0.2.2}/tools/testing/testing.py +52 -47
  427. sagent-0.2.2/tools/testing/testing_test.py +1045 -0
  428. {sagent-0.2.0 → sagent-0.2.2}/tools/typecheck/__main__.py +1 -1
  429. {sagent-0.2.0 → sagent-0.2.2}/tools/typecheck/scope_test.py +5 -0
  430. {sagent-0.2.0 → sagent-0.2.2}/tools/typecheck/typecheck.py +40 -19
  431. {sagent-0.2.0 → sagent-0.2.2}/tools/typecheck/typecheck_test.py +164 -5
  432. {sagent-0.2.0 → sagent-0.2.2}/uv.lock +1553 -1432
  433. sagent-0.2.0/docs/api.md +0 -184
  434. sagent-0.2.0/docs/architecture.md +0 -89
  435. sagent-0.2.0/docs/compaction.md +0 -152
  436. sagent-0.2.0/docs/concepts.md +0 -55
  437. sagent-0.2.0/docs/providers.md +0 -176
  438. sagent-0.2.0/docs/sessions.md +0 -89
  439. sagent-0.2.0/docs/streaming.md +0 -101
  440. sagent-0.2.0/docs/tools.md +0 -254
  441. sagent-0.2.0/sagent/agent/team_test.py +0 -933
  442. sagent-0.2.0/sagent/lib/posix/pids.py +0 -116
  443. sagent-0.2.0/sagent/lib/posix/pids_test.py +0 -165
  444. sagent-0.2.0/sagent/providers/listing.py +0 -121
  445. sagent-0.2.0/sagent/providers/listing_test.py +0 -56
  446. sagent-0.2.0/sagent/providers/lock.py +0 -64
  447. sagent-0.2.0/sagent/providers/lock_test.py +0 -84
  448. sagent-0.2.0/sagent/providers/openai/api.py +0 -88
  449. sagent-0.2.0/sagent/providers/openai/chat_test.py +0 -453
  450. sagent-0.2.0/sagent/session/jsonl.py +0 -232
  451. sagent-0.2.0/sagent/session/types_test.py +0 -342
  452. sagent-0.2.0/sagent/tools/assets/grep.md +0 -10
  453. sagent-0.2.0/sagent/tools/function_test.py +0 -191
  454. sagent-0.2.0/sagent/tui/console.py +0 -385
  455. sagent-0.2.0/sagent/tui/console_test.py +0 -561
  456. sagent-0.2.0/sagent/tui/diff_test.py +0 -386
  457. sagent-0.2.0/sagent/tui/settings/flags.py +0 -70
  458. sagent-0.2.0/sagent/tui/settings/flags_test.py +0 -63
  459. sagent-0.2.0/sagent/tui/settings/screen.py +0 -57
  460. sagent-0.2.0/sagent/tui/settings/screen_test.py +0 -45
  461. sagent-0.2.0/sagent/tui/types.py +0 -411
  462. sagent-0.2.0/sagent/tui/types_test.py +0 -87
  463. sagent-0.2.0/sagent/tui/welcome_test.py +0 -441
  464. sagent-0.2.0/tools/gate/gate_test.py +0 -283
  465. sagent-0.2.0/tools/testing/testing_test.py +0 -549
  466. {sagent-0.2.0 → sagent-0.2.2}/.gitignore +0 -0
  467. {sagent-0.2.0 → sagent-0.2.2}/.python-version +0 -0
  468. {sagent-0.2.0 → sagent-0.2.2}/AI_POLICY.md +0 -0
  469. {sagent-0.2.0 → sagent-0.2.2}/CODE_OF_CONDUCT.md +0 -0
  470. {sagent-0.2.0 → sagent-0.2.2}/CONTRIBUTING.md +0 -0
  471. {sagent-0.2.0 → sagent-0.2.2}/LICENSE +0 -0
  472. {sagent-0.2.0 → sagent-0.2.2}/RELEASING.md +0 -0
  473. {sagent-0.2.0 → sagent-0.2.2}/SECURITY.md +0 -0
  474. {sagent-0.2.0 → sagent-0.2.2}/assets/logo-custom.webp +0 -0
  475. {sagent-0.2.0 → sagent-0.2.2}/conftest.py +0 -0
  476. {sagent-0.2.0 → sagent-0.2.2}/docs/showcase.md +0 -0
  477. {sagent-0.2.0 → sagent-0.2.2}/sagent/__init__.py +0 -0
  478. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/__init__.py +0 -0
  479. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/assets/compactor.md +0 -0
  480. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/assets/compactor_continuation.md +0 -0
  481. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/assets/compactor_no_tools.md +0 -0
  482. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/assets/compactor_no_tools_reminder.md +0 -0
  483. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/assets/compactor_partial.md +0 -0
  484. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/assets/compactor_session_audit.md +0 -0
  485. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/assets/compactor_system.md +0 -0
  486. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/assets/system_prompt.md +0 -0
  487. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/environment.py +0 -0
  488. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/fold.py +0 -0
  489. {sagent-0.2.0 → sagent-0.2.2}/sagent/agent/fold_test.py +0 -0
  490. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/__init__.py +0 -0
  491. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/files/__init__.py +0 -0
  492. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/files/walk.py +0 -0
  493. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/posix/__init__.py +0 -0
  494. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/testing/__init__.py +0 -0
  495. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/testing/runner.py +0 -0
  496. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/testing/runner_test.py +0 -0
  497. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/userdirs.py +0 -0
  498. {sagent-0.2.0 → sagent-0.2.2}/sagent/lib/userdirs_test.py +0 -0
  499. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/__init__.py +0 -0
  500. {sagent-0.2.0 → sagent-0.2.2}/sagent/model/exceptions.py +0 -0
  501. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/__init__.py +0 -0
  502. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/anthropic/__init__.py +0 -0
  503. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/dashscope/__init__.py +0 -0
  504. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/dashscope/api_test.py +0 -0
  505. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/dashscope/dashscope.yaml +0 -0
  506. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/google/__init__.py +0 -0
  507. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/google/google.yaml +0 -0
  508. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/llamacpp/__init__.py +0 -0
  509. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/llamacpp/llamacpp.yaml +0 -0
  510. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/minimax/__init__.py +0 -0
  511. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/minimax/api_test.py +0 -0
  512. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/minimax/minimax.yaml +0 -0
  513. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/moonshot/__init__.py +0 -0
  514. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/moonshot/api_test.py +0 -0
  515. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/moonshot/moonshot.yaml +0 -0
  516. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/__init__.py +0 -0
  517. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/openai/openai.yaml +0 -0
  518. {sagent-0.2.0 → sagent-0.2.2}/sagent/providers/selfhosted/__init__.py +0 -0
  519. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/__init__.py +0 -0
  520. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/exceptions.py +0 -0
  521. {sagent-0.2.0 → sagent-0.2.2}/sagent/runtime/exceptions_test.py +0 -0
  522. {sagent-0.2.0 → sagent-0.2.2}/sagent/scripts/__init__.py +0 -0
  523. {sagent-0.2.0 → sagent-0.2.2}/sagent/session/__init__.py +0 -0
  524. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/__init__.py +0 -0
  525. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/agentsend.md +0 -0
  526. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/backgroundtask.md +0 -0
  527. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/bash.md +0 -0
  528. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/bash.yaml +0 -0
  529. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/edit.md +0 -0
  530. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/glob.md +0 -0
  531. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/list.md +0 -0
  532. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/memory.md +0 -0
  533. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/paperauthor.md +0 -0
  534. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/paperdetails.md +0 -0
  535. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/paperfetch.md +0 -0
  536. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/papersearch.md +0 -0
  537. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/playaudio.md +0 -0
  538. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/read.md +0 -0
  539. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/skill.md +0 -0
  540. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/webfetch.md +0 -0
  541. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/websearch.md +0 -0
  542. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/assets/write.md +0 -0
  543. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/glob_tool_test.py +0 -0
  544. {sagent-0.2.0 → sagent-0.2.2}/sagent/tools/play_audio_test.py +0 -0
  545. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/__init__.py +0 -0
  546. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/replay.py +0 -0
  547. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/settings/__init__.py +0 -0
  548. {sagent-0.2.0 → sagent-0.2.2}/sagent/tui/status.py +0 -0
  549. {sagent-0.2.0 → sagent-0.2.2}/sagent/types.py +0 -0
  550. {sagent-0.2.0 → sagent-0.2.2}/sagent/types_test.py +0 -0
  551. {sagent-0.2.0 → sagent-0.2.2}/tools/__init__.py +0 -0
  552. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/__init__.py +0 -0
  553. {sagent-0.2.0 → sagent-0.2.2}/tools/gate/spool.py +0 -0
  554. {sagent-0.2.0 → sagent-0.2.2}/tools/testing/__init__.py +0 -0
  555. {sagent-0.2.0 → sagent-0.2.2}/tools/testing/tiers.py +0 -0
  556. {sagent-0.2.0 → sagent-0.2.2}/tools/testing/tiers_test.py +0 -0
  557. {sagent-0.2.0 → sagent-0.2.2}/tools/typecheck/__init__.py +0 -0
  558. {sagent-0.2.0 → sagent-0.2.2}/tools/typecheck/scope.py +0 -0
  559. {sagent-0.2.0 → sagent-0.2.2}/typings/.gitkeep +0 -0
@@ -283,14 +283,33 @@ repos:
283
283
  alias: superseded-at-pre-push
284
284
  types_or: [python, pyi]
285
285
  entry: uv --quiet run --frozen --group pre-commit python -m tools.typecheck ty-check
286
- # Off: `pyrefly-check` is the checker. Run with `--hook-stage manual`.
286
+ # Default type checker; `basedpyright` below is an additional opt-in.
287
+ - id: pyrefly-check-spool
288
+ name: pyrefly-check-spool
289
+ alias: pyrefly-check
290
+ language: system
291
+ stages: [pre-commit]
292
+ require_serial: true
293
+ types_or: [python, pyi]
294
+ entry: uv --quiet run --frozen --group pre-commit python -m tools.gate spool pyrefly-check
295
+ - id: pyrefly-check
296
+ name: pyrefly-check
297
+ language: system
298
+ stages: [pre-commit]
299
+ require_serial: true
300
+ pass_filenames: false
301
+ # See `superseded-at-pre-push` at the head of the Pre-Push Gates section.
302
+ alias: superseded-at-pre-push
303
+ types_or: [python, pyi]
304
+ entry: uv --quiet run --frozen --group pre-commit python -m tools.typecheck pyrefly-check
305
+ # Opt in with PRECOMMIT_BASEDPYRIGHT=1; unset or 0 is off.
287
306
  # Named files bypass pyproject's `[tool.basedpyright] exclude`, so the
288
307
  # twin's exclude mirrors it.
289
308
  - id: basedpyright-spool
290
309
  name: basedpyright-spool
291
310
  alias: basedpyright
292
311
  language: system
293
- stages: [manual]
312
+ stages: [pre-commit]
294
313
  require_serial: true
295
314
  types_or: [python, pyi]
296
315
  entry: uv --quiet run --frozen --group pre-commit python -m tools.gate spool basedpyright
@@ -302,7 +321,7 @@ repos:
302
321
  - id: basedpyright
303
322
  name: basedpyright
304
323
  language: system
305
- stages: [manual]
324
+ stages: [pre-commit]
306
325
  # Pre-commit discards a PASSING hook's output (see the Pre-Push Gates
307
326
  # note on `verbose`); this keeps basedpyright's summary line visible.
308
327
  verbose: true
@@ -312,27 +331,7 @@ repos:
312
331
  entry: >-
313
332
  env NODE_OPTIONS=--max-old-space-size=2048
314
333
  uv --quiet run --frozen --group pre-commit python -m tools.typecheck
315
- basedpyright
316
- # Default type checker; `basedpyright` above runs only under
317
- # `--hook-stage manual`.
318
- - id: pyrefly-check-spool
319
- name: pyrefly-check-spool
320
- alias: pyrefly-check
321
- language: system
322
- stages: [pre-commit]
323
- require_serial: true
324
- types_or: [python, pyi]
325
- entry: uv --quiet run --frozen --group pre-commit python -m tools.gate spool pyrefly-check
326
- - id: pyrefly-check
327
- name: pyrefly-check
328
- language: system
329
- stages: [pre-commit]
330
- require_serial: true
331
- pass_filenames: false
332
- # See `superseded-at-pre-push` at the head of the Pre-Push Gates section.
333
- alias: superseded-at-pre-push
334
- types_or: [python, pyi]
335
- entry: uv --quiet run --frozen --group pre-commit python -m tools.typecheck pyrefly-check
334
+ basedpyright --when PRECOMMIT_BASEDPYRIGHT
336
335
  - repo: local
337
336
  hooks:
338
337
  # Each heavy hook below is a `-spool` twin, which collects pre-commit's
@@ -3,6 +3,71 @@
3
3
  All notable sagent changes are documented here. This project follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
+ ## 0.2.2 - 2026-11-06
7
+
8
+ ### Changed
9
+
10
+ - An MCP sign-in belongs to one configuration file's entry: two projects, or a
11
+ project and the user's file, naming the same server keep separate sign-ins,
12
+ and removing one leaves the other signed in. `sagent mcp remove` and
13
+ `sagent mcp logout` also forget every sign-in of that file whose entry it no
14
+ longer has, as after a URL edited by hand; a file that does not read, and
15
+ JSON given inline to `--mcp-config`, are left alone. Sign-ins made before
16
+ this are not found; sign in again.
17
+ - `sagent mcp remove` with no `--scope` skips a configuration file that does
18
+ not read and removes the server from the other.
19
+ - `sagent.tools.mcp.logout` is a coroutine.
20
+
21
+ - Functions are named for what they return: `sagent.tools.types.schema_of` is
22
+ `json_schema`, `sagent.providers.openai.login.account_of` is
23
+ `codex_account`, `sagent.providers.testing.port_of` is `bound_port`,
24
+ `sagent.tui.render.header_of` is `call_header`, `Team.label_for` is
25
+ `Team.child_label`, and `Commands.commands_for` is `child_commands`.
26
+ - `Agent(cwd=, root=, max_result_chars=, columns=)` is
27
+ `Agent(tool_context=ToolContext(...))`. Every `ToolContext` field has a
28
+ default; the agent fixes where it started from the context's `origin`, and a
29
+ spawned agent takes a copy of its parent's context, with its own file
30
+ tracker.
31
+ - `ToolContext.fetch_session` carries the fetch session the web and paper
32
+ tools use; `WebFetch`, `WebSearch`, `PaperSearch`, `PaperDetails`,
33
+ `PaperAuthor` and `PaperFetch` take no `session`. Unset, it is wesearch's
34
+ process-wide session.
35
+ - `ProviderSharedResources` is `ProviderResources`.
36
+
37
+ ### Added
38
+
39
+ - `sagent.agent.agent.spent_by_model` reads what a journal says its agent spent
40
+ on each model, as each `TurnContext` names it; its sums add up to `spent`'s.
41
+
42
+ ## 0.2.1 - 2026-10-30
43
+
44
+ ### Added
45
+
46
+ - The welcome logo becomes a holiday icon on 26 holidays, for that day, or
47
+ Friday to Sunday when it falls on a weekend (Easter: Saturday to Monday);
48
+ overlapping holidays are picked at random. Dates follow US observance: computed for seasons, Lunar New
49
+ Year, Mid-Autumn, Holi, Diwali, Vaisakhi, Easter, Thanksgiving and the
50
+ Hebrew holidays; announced for the Eids and Vesak. Terminals without 256
51
+ colors, or with `NO_COLOR`, keep the logo.
52
+ - `sagent.lib.yaml.parse`, a YAML loader that refuses a key given twice, a
53
+ key that is no string, and an alias unless allowed, naming the line.
54
+
55
+ ### Changed
56
+
57
+ - The model catalogs and the Bash read-only policy load through the strict
58
+ YAML loader. The Bash policy, once read by the pure-Python parser, loads
59
+ about nine times faster; the catalogs, already on the C parser, load about
60
+ as fast as before.
61
+ - An AGENTS.md rule or a skill whose frontmatter will not parse is skipped,
62
+ and the session shows which file and line, rather than loading it with its
63
+ `paths:`, name, or description dropped.
64
+ - Memory reads the owner of a memory file whose frontmatter will not parse
65
+ from its `name:` line, so another name cannot overwrite it.
66
+ - Terminal output, tool rows, diffs and tool failures render aligned to the
67
+ active window.
68
+ - Provider accounts and catalogs are discovered together, and a spent login
69
+ falls back to the next one with quota, saying which window was spent.
70
+
6
71
  ## 0.2.0 - 2026-10-29
7
72
 
8
73
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sagent
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Python-first Coding Agent API and CLI.
5
5
  Project-URL: Homepage, https://www.rekursiv.ai
6
6
  Project-URL: Repository, https://github.com/rekursiv-ai/sagent
@@ -23,36 +23,61 @@ Classifier: Programming Language :: Python :: 3.14
23
23
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
24
  Requires-Python: >=3.12
25
25
  Requires-Dist: bashlex>=0.18
26
- Requires-Dist: cachetools>=7.2.1
27
- Requires-Dist: httpx2>=2.12
26
+ Requires-Dist: cachetools>=7.2.7
27
+ Requires-Dist: cryptography>=50.0.2
28
+ Requires-Dist: httpx2>=2.16.0
28
29
  Requires-Dist: markdown-it-py>=4.2
29
- Requires-Dist: mcp>=2.0.0
30
+ Requires-Dist: mcp>=2.3.0
30
31
  Requires-Dist: pillow>=11.3.0
31
32
  Requires-Dist: prompt-toolkit>=3.0.53
32
33
  Requires-Dist: pygments>=2.21.0
33
34
  Requires-Dist: pypdfium2>=5.14.0
34
- Requires-Dist: pyyaml>=6.0
35
+ Requires-Dist: pyyaml>=6.0.3
35
36
  Requires-Dist: rich>=15.0.0
36
37
  Requires-Dist: rignore>=0.8.1
37
- Requires-Dist: starlette>=0.40
38
- Requires-Dist: tiktoken>=0.12.0
38
+ Requires-Dist: starlette>=1.10.0
39
+ Requires-Dist: tiktoken>=0.14.0
39
40
  Requires-Dist: treekle>=0.4.1
40
- Requires-Dist: uvicorn>=0.30.0
41
+ Requires-Dist: uvicorn>=0.54.0
41
42
  Requires-Dist: wesearch>=0.1.15
42
- Requires-Dist: wrapt>=2.5.0
43
+ Requires-Dist: wrapt>=2.5.2
44
+ Provides-Extra: cpu
45
+ Requires-Dist: torch; extra == 'cpu'
46
+ Requires-Dist: torchao; extra == 'cpu'
47
+ Requires-Dist: torchvision; extra == 'cpu'
48
+ Provides-Extra: cu126
49
+ Requires-Dist: torch; extra == 'cu126'
50
+ Requires-Dist: torchao; extra == 'cu126'
51
+ Requires-Dist: torchvision; extra == 'cu126'
52
+ Provides-Extra: cu128
53
+ Requires-Dist: torch; extra == 'cu128'
54
+ Requires-Dist: torchao; extra == 'cu128'
55
+ Requires-Dist: torchvision; extra == 'cu128'
56
+ Provides-Extra: cu130
57
+ Requires-Dist: torch; extra == 'cu130'
58
+ Requires-Dist: torchao; extra == 'cu130'
59
+ Requires-Dist: torchvision; extra == 'cu130'
60
+ Provides-Extra: cu132
61
+ Requires-Dist: torch; extra == 'cu132'
62
+ Requires-Dist: torchao; extra == 'cu132'
63
+ Requires-Dist: torchvision; extra == 'cu132'
64
+ Provides-Extra: cu134
65
+ Requires-Dist: torch; extra == 'cu134'
66
+ Requires-Dist: torchao; extra == 'cu134'
67
+ Requires-Dist: torchvision; extra == 'cu134'
43
68
  Provides-Extra: selfhosted
44
- Requires-Dist: accelerate>=1.13.0; extra == 'selfhosted'
45
- Requires-Dist: auto-round>=0.12.3; extra == 'selfhosted'
46
- Requires-Dist: compressed-tensors>=0.19.0; extra == 'selfhosted'
47
- Requires-Dist: kernels>=0.13.0; extra == 'selfhosted'
69
+ Requires-Dist: accelerate>=1.15.0; extra == 'selfhosted'
70
+ Requires-Dist: auto-round>=0.16.1; extra == 'selfhosted'
71
+ Requires-Dist: compressed-tensors>=0.20.1; extra == 'selfhosted'
72
+ Requires-Dist: kernels>=0.18.0; extra == 'selfhosted'
48
73
  Requires-Dist: nvidia-cudnn-cu13>=9.19.0.56; (sys_platform == 'linux') and extra == 'selfhosted'
49
- Requires-Dist: nvidia-cudnn-frontend>=1.30.0; (sys_platform == 'linux') and extra == 'selfhosted'
74
+ Requires-Dist: nvidia-cudnn-frontend>=1.32.1; (sys_platform == 'linux') and extra == 'selfhosted'
50
75
  Requires-Dist: protobuf>=6.33.6; extra == 'selfhosted'
51
76
  Requires-Dist: safetensors>=0.8.0; extra == 'selfhosted'
52
77
  Requires-Dist: sentencepiece>=0.2.2; extra == 'selfhosted'
53
78
  Requires-Dist: torch>=2.11.0; extra == 'selfhosted'
54
79
  Requires-Dist: torchvision>=0.26.0; extra == 'selfhosted'
55
- Requires-Dist: transformers>=5.8.0; extra == 'selfhosted'
80
+ Requires-Dist: transformers>=5.22.1; extra == 'selfhosted'
56
81
  Description-Content-Type: text/markdown
57
82
 
58
83
  # sagent🪄
@@ -100,7 +125,7 @@ A coding-agent CLI and strongly-typed Python library -- self-mutating, hot-swapp
100
125
  ## Quick Start
101
126
 
102
127
  ```bash
103
- uvx sagent
128
+ uvx sagent@latest
104
129
  ```
105
130
 
106
131
  See [Install](#install) for additional details.
@@ -122,12 +147,12 @@ See [Install](#install) for additional details.
122
147
 
123
148
  4. Unified cost tracking.
124
149
  - One USD total across every provider in a session.
125
- - Pricing base don API costs when on sub.
150
+ - Pricing based on API costs when on sub.
126
151
  - Sub-agent costs roll up to the root. `--max-budget-usd N` caps the whole tree.
127
152
 
128
153
  5. Self-directing agent fleets.
129
154
  - Agents retune their own runtime -- provider, model, thinking, context -- mid-task.
130
- - A coordinator can do it to its workers over `AgentSend`: *"switch to o1, crank thinking, recompact and drop the file reads."*
155
+ - A coordinator can do it to its workers over `AgentSend`: *"switch to luna, crank thinking, recompact and drop the file reads."*
131
156
 
132
157
  6. Recursive agent messaging.
133
158
  - Any spawned agent can spawn and `AgentSend` to any peer, so coordination is a tree, not a star.
@@ -135,7 +160,7 @@ See [Install](#install) for additional details.
135
160
 
136
161
  7. Richer built-in tools.
137
162
  - WebSearch/Fetch use headed or headless chrome.
138
- - `PaperSearch`/`PaperFetch` walk citation graphs and fetch PDFs.
163
+ - `PaperDetails` walks citation graphs; `PaperFetch` fetches PDFs.
139
164
  - Multi-backend `WebSearch`, `WebFetch` with markdown extraction, atomic read/write tracking on file tools.
140
165
 
141
166
  8. Unix-aligned and pipeable.
@@ -146,7 +171,7 @@ See [Install](#install) for additional details.
146
171
  - Example: `ls files/` is auto-promoted to `List(files/)` tool call.
147
172
 
148
173
  10. Universal session format.
149
- - Convert claude/codex sessions to from sagent format and vice versa.
174
+ - Typed session records keep whatever no field names in `extra`.
150
175
 
151
176
  11. All spawns' sessions (ancestors and/or descendants) can be focused.
152
177
 
@@ -160,30 +185,32 @@ See [Install](#install) for additional details.
160
185
  - The same `Agent` class powers the CLI, your application code, and recursive sub-agents.
161
186
 
162
187
  15. Typed Python objects.
163
- - `Agent`, `Tool`, `Model`, `Provider`, and `Message` are protocols and dataclasses you import, compose, and unit-test.
188
+ - `Agent`, `Tool`, `Model`, `Provider`, and the session records are protocols and dataclasses you import, compose, and unit-test.
164
189
  - Passes strict: `basedpyright`, `pyrefly`, and `ty`.
165
190
 
166
191
  Example:
167
192
 
168
193
  ```python
169
- from sagent import tools
170
- from sagent.agent import Agent
171
- from sagent.lib.codec import immutable
172
- from sagent.providers import Google
173
-
174
- agent = Agent(
175
- model=Google.from_env().model("gemini-pro-3.1"),
176
- system="You are a scientist.",
177
- tools=[tools.Read(), tools.Glob(), tools.Grep()],
178
- )
179
- result = await agent.run(immutable({"prompt": "analyze the CSV in ./data/"}))
180
- print(result.content)
194
+ from sagent.agent.agent import Agent
195
+ from sagent.providers.catalog import ModelCatalog
196
+ from sagent.tools.glob_tool import Glob
197
+ from sagent.tools.grep import Grep
198
+ from sagent.tools.read import Read
199
+
200
+ async with ModelCatalog() as catalog:
201
+ async with Agent(
202
+ model=catalog["google"]["gemini-pro-3.1"],
203
+ system_prompt="You are a scientist.",
204
+ tools=[Read(), Glob(), Grep()],
205
+ ) as agent:
206
+ print(await agent.send("analyze the CSV in ./data/"))
181
207
  ```
182
208
 
183
209
  ## Install
184
210
 
185
211
  ```bash
186
212
  uv tool install sagent && sagent
213
+ # Later: uv tool upgrade sagent
187
214
  ```
188
215
 
189
216
  If you're missing `uvx`/`uv`,
@@ -225,9 +252,9 @@ Sagent supports all subscriptions and API KEYs.
225
252
 
226
253
  | Provider | Env variable / Command |
227
254
  | -------------- | ------------------------------ |
228
- | `Anthropic` | `ANTHROPIC_API_KEY` |
255
+ | `Anthropic` | `ANTHROPIC_API_KEY`, or workload identity |
229
256
  | `AnthropicCLI` | `sagent login --provider acli` |
230
- | `OpenAI` | `OPENAI_API_KEY` |
257
+ | `OpenAI` | `OPENAI_API_KEY`, or workload identity |
231
258
  | `Google` | `GOOGLE_API_KEY` |
232
259
  | `GoogleCLI` | `sagent login --provider gcli` |
233
260
  | `Moonshot` | `MOONSHOT_API_KEY` |
@@ -263,7 +290,7 @@ For a small smoke test:
263
290
 
264
291
  ```bash
265
292
  sagent --provider SelfHosted --model Qwen/Qwen3-0.6B+float16+cuda \
266
- --effort none --max-response-tokens 32 --max-tool-call-rounds 1
293
+ --effort none --max-tool-call-rounds 1
267
294
  ```
268
295
 
269
296
  SelfHosted options use `+` suffixes after the model name. Device, dtype, and `compile` can appear in any order, but each category can appear once.
@@ -276,6 +303,59 @@ endpoint. Point `LLAMA_CPP_SERVER` at a built `llama-server` binary and
276
303
 
277
304
  See [Self-hosted Models](https://github.com/rekursiv-ai/sagent/blob/main/docs/selfhosted.md) for options, local snapshot paths, and runtime requirements.
278
305
 
306
+ ## MCP
307
+
308
+ Sagent calls the tools of MCP servers. Manage them with `sagent mcp`, which
309
+ takes the arguments `claude mcp` does; each command has `--help`, and each is
310
+ also `/mcp.COMMAND` at the prompt:
311
+
312
+ ```bash
313
+ sagent mcp add git -- uvx mcp-server-git # a local command
314
+ sagent mcp add -t http linear https://mcp.linear.app/mcp # a remote URL
315
+ sagent mcp add -t http github https://api.githubcopilot.com/mcp/ \
316
+ -H 'Authorization: Bearer ${GITHUB_TOKEN}' # read at connect
317
+ sagent mcp login linear # OAuth sign-in to a remote server; --headless over ssh
318
+ sagent mcp list # each server, and whether it connects
319
+ sagent mcp get linear # one server
320
+ sagent mcp logout linear # forget its sign-in
321
+ sagent mcp remove linear # and the server
322
+ ```
323
+
324
+ `add` writes this project's servers; `-s user` writes every project's. A
325
+ session reads the servers it starts with; one already open keeps its own.
326
+
327
+ Each tool becomes `mcp__<server>__<tool>`. An `on_demand` server is one tool,
328
+ `mcp__<server>`, that lists, describes, and runs its tools, so a large server
329
+ costs no tokens until used. Its options beyond `add`'s flags go in with
330
+ `add-json`, as the entry another tool's `mcpServers` JSON holds:
331
+
332
+ ```bash
333
+ sagent mcp add-json linear '{"url": "https://mcp.linear.app/mcp", "loading": "on_demand"}'
334
+ ```
335
+
336
+ A remote server that signs users in with OAuth, as Linear and Notion do, needs
337
+ one sign-in before it connects. One that takes a token instead, as GitHub's
338
+ does, reads it from its header. Config copied from Claude Code, Cursor, or Pi
339
+ works as it is: pass the file with `--mcp-config PATH`.
340
+
341
+ In code, open the servers and pass their tools:
342
+
343
+ ```python
344
+ from pathlib import Path
345
+
346
+ from sagent.agent.agent import Agent
347
+ from sagent.providers.catalog import ModelCatalog
348
+ from sagent.tools.mcp import McpSession, servers
349
+ from sagent.tools.read import Read
350
+
351
+ async with ModelCatalog() as catalog, McpSession(servers(Path.cwd())) as mcp:
352
+ model = catalog["google"]["gemini-pro-3.1"]
353
+ async with Agent(model=model, tools=[Read(), *mcp.tools()]) as agent:
354
+ ...
355
+ ```
356
+
357
+ See the `sagent.tools.mcp` docstring for every field.
358
+
279
359
  ## Security and privacy
280
360
 
281
361
  Sagent is an agent runtime, not a sandbox. Enabled tools run with the current
@@ -285,7 +365,7 @@ services. Sessions are plaintext local state and may contain prompts, model
285
365
  responses, tool results, file snippets, and paths.
286
366
 
287
367
  Use narrow tool sets, pass `--ephemeral` for one-off sensitive
288
- prompts so sessions and auto-memory are disabled, and run Sagent inside your own
368
+ prompts so no journal or memories are kept, and run Sagent inside your own
289
369
  OS/container sandbox when a task needs hard isolation. See
290
370
  [Security](https://github.com/rekursiv-ai/sagent/blob/main/docs/security.md).
291
371
 
@@ -294,7 +374,7 @@ OS/container sandbox when a task needs hard isolation. See
294
374
  <details>
295
375
  <summary>How Sagent compares to aider, LangChain, Claude Code, Codex CLI, Gemini CLI, and other adjacent projects</summary>
296
376
 
297
- Not yet in Sagent: MCP, LSP, native sandboxing, desktop UI, tree-sitter repo map, hosted service, browser automation.
377
+ Not yet in Sagent: LSP, native sandboxing, desktop UI, tree-sitter repo map, hosted service, browser automation.
298
378
 
299
379
  This comparison focuses on the runtime shape rather than every feature
300
380
  of each project.
@@ -43,7 +43,7 @@ A coding-agent CLI and strongly-typed Python library -- self-mutating, hot-swapp
43
43
  ## Quick Start
44
44
 
45
45
  ```bash
46
- uvx sagent
46
+ uvx sagent@latest
47
47
  ```
48
48
 
49
49
  See [Install](#install) for additional details.
@@ -65,12 +65,12 @@ See [Install](#install) for additional details.
65
65
 
66
66
  4. Unified cost tracking.
67
67
  - One USD total across every provider in a session.
68
- - Pricing base don API costs when on sub.
68
+ - Pricing based on API costs when on sub.
69
69
  - Sub-agent costs roll up to the root. `--max-budget-usd N` caps the whole tree.
70
70
 
71
71
  5. Self-directing agent fleets.
72
72
  - Agents retune their own runtime -- provider, model, thinking, context -- mid-task.
73
- - A coordinator can do it to its workers over `AgentSend`: *"switch to o1, crank thinking, recompact and drop the file reads."*
73
+ - A coordinator can do it to its workers over `AgentSend`: *"switch to luna, crank thinking, recompact and drop the file reads."*
74
74
 
75
75
  6. Recursive agent messaging.
76
76
  - Any spawned agent can spawn and `AgentSend` to any peer, so coordination is a tree, not a star.
@@ -78,7 +78,7 @@ See [Install](#install) for additional details.
78
78
 
79
79
  7. Richer built-in tools.
80
80
  - WebSearch/Fetch use headed or headless chrome.
81
- - `PaperSearch`/`PaperFetch` walk citation graphs and fetch PDFs.
81
+ - `PaperDetails` walks citation graphs; `PaperFetch` fetches PDFs.
82
82
  - Multi-backend `WebSearch`, `WebFetch` with markdown extraction, atomic read/write tracking on file tools.
83
83
 
84
84
  8. Unix-aligned and pipeable.
@@ -89,7 +89,7 @@ See [Install](#install) for additional details.
89
89
  - Example: `ls files/` is auto-promoted to `List(files/)` tool call.
90
90
 
91
91
  10. Universal session format.
92
- - Convert claude/codex sessions to from sagent format and vice versa.
92
+ - Typed session records keep whatever no field names in `extra`.
93
93
 
94
94
  11. All spawns' sessions (ancestors and/or descendants) can be focused.
95
95
 
@@ -103,30 +103,32 @@ See [Install](#install) for additional details.
103
103
  - The same `Agent` class powers the CLI, your application code, and recursive sub-agents.
104
104
 
105
105
  15. Typed Python objects.
106
- - `Agent`, `Tool`, `Model`, `Provider`, and `Message` are protocols and dataclasses you import, compose, and unit-test.
106
+ - `Agent`, `Tool`, `Model`, `Provider`, and the session records are protocols and dataclasses you import, compose, and unit-test.
107
107
  - Passes strict: `basedpyright`, `pyrefly`, and `ty`.
108
108
 
109
109
  Example:
110
110
 
111
111
  ```python
112
- from sagent import tools
113
- from sagent.agent import Agent
114
- from sagent.lib.codec import immutable
115
- from sagent.providers import Google
116
-
117
- agent = Agent(
118
- model=Google.from_env().model("gemini-pro-3.1"),
119
- system="You are a scientist.",
120
- tools=[tools.Read(), tools.Glob(), tools.Grep()],
121
- )
122
- result = await agent.run(immutable({"prompt": "analyze the CSV in ./data/"}))
123
- print(result.content)
112
+ from sagent.agent.agent import Agent
113
+ from sagent.providers.catalog import ModelCatalog
114
+ from sagent.tools.glob_tool import Glob
115
+ from sagent.tools.grep import Grep
116
+ from sagent.tools.read import Read
117
+
118
+ async with ModelCatalog() as catalog:
119
+ async with Agent(
120
+ model=catalog["google"]["gemini-pro-3.1"],
121
+ system_prompt="You are a scientist.",
122
+ tools=[Read(), Glob(), Grep()],
123
+ ) as agent:
124
+ print(await agent.send("analyze the CSV in ./data/"))
124
125
  ```
125
126
 
126
127
  ## Install
127
128
 
128
129
  ```bash
129
130
  uv tool install sagent && sagent
131
+ # Later: uv tool upgrade sagent
130
132
  ```
131
133
 
132
134
  If you're missing `uvx`/`uv`,
@@ -168,9 +170,9 @@ Sagent supports all subscriptions and API KEYs.
168
170
 
169
171
  | Provider | Env variable / Command |
170
172
  | -------------- | ------------------------------ |
171
- | `Anthropic` | `ANTHROPIC_API_KEY` |
173
+ | `Anthropic` | `ANTHROPIC_API_KEY`, or workload identity |
172
174
  | `AnthropicCLI` | `sagent login --provider acli` |
173
- | `OpenAI` | `OPENAI_API_KEY` |
175
+ | `OpenAI` | `OPENAI_API_KEY`, or workload identity |
174
176
  | `Google` | `GOOGLE_API_KEY` |
175
177
  | `GoogleCLI` | `sagent login --provider gcli` |
176
178
  | `Moonshot` | `MOONSHOT_API_KEY` |
@@ -206,7 +208,7 @@ For a small smoke test:
206
208
 
207
209
  ```bash
208
210
  sagent --provider SelfHosted --model Qwen/Qwen3-0.6B+float16+cuda \
209
- --effort none --max-response-tokens 32 --max-tool-call-rounds 1
211
+ --effort none --max-tool-call-rounds 1
210
212
  ```
211
213
 
212
214
  SelfHosted options use `+` suffixes after the model name. Device, dtype, and `compile` can appear in any order, but each category can appear once.
@@ -219,6 +221,59 @@ endpoint. Point `LLAMA_CPP_SERVER` at a built `llama-server` binary and
219
221
 
220
222
  See [Self-hosted Models](https://github.com/rekursiv-ai/sagent/blob/main/docs/selfhosted.md) for options, local snapshot paths, and runtime requirements.
221
223
 
224
+ ## MCP
225
+
226
+ Sagent calls the tools of MCP servers. Manage them with `sagent mcp`, which
227
+ takes the arguments `claude mcp` does; each command has `--help`, and each is
228
+ also `/mcp.COMMAND` at the prompt:
229
+
230
+ ```bash
231
+ sagent mcp add git -- uvx mcp-server-git # a local command
232
+ sagent mcp add -t http linear https://mcp.linear.app/mcp # a remote URL
233
+ sagent mcp add -t http github https://api.githubcopilot.com/mcp/ \
234
+ -H 'Authorization: Bearer ${GITHUB_TOKEN}' # read at connect
235
+ sagent mcp login linear # OAuth sign-in to a remote server; --headless over ssh
236
+ sagent mcp list # each server, and whether it connects
237
+ sagent mcp get linear # one server
238
+ sagent mcp logout linear # forget its sign-in
239
+ sagent mcp remove linear # and the server
240
+ ```
241
+
242
+ `add` writes this project's servers; `-s user` writes every project's. A
243
+ session reads the servers it starts with; one already open keeps its own.
244
+
245
+ Each tool becomes `mcp__<server>__<tool>`. An `on_demand` server is one tool,
246
+ `mcp__<server>`, that lists, describes, and runs its tools, so a large server
247
+ costs no tokens until used. Its options beyond `add`'s flags go in with
248
+ `add-json`, as the entry another tool's `mcpServers` JSON holds:
249
+
250
+ ```bash
251
+ sagent mcp add-json linear '{"url": "https://mcp.linear.app/mcp", "loading": "on_demand"}'
252
+ ```
253
+
254
+ A remote server that signs users in with OAuth, as Linear and Notion do, needs
255
+ one sign-in before it connects. One that takes a token instead, as GitHub's
256
+ does, reads it from its header. Config copied from Claude Code, Cursor, or Pi
257
+ works as it is: pass the file with `--mcp-config PATH`.
258
+
259
+ In code, open the servers and pass their tools:
260
+
261
+ ```python
262
+ from pathlib import Path
263
+
264
+ from sagent.agent.agent import Agent
265
+ from sagent.providers.catalog import ModelCatalog
266
+ from sagent.tools.mcp import McpSession, servers
267
+ from sagent.tools.read import Read
268
+
269
+ async with ModelCatalog() as catalog, McpSession(servers(Path.cwd())) as mcp:
270
+ model = catalog["google"]["gemini-pro-3.1"]
271
+ async with Agent(model=model, tools=[Read(), *mcp.tools()]) as agent:
272
+ ...
273
+ ```
274
+
275
+ See the `sagent.tools.mcp` docstring for every field.
276
+
222
277
  ## Security and privacy
223
278
 
224
279
  Sagent is an agent runtime, not a sandbox. Enabled tools run with the current
@@ -228,7 +283,7 @@ services. Sessions are plaintext local state and may contain prompts, model
228
283
  responses, tool results, file snippets, and paths.
229
284
 
230
285
  Use narrow tool sets, pass `--ephemeral` for one-off sensitive
231
- prompts so sessions and auto-memory are disabled, and run Sagent inside your own
286
+ prompts so no journal or memories are kept, and run Sagent inside your own
232
287
  OS/container sandbox when a task needs hard isolation. See
233
288
  [Security](https://github.com/rekursiv-ai/sagent/blob/main/docs/security.md).
234
289
 
@@ -237,7 +292,7 @@ OS/container sandbox when a task needs hard isolation. See
237
292
  <details>
238
293
  <summary>How Sagent compares to aider, LangChain, Claude Code, Codex CLI, Gemini CLI, and other adjacent projects</summary>
239
294
 
240
- Not yet in Sagent: MCP, LSP, native sandboxing, desktop UI, tree-sitter repo map, hosted service, browser automation.
295
+ Not yet in Sagent: LSP, native sandboxing, desktop UI, tree-sitter repo map, hosted service, browser automation.
241
296
 
242
297
  This comparison focuses on the runtime shape rather than every feature
243
298
  of each project.