sagent 0.2.1__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.
- {sagent-0.2.1 → sagent-0.2.2}/.pre-commit-config.yaml +23 -24
- {sagent-0.2.1 → sagent-0.2.2}/CHANGELOG.md +39 -3
- {sagent-0.2.1 → sagent-0.2.2}/PKG-INFO +70 -43
- {sagent-0.2.1 → sagent-0.2.2}/README.md +30 -28
- sagent-0.2.2/docs/api.md +159 -0
- sagent-0.2.2/docs/architecture.md +78 -0
- {sagent-0.2.1 → sagent-0.2.2}/docs/cli.md +47 -61
- sagent-0.2.2/docs/compaction.md +119 -0
- sagent-0.2.2/docs/concepts.md +51 -0
- sagent-0.2.2/docs/providers.md +187 -0
- {sagent-0.2.1 → sagent-0.2.2}/docs/security.md +6 -13
- {sagent-0.2.1 → sagent-0.2.2}/docs/selfhosted.md +14 -16
- sagent-0.2.2/docs/sessions.md +84 -0
- sagent-0.2.2/docs/streaming.md +108 -0
- sagent-0.2.2/docs/tools.md +265 -0
- {sagent-0.2.1 → sagent-0.2.2}/docs/tutorial.md +51 -35
- {sagent-0.2.1 → sagent-0.2.2}/pyproject.toml +128 -55
- {sagent-0.2.1 → sagent-0.2.2}/sagent/__main__.py +1 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/agent.py +207 -148
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/agent_test.py +846 -50
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/agents_md.py +12 -11
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/agents_md_test.py +234 -9
- sagent-0.2.2/sagent/agent/assets/compactor_cut_off.md +1 -0
- sagent-0.2.2/sagent/agent/assets/compactor_partial_up_to.md +3 -0
- sagent-0.2.2/sagent/agent/assets/compactor_recent_from.md +1 -0
- sagent-0.2.2/sagent/agent/assets/compactor_recent_up_to.md +1 -0
- sagent-0.2.2/sagent/agent/assets/compactor_resume.md +1 -0
- sagent-0.2.2/sagent/agent/assets/compactor_resume_proactive.md +1 -0
- sagent-0.2.2/sagent/agent/assets/compactor_skill_elided.md +1 -0
- sagent-0.2.2/sagent/agent/assets/compactor_user_guidance.md +8 -0
- sagent-0.2.2/sagent/agent/assets/compactor_verify.md +7 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/cache_test.py +14 -5
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/compactor.py +454 -606
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/compactor_test.py +1569 -217
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/environment_test.py +4 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/pruner.py +35 -47
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/pruner_test.py +210 -17
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/scrunch.py +4 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/scrunch_test.py +161 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/team.py +358 -150
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/team_test.py +620 -52
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/types.py +29 -7
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/types_test.py +4 -4
- sagent-0.2.2/sagent/host/__init__.py +1 -0
- sagent-0.2.2/sagent/host/daemon.py +263 -0
- sagent-0.2.2/sagent/host/daemon_test.py +2038 -0
- sagent-0.2.2/sagent/host/server.py +1214 -0
- sagent-0.2.2/sagent/host/server_test.py +1489 -0
- sagent-0.2.2/sagent/host/session.py +484 -0
- sagent-0.2.2/sagent/host/session_test.py +520 -0
- sagent-0.2.2/sagent/host/settings.py +285 -0
- sagent-0.2.2/sagent/host/settings_test.py +198 -0
- sagent-0.2.2/sagent/host/strings.py +433 -0
- sagent-0.2.2/sagent/host/strings_test.py +338 -0
- sagent-0.2.2/sagent/host/testing.py +181 -0
- sagent-0.2.2/sagent/host/testing_test.py +75 -0
- sagent-0.2.2/sagent/host/tls.py +134 -0
- sagent-0.2.2/sagent/host/tls_test.py +91 -0
- sagent-0.2.2/sagent/host/wire.py +402 -0
- sagent-0.2.2/sagent/host/wire_test.py +204 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/layering_test.py +14 -9
- sagent-0.2.2/sagent/lib/asyncio_stalls.py +88 -0
- sagent-0.2.2/sagent/lib/asyncio_stalls_test.py +80 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/files/glob.py +8 -11
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/files/glob_test.py +76 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/files/grep.py +275 -90
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/files/grep_test.py +696 -25
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/files/owner_only.py +4 -1
- sagent-0.2.2/sagent/lib/files/owner_only_test.py +191 -0
- sagent-0.2.2/sagent/lib/files/source_version.py +61 -0
- sagent-0.2.2/sagent/lib/files/source_version_test.py +73 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/files/walk_test.py +33 -0
- sagent-0.2.2/sagent/lib/posix/attach.py +333 -0
- sagent-0.2.2/sagent/lib/posix/attach_test.py +1132 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/posix/child.py +42 -13
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/posix/child_test.py +101 -4
- sagent-0.2.2/sagent/lib/posix/detached.py +138 -0
- sagent-0.2.2/sagent/lib/posix/detached_test.py +161 -0
- sagent-0.2.2/sagent/lib/posix/host.py +598 -0
- sagent-0.2.2/sagent/lib/posix/host_test.py +1196 -0
- sagent-0.2.2/sagent/lib/posix/pids.py +239 -0
- sagent-0.2.2/sagent/lib/posix/pids_test.py +462 -0
- sagent-0.2.2/sagent/lib/posix/relay.py +707 -0
- sagent-0.2.2/sagent/lib/posix/relay_test.py +1936 -0
- sagent-0.2.2/sagent/lib/posix/sockets.py +117 -0
- sagent-0.2.2/sagent/lib/posix/sockets_test.py +241 -0
- sagent-0.2.2/sagent/lib/posix/terminal.py +659 -0
- sagent-0.2.2/sagent/lib/posix/terminal_test.py +1555 -0
- sagent-0.2.2/sagent/lib/testing/checks.py +134 -0
- sagent-0.2.2/sagent/lib/testing/checks_test.py +187 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/testing/resources.py +43 -13
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/testing/resources_test.py +254 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/testing/wheel.py +12 -5
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/yaml.py +13 -7
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/yaml_test.py +66 -3
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/capability.py +24 -14
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/capability_test.py +112 -26
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/context.py +1 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/context_test.py +3 -7
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/cost.py +21 -32
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/cost_test.py +71 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/exceptions_test.py +8 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/image.py +4 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/image_test.py +27 -3
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/scripted.py +4 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/scripted_test.py +14 -4
- sagent-0.2.2/sagent/model/token_accounting.py +302 -0
- sagent-0.2.2/sagent/model/token_accounting_test.py +449 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/types.py +11 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/types_test.py +2 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/api.py +99 -37
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/api_test.py +99 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/cli.py +26 -25
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/cli_test.py +128 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/login.py +40 -26
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/login_test.py +135 -6
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/wire.py +18 -19
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/wire_test.py +58 -4
- sagent-0.2.2/sagent/providers/azure/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/azure/api.py +28 -0
- sagent-0.2.2/sagent/providers/azure/api_test.py +97 -0
- sagent-0.2.2/sagent/providers/azure/azure.yaml +8 -0
- sagent-0.2.2/sagent/providers/bedrock/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/bedrock/api.py +40 -0
- sagent-0.2.2/sagent/providers/bedrock/api_test.py +106 -0
- sagent-0.2.2/sagent/providers/bedrock/bedrock.yaml +10 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/catalog.py +47 -10
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/catalog_test.py +193 -57
- sagent-0.2.2/sagent/providers/cerebras/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/cerebras/api.py +28 -0
- sagent-0.2.2/sagent/providers/cerebras/api_test.py +64 -0
- sagent-0.2.2/sagent/providers/cerebras/cerebras.yaml +41 -0
- sagent-0.2.2/sagent/providers/cloudflare/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/cloudflare/api.py +33 -0
- sagent-0.2.2/sagent/providers/cloudflare/api_test.py +44 -0
- sagent-0.2.2/sagent/providers/cloudflare/cloudflare.yaml +25 -0
- sagent-0.2.2/sagent/providers/cohere/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/cohere/api.py +186 -0
- sagent-0.2.2/sagent/providers/cohere/api_test.py +310 -0
- sagent-0.2.2/sagent/providers/cohere/cohere.yaml +36 -0
- sagent-0.2.2/sagent/providers/deepinfra/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/deepinfra/api.py +28 -0
- sagent-0.2.2/sagent/providers/deepinfra/api_test.py +63 -0
- sagent-0.2.2/sagent/providers/deepinfra/deepinfra.yaml +38 -0
- sagent-0.2.2/sagent/providers/deepseek/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/deepseek/api.py +38 -0
- sagent-0.2.2/sagent/providers/deepseek/api_test.py +65 -0
- sagent-0.2.2/sagent/providers/deepseek/deepseek.yaml +49 -0
- sagent-0.2.2/sagent/providers/fireworks/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/fireworks/api.py +37 -0
- sagent-0.2.2/sagent/providers/fireworks/api_test.py +66 -0
- sagent-0.2.2/sagent/providers/fireworks/fireworks.yaml +41 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/google/api.py +40 -31
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/google/api_test.py +38 -3
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/google/cli.py +28 -7
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/google/cli_test.py +532 -11
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/google/wire.py +2 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/google/wire_test.py +15 -6
- sagent-0.2.2/sagent/providers/groq/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/groq/api.py +37 -0
- sagent-0.2.2/sagent/providers/groq/api_test.py +72 -0
- sagent-0.2.2/sagent/providers/groq/groq.yaml +39 -0
- sagent-0.2.2/sagent/providers/huggingface/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/huggingface/api.py +32 -0
- sagent-0.2.2/sagent/providers/huggingface/api_test.py +65 -0
- sagent-0.2.2/sagent/providers/huggingface/huggingface.yaml +40 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/llamacpp/server.py +47 -37
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/llamacpp/server_test.py +122 -6
- sagent-0.2.2/sagent/providers/lmstudio/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/lmstudio/api.py +25 -0
- sagent-0.2.2/sagent/providers/lmstudio/api_test.py +32 -0
- sagent-0.2.2/sagent/providers/lmstudio/lmstudio.yaml +23 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/login.py +82 -30
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/login_test.py +302 -8
- sagent-0.2.2/sagent/providers/mistral/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/mistral/api.py +38 -0
- sagent-0.2.2/sagent/providers/mistral/api_test.py +91 -0
- sagent-0.2.2/sagent/providers/mistral/mistral.yaml +38 -0
- sagent-0.2.2/sagent/providers/nvidia/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/nvidia/api.py +34 -0
- sagent-0.2.2/sagent/providers/nvidia/api_test.py +35 -0
- sagent-0.2.2/sagent/providers/nvidia/nvidia.yaml +13 -0
- sagent-0.2.2/sagent/providers/ollama/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/ollama/api.py +25 -0
- sagent-0.2.2/sagent/providers/ollama/api_test.py +37 -0
- sagent-0.2.2/sagent/providers/ollama/ollama.yaml +23 -0
- sagent-0.2.2/sagent/providers/openai/api.py +137 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/api_test.py +63 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/chat.py +168 -14
- sagent-0.2.2/sagent/providers/openai/chat_test.py +1028 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/compat.py +104 -39
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/compat_test.py +173 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/lease.py +15 -7
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/lease_test.py +29 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/login.py +122 -123
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/login_test.py +269 -68
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/responses.py +16 -24
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/responses_test.py +176 -14
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/sub.py +3 -3
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/sub_test.py +48 -3
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/token_count.py +4 -12
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/token_count_test.py +133 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/wire.py +40 -10
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/wire_test.py +168 -0
- sagent-0.2.2/sagent/providers/openrouter/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/openrouter/api.py +42 -0
- sagent-0.2.2/sagent/providers/openrouter/api_test.py +50 -0
- sagent-0.2.2/sagent/providers/openrouter/openrouter.yaml +37 -0
- sagent-0.2.2/sagent/providers/perplexity/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/perplexity/api.py +51 -0
- sagent-0.2.2/sagent/providers/perplexity/api_test.py +55 -0
- sagent-0.2.2/sagent/providers/perplexity/perplexity.yaml +43 -0
- sagent-0.2.2/sagent/providers/replicate/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/replicate/api.py +168 -0
- sagent-0.2.2/sagent/providers/replicate/api_test.py +262 -0
- sagent-0.2.2/sagent/providers/replicate/replicate.yaml +9 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/resources.py +3 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/resources_test.py +114 -24
- sagent-0.2.2/sagent/providers/retry.py +61 -0
- sagent-0.2.2/sagent/providers/retry_test.py +133 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/selfhosted/calls.py +7 -7
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/selfhosted/calls_test.py +15 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/selfhosted/server.py +13 -16
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/selfhosted/server_test.py +281 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/selfhosted/vision.py +15 -12
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/selfhosted/vision_test.py +114 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/table.py +63 -14
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/table_test.py +415 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/testing.py +28 -3
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/testing_test.py +18 -3
- sagent-0.2.2/sagent/providers/together/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/together/api.py +28 -0
- sagent-0.2.2/sagent/providers/together/api_test.py +66 -0
- sagent-0.2.2/sagent/providers/together/together.yaml +41 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/tool_server.py +4 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/tool_server_test.py +26 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/types.py +12 -6
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/types_test.py +28 -11
- sagent-0.2.2/sagent/providers/vertex/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/vertex/api.py +117 -0
- sagent-0.2.2/sagent/providers/vertex/api_test.py +211 -0
- sagent-0.2.2/sagent/providers/vertex/vertex.yaml +33 -0
- sagent-0.2.2/sagent/providers/workload_identity.py +162 -0
- sagent-0.2.2/sagent/providers/workload_identity_test.py +216 -0
- sagent-0.2.2/sagent/providers/xai/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/xai/api.py +31 -0
- sagent-0.2.2/sagent/providers/xai/api_test.py +67 -0
- sagent-0.2.2/sagent/providers/xai/xai.yaml +42 -0
- sagent-0.2.2/sagent/providers/zai/__init__.py +1 -0
- sagent-0.2.2/sagent/providers/zai/api.py +39 -0
- sagent-0.2.2/sagent/providers/zai/api_test.py +66 -0
- sagent-0.2.2/sagent/providers/zai/zai.yaml +41 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/context.py +10 -6
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/context_test.py +42 -5
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/runtime.py +57 -83
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/runtime_test.py +262 -59
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/tape.py +9 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/tape_test.py +6 -5
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/types_test.py +2 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/scripts/check_wheel.py +4 -11
- {sagent-0.2.1 → sagent-0.2.2}/sagent/scripts/check_wheel_test.py +44 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/scripts/convert_sessions.py +20 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/scripts/convert_sessions_test.py +51 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/scripts/swebench.py +7 -6
- {sagent-0.2.1 → sagent-0.2.2}/sagent/scripts/swebench_test.py +444 -44
- sagent-0.2.2/sagent/session/jsonl.py +332 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/jsonl_test.py +203 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/legacy_journal.py +44 -34
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/legacy_journal_test.py +428 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/projects.py +35 -27
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/projects_test.py +41 -12
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/recording.py +9 -5
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/recording_test.py +10 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/types.py +543 -50
- sagent-0.2.2/sagent/session/types_test.py +592 -0
- sagent-0.2.2/sagent/settings/exceptions.py +32 -0
- sagent-0.2.2/sagent/settings/exceptions_test.py +27 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/flags.py +60 -6
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/flags_test.py +9 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/types.py +4 -7
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/types_test.py +2 -10
- {sagent-0.2.1 → sagent-0.2.2}/sagent/skills/watch/SKILL.md +6 -5
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/agent_self.py +41 -23
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/agent_self_test.py +109 -9
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/agent_send.py +41 -21
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/agent_send_test.py +144 -4
- sagent-0.2.1/sagent/tools/session.py → sagent-0.2.2/sagent/tools/agent_session.py +75 -59
- sagent-0.2.1/sagent/tools/session_test.py → sagent-0.2.2/sagent/tools/agent_session_test.py +171 -52
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/agent_spawn.py +71 -39
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/agent_spawn_test.py +768 -67
- sagent-0.2.2/sagent/tools/agent_tool.py +56 -0
- sagent-0.2.2/sagent/tools/agent_tool_test.py +409 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/agentself.md +3 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/agentspawn.md +7 -3
- sagent-0.2.2/sagent/tools/assets/grep.md +12 -0
- sagent-0.2.2/sagent/tools/assets/remotetool.md +11 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/session.md +5 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/background_task.py +20 -10
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/background_task_test.py +16 -5
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/bash.py +29 -21
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/bash_test.py +244 -37
- sagent-0.2.2/sagent/tools/builtin.py +133 -0
- sagent-0.2.2/sagent/tools/builtin_test.py +81 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/command_analyzer.py +87 -77
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/command_analyzer_test.py +226 -16
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/display.py +4 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/edit.py +23 -24
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/edit_test.py +15 -6
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/function.py +118 -22
- sagent-0.2.2/sagent/tools/function_test.py +390 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/glob_tool.py +19 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/grep.py +269 -64
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/grep_test.py +387 -14
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/list.py +8 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/mcp.py +169 -52
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/mcp_auth.py +83 -36
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/mcp_auth_test.py +226 -42
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/mcp_settings.py +10 -24
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/mcp_settings_test.py +97 -31
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/mcp_test.py +764 -85
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/memory.py +12 -6
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/memory_test.py +45 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_author.py +44 -28
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_author_test.py +125 -17
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_common.py +4 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_common_test.py +3 -3
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_details.py +24 -22
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_details_test.py +17 -13
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_fetch.py +18 -14
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_fetch_test.py +11 -19
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_search.py +10 -14
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/paper_search_test.py +5 -10
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/play_audio.py +13 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/read.py +53 -35
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/read_test.py +149 -22
- sagent-0.2.2/sagent/tools/remote.py +806 -0
- sagent-0.2.2/sagent/tools/remote_settings.py +164 -0
- sagent-0.2.2/sagent/tools/remote_settings_test.py +99 -0
- sagent-0.2.2/sagent/tools/remote_test.py +1024 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/skill.py +24 -15
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/skill_test.py +55 -14
- sagent-0.2.2/sagent/tools/testing.py +60 -0
- sagent-0.2.2/sagent/tools/testing_test.py +95 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/types.py +25 -12
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/types_test.py +32 -10
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/watch.py +6 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/watch_test.py +122 -3
- sagent-0.2.2/sagent/tools/web_browser.py +136 -0
- sagent-0.2.2/sagent/tools/web_browser_test.py +324 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/web_fetch.py +9 -12
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/web_fetch_test.py +19 -27
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/web_search.py +12 -16
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/web_search_test.py +18 -23
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/write.py +8 -8
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/write_test.py +4 -4
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/assets/holidays.yaml +32 -33
- sagent-0.2.2/sagent/tui/assets/themes/dark.yaml +27 -0
- sagent-0.2.2/sagent/tui/assets/themes/default.yaml +58 -0
- sagent-0.2.2/sagent/tui/assets/themes/light.yaml +27 -0
- sagent-0.2.2/sagent/tui/assets/themes/terminal.yaml +42 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/console.py +289 -98
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/console_test.py +606 -122
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/diff.py +68 -79
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/diff_test.py +266 -10
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/holiday.py +152 -44
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/holiday_test.py +351 -30
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/main.py +342 -145
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/main_test.py +1996 -230
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/markdown.py +40 -7
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/markdown_test.py +83 -4
- sagent-0.2.2/sagent/tui/peers_test.py +76 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/prompt.py +21 -13
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/prompt_test.py +65 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/recording.py +31 -6
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/recording_test.py +9 -3
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/render.py +40 -49
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/render_test.py +212 -45
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/replay_test.py +9 -18
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/settings/model.py +8 -17
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/settings/model_test.py +109 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/settings/runtime.py +2 -1
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/settings/runtime_test.py +32 -0
- sagent-0.2.2/sagent/tui/settings/screen.py +113 -0
- sagent-0.2.2/sagent/tui/settings/screen_test.py +140 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/settings/tool.py +3 -2
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/settings/tool_test.py +9 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/slash.py +179 -58
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/slash_test.py +380 -17
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/status_test.py +1 -1
- sagent-0.2.2/sagent/tui/theme.py +555 -0
- sagent-0.2.2/sagent/tui/theme_test.py +741 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/tree.py +28 -26
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/tree_test.py +224 -5
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/types.py +5 -2
- sagent-0.2.2/sagent/tui/types_test.py +339 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/views.py +14 -9
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/views_test.py +292 -49
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/welcome.py +57 -37
- sagent-0.2.2/sagent/tui/welcome_test.py +915 -0
- {sagent-0.2.1 → sagent-0.2.2}/tests/wheel_test.py +56 -1
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/__main__.py +1 -1
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/fakes.py +31 -7
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/fakes_test.py +47 -5
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/gate.py +163 -73
- sagent-0.2.2/tools/gate/gate_test.py +628 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/spool_test.py +15 -1
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/worker_count.py +9 -4
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/worker_count_test.py +116 -2
- {sagent-0.2.1 → sagent-0.2.2}/tools/testing/__main__.py +1 -1
- {sagent-0.2.1 → sagent-0.2.2}/tools/testing/coverage_summary.py +5 -4
- {sagent-0.2.1 → sagent-0.2.2}/tools/testing/coverage_summary_test.py +18 -13
- sagent-0.2.2/tools/testing/listing.py +285 -0
- sagent-0.2.2/tools/testing/listing_test.py +722 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/testing/testing.py +52 -47
- sagent-0.2.2/tools/testing/testing_test.py +1045 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/typecheck/__main__.py +1 -1
- {sagent-0.2.1 → sagent-0.2.2}/tools/typecheck/scope_test.py +5 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/typecheck/typecheck.py +40 -19
- {sagent-0.2.1 → sagent-0.2.2}/tools/typecheck/typecheck_test.py +164 -5
- {sagent-0.2.1 → sagent-0.2.2}/uv.lock +1553 -1432
- sagent-0.2.1/docs/api.md +0 -184
- sagent-0.2.1/docs/architecture.md +0 -89
- sagent-0.2.1/docs/compaction.md +0 -152
- sagent-0.2.1/docs/concepts.md +0 -55
- sagent-0.2.1/docs/providers.md +0 -176
- sagent-0.2.1/docs/sessions.md +0 -89
- sagent-0.2.1/docs/streaming.md +0 -101
- sagent-0.2.1/docs/tools.md +0 -254
- sagent-0.2.1/sagent/lib/files/owner_only_test.py +0 -92
- sagent-0.2.1/sagent/lib/posix/pids.py +0 -116
- sagent-0.2.1/sagent/lib/posix/pids_test.py +0 -165
- sagent-0.2.1/sagent/providers/openai/api.py +0 -89
- sagent-0.2.1/sagent/providers/openai/chat_test.py +0 -447
- sagent-0.2.1/sagent/session/jsonl.py +0 -229
- sagent-0.2.1/sagent/session/types_test.py +0 -342
- sagent-0.2.1/sagent/tools/assets/grep.md +0 -10
- sagent-0.2.1/sagent/tools/function_test.py +0 -191
- sagent-0.2.1/sagent/tui/settings/screen.py +0 -58
- sagent-0.2.1/sagent/tui/settings/screen_test.py +0 -46
- sagent-0.2.1/sagent/tui/types_test.py +0 -110
- sagent-0.2.1/sagent/tui/welcome_test.py +0 -492
- sagent-0.2.1/tools/gate/gate_test.py +0 -283
- sagent-0.2.1/tools/testing/testing_test.py +0 -549
- {sagent-0.2.1 → sagent-0.2.2}/.gitignore +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/.python-version +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/AI_POLICY.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/CODE_OF_CONDUCT.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/CONTRIBUTING.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/LICENSE +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/RELEASING.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/SECURITY.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/assets/logo-custom.webp +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/conftest.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/docs/showcase.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/assets/compactor.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/assets/compactor_continuation.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/assets/compactor_no_tools.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/assets/compactor_no_tools_reminder.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/assets/compactor_partial.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/assets/compactor_session_audit.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/assets/compactor_system.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/assets/system_prompt.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/environment.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/fold.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/agent/fold_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/files/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/files/walk.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/posix/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/testing/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/testing/runner.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/testing/runner_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/userdirs.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/lib/userdirs_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/model/exceptions.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/anthropic/anthropic.yaml +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/dashscope/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/dashscope/api.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/dashscope/api_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/dashscope/dashscope.yaml +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/google/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/google/google.yaml +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/llamacpp/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/llamacpp/llamacpp.yaml +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/minimax/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/minimax/api.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/minimax/api_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/minimax/minimax.yaml +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/moonshot/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/moonshot/api.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/moonshot/api_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/moonshot/moonshot.yaml +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/openai/openai.yaml +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/providers/selfhosted/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/exceptions.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/exceptions_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/runtime/types.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/scripts/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/session/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/harvest.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/harvest_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/match.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/settings/match_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/agentsend.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/backgroundtask.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/bash.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/bash.yaml +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/edit.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/glob.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/list.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/memory.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/paperauthor.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/paperdetails.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/paperfetch.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/papersearch.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/playaudio.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/read.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/skill.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/webfetch.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/websearch.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/assets/write.md +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/display_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/glob_tool_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/list_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tools/play_audio_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/replay.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/settings/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/tui/status.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/types.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/sagent/types_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/gate/spool.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/testing/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/testing/tiers.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/testing/tiers_test.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/typecheck/__init__.py +0 -0
- {sagent-0.2.1 → sagent-0.2.2}/tools/typecheck/scope.py +0 -0
- {sagent-0.2.1 → 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
|
-
#
|
|
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: [
|
|
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: [
|
|
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,13 +3,49 @@
|
|
|
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
|
+
|
|
6
42
|
## 0.2.1 - 2026-10-30
|
|
7
43
|
|
|
8
44
|
### Added
|
|
9
45
|
|
|
10
|
-
- The welcome logo becomes a holiday icon
|
|
11
|
-
|
|
12
|
-
at random. Dates follow US observance: computed for seasons, Lunar New
|
|
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
|
|
13
49
|
Year, Mid-Autumn, Holi, Diwali, Vaisakhi, Easter, Thanksgiving and the
|
|
14
50
|
Hebrew holidays; announced for the Eids and Vesak. Terminals without 256
|
|
15
51
|
colors, or with `NO_COLOR`, keep the logo.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sagent
|
|
3
|
-
Version: 0.2.
|
|
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.
|
|
27
|
-
Requires-Dist:
|
|
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.
|
|
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
|
|
38
|
-
Requires-Dist: tiktoken>=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.
|
|
41
|
+
Requires-Dist: uvicorn>=0.54.0
|
|
41
42
|
Requires-Dist: wesearch>=0.1.15
|
|
42
|
-
Requires-Dist: wrapt>=2.5.
|
|
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.
|
|
45
|
-
Requires-Dist: auto-round>=0.
|
|
46
|
-
Requires-Dist: compressed-tensors>=0.
|
|
47
|
-
Requires-Dist: kernels>=0.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
-
- `
|
|
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
|
-
-
|
|
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
|
|
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
|
|
170
|
-
from sagent.
|
|
171
|
-
from sagent.
|
|
172
|
-
from sagent.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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-
|
|
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.
|
|
@@ -316,14 +343,14 @@ In code, open the servers and pass their tools:
|
|
|
316
343
|
```python
|
|
317
344
|
from pathlib import Path
|
|
318
345
|
|
|
319
|
-
from sagent import
|
|
320
|
-
from sagent.
|
|
321
|
-
from sagent.providers import Google
|
|
346
|
+
from sagent.agent.agent import Agent
|
|
347
|
+
from sagent.providers.catalog import ModelCatalog
|
|
322
348
|
from sagent.tools.mcp import McpSession, servers
|
|
349
|
+
from sagent.tools.read import Read
|
|
323
350
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
async with Agent(model=model, tools=[
|
|
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:
|
|
327
354
|
...
|
|
328
355
|
```
|
|
329
356
|
|
|
@@ -338,7 +365,7 @@ services. Sessions are plaintext local state and may contain prompts, model
|
|
|
338
365
|
responses, tool results, file snippets, and paths.
|
|
339
366
|
|
|
340
367
|
Use narrow tool sets, pass `--ephemeral` for one-off sensitive
|
|
341
|
-
prompts so
|
|
368
|
+
prompts so no journal or memories are kept, and run Sagent inside your own
|
|
342
369
|
OS/container sandbox when a task needs hard isolation. See
|
|
343
370
|
[Security](https://github.com/rekursiv-ai/sagent/blob/main/docs/security.md).
|
|
344
371
|
|
|
@@ -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
|
|
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
|
|
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
|
-
- `
|
|
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
|
-
-
|
|
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
|
|
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
|
|
113
|
-
from sagent.
|
|
114
|
-
from sagent.
|
|
115
|
-
from sagent.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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-
|
|
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.
|
|
@@ -259,14 +261,14 @@ In code, open the servers and pass their tools:
|
|
|
259
261
|
```python
|
|
260
262
|
from pathlib import Path
|
|
261
263
|
|
|
262
|
-
from sagent import
|
|
263
|
-
from sagent.
|
|
264
|
-
from sagent.providers import Google
|
|
264
|
+
from sagent.agent.agent import Agent
|
|
265
|
+
from sagent.providers.catalog import ModelCatalog
|
|
265
266
|
from sagent.tools.mcp import McpSession, servers
|
|
267
|
+
from sagent.tools.read import Read
|
|
266
268
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
async with Agent(model=model, tools=[
|
|
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:
|
|
270
272
|
...
|
|
271
273
|
```
|
|
272
274
|
|
|
@@ -281,7 +283,7 @@ services. Sessions are plaintext local state and may contain prompts, model
|
|
|
281
283
|
responses, tool results, file snippets, and paths.
|
|
282
284
|
|
|
283
285
|
Use narrow tool sets, pass `--ephemeral` for one-off sensitive
|
|
284
|
-
prompts so
|
|
286
|
+
prompts so no journal or memories are kept, and run Sagent inside your own
|
|
285
287
|
OS/container sandbox when a task needs hard isolation. See
|
|
286
288
|
[Security](https://github.com/rekursiv-ai/sagent/blob/main/docs/security.md).
|
|
287
289
|
|
sagent-0.2.2/docs/api.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Python API
|
|
2
|
+
|
|
3
|
+
Sagent is a Python runtime for typed agent loops. The CLI is a thin surface over the same `Agent`, `Model`, `Provider`, and `Tool` contracts.
|
|
4
|
+
|
|
5
|
+
## Minimal agent
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
import asyncio
|
|
9
|
+
|
|
10
|
+
from sagent.agent.agent import Agent
|
|
11
|
+
from sagent.providers.catalog import ModelCatalog
|
|
12
|
+
from sagent.tools.glob_tool import Glob
|
|
13
|
+
from sagent.tools.grep import Grep
|
|
14
|
+
from sagent.tools.read import Read
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
async def main() -> None:
|
|
18
|
+
async with ModelCatalog() as catalog:
|
|
19
|
+
async with Agent(
|
|
20
|
+
model=catalog["google"]["gemini-pro-3.1"],
|
|
21
|
+
system_prompt="You summarize files concisely.",
|
|
22
|
+
tools=[Read(), Glob(), Grep()],
|
|
23
|
+
) as agent:
|
|
24
|
+
print(await agent.send("Summarize README.md"))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
asyncio.run(main())
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`async with Agent(...)` starts the runtime; `send()` returns the reply's text once the agent is idle.
|
|
31
|
+
|
|
32
|
+
## Agent constructor
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
agent = Agent(
|
|
36
|
+
model=model,
|
|
37
|
+
tools=(),
|
|
38
|
+
system_prompt=None,
|
|
39
|
+
journal=None,
|
|
40
|
+
compactor=NoShrinker,
|
|
41
|
+
pruner=NoShrinker,
|
|
42
|
+
tool_context=None,
|
|
43
|
+
max_rounds=None,
|
|
44
|
+
max_spend_usd=None,
|
|
45
|
+
persistent_retry=False,
|
|
46
|
+
agents_md=None,
|
|
47
|
+
allowed=None,
|
|
48
|
+
environment=True,
|
|
49
|
+
account=None,
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Every argument is keyword-only.
|
|
54
|
+
|
|
55
|
+
| Argument | Meaning |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `model` | Required `Model`; assign `agent.model` later to switch. |
|
|
58
|
+
| `tools` | Tools the model may call; names must differ. |
|
|
59
|
+
| `system_prompt` | What the model is told it is; `None` uses the default prompt. |
|
|
60
|
+
| `journal` | Where the session is written; `None` keeps nothing. Open a `JsonlJournal` yourself and pass it. |
|
|
61
|
+
| `compactor` | Factory for what summarizes the session, usually `SummaryCompactor`. |
|
|
62
|
+
| `pruner` | Factory for what drops old tool results, usually `Pruner`. |
|
|
63
|
+
| `tool_context` | Working directory, result size limit, terminal width, and fetch session; `ToolContext()` when omitted. |
|
|
64
|
+
| `max_rounds` | Tool-call rounds one turn may run; `None` for no cap. |
|
|
65
|
+
| `max_spend_usd` | USD the agent may spend; `None` for no cap. |
|
|
66
|
+
| `persistent_retry` | Wait out a long rate limit instead of raising. |
|
|
67
|
+
| `agents_md` | Where `AGENTS.md` files are looked for; defaults when omitted. |
|
|
68
|
+
| `allowed` | Tool names the model may call; `None` for all. The rest are still offered, so the prompt cache holds. |
|
|
69
|
+
| `environment` | Tell the model its directory, git state, platform, and shell. |
|
|
70
|
+
| `account` | Named login for the model's provider; `None` for its default. |
|
|
71
|
+
|
|
72
|
+
## Running agents
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
reply = await agent.send("Do the task")
|
|
76
|
+
|
|
77
|
+
async for words in agent.stream("Now explain it"):
|
|
78
|
+
print(words, end="")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- `send(text, attachments=())` returns the last text the model wrote in the turn.
|
|
82
|
+
- `stream(text, attachments=())` yields the reply's text as it is written.
|
|
83
|
+
- Both raise `BudgetExhaustedError` past `max_spend_usd` and `RoundLimitError` past `max_rounds`.
|
|
84
|
+
- `attachments` takes `Attachment(mime_descriptor=..., data=...)` images and documents.
|
|
85
|
+
|
|
86
|
+
Every runtime event -- thinking, tool calls, tool results, compactions -- goes to `agent.runtime`. See [Streaming](streaming.md).
|
|
87
|
+
|
|
88
|
+
## Observable state
|
|
89
|
+
|
|
90
|
+
| Attribute | Meaning |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| `model` | Current model; assign to switch at the next model call. |
|
|
93
|
+
| `system_prompt` | Assign to change what the model is told it is. |
|
|
94
|
+
| `tools` | Tools offered, by name. |
|
|
95
|
+
| `allowed` | Tools the model may call; assign to change. |
|
|
96
|
+
| `session` | The conversation: iterate it, `append()` records, `clear()`, and reach its `journal`, `compactor`, and `pruner`. |
|
|
97
|
+
| `runtime` | What runs the turns: `observers`, `async for event in agent.runtime`, `halt()`, `jobs`. |
|
|
98
|
+
| `spend_usd` | USD the model calls have cost, a resumed session's included. |
|
|
99
|
+
| `max_rounds`, `max_spend_usd` | The caps; assign to change. |
|
|
100
|
+
| `running` | Whether the runtime serves turns. |
|
|
101
|
+
| `root` | Where the session started. |
|
|
102
|
+
|
|
103
|
+
## Models and providers
|
|
104
|
+
|
|
105
|
+
A `ModelCatalog` holds every provider, sharing one HTTP client and process pool. Looking a model up does no I/O.
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
async with ModelCatalog() as catalog:
|
|
109
|
+
model = catalog["google"]["gemini-pro-3.1"]
|
|
110
|
+
utility = catalog["google"]["utility"]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
A provider can also be used alone:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from sagent.providers.google.api import Google
|
|
117
|
+
|
|
118
|
+
async with Google() as google:
|
|
119
|
+
model = google["gemini-pro-3.1"]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
A `Model` exposes:
|
|
123
|
+
|
|
124
|
+
- `capability`: every setting it offers, its limits, and its prices.
|
|
125
|
+
- `settings`: the settings chosen; assign to change them.
|
|
126
|
+
- `count(request)`: tokens a `Request` would send.
|
|
127
|
+
- `stream(request)`: yields `TextChunk`s, then the finished `Response`.
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from dataclasses import replace
|
|
131
|
+
|
|
132
|
+
model.settings = replace(model.settings, thinking_effort="high")
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`Request` holds system prompt blocks, session records, and tools. `Response` holds the reply's records, token counts, spend, and stop reason.
|
|
136
|
+
|
|
137
|
+
## Session records
|
|
138
|
+
|
|
139
|
+
A session is a sequence of frozen dataclasses from `sagent.session.types`: `UserMessage`, `AssistantMessage`, `Thinking`, `ToolCall`, tool results such as `BashResult` and `UncategorizedToolResult`, `SystemMessage`, and more. `JsonlJournal` writes one record per JSON line.
|
|
140
|
+
|
|
141
|
+
## Tools
|
|
142
|
+
|
|
143
|
+
A tool has a `name`, `description`, JSON `schema`, and `display`, and implements:
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
def summary(self, arguments: Mapping[str, PlainTree]) -> str: ...
|
|
147
|
+
def serialize_key(
|
|
148
|
+
self, context: ToolContext, arguments: Mapping[str, PlainTree]
|
|
149
|
+
) -> str | None: ...
|
|
150
|
+
async def call(
|
|
151
|
+
self, context: ToolContext, arguments: Mapping[str, PlainTree]
|
|
152
|
+
) -> AnyToolResult: ...
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
See [Tools](tools.md) for built-ins and custom-tool examples.
|
|
156
|
+
|
|
157
|
+
## Costs
|
|
158
|
+
|
|
159
|
+
Each `Response` carries its `TokenCount` and `TokenCost`. `agent.spend_usd` sums them across the session, children's spend included. With `max_spend_usd` set, the turn halts and raises `BudgetExhaustedError` once spend reaches the cap.
|