agentpool 2.1.9__py3-none-any.whl
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.
Potentially problematic release.
This version of agentpool might be problematic. Click here for more details.
- acp/README.md +64 -0
- acp/__init__.py +172 -0
- acp/__main__.py +10 -0
- acp/acp_requests.py +285 -0
- acp/agent/__init__.py +6 -0
- acp/agent/connection.py +256 -0
- acp/agent/implementations/__init__.py +6 -0
- acp/agent/implementations/debug_server/__init__.py +1 -0
- acp/agent/implementations/debug_server/cli.py +79 -0
- acp/agent/implementations/debug_server/debug.html +234 -0
- acp/agent/implementations/debug_server/debug_server.py +496 -0
- acp/agent/implementations/testing.py +91 -0
- acp/agent/protocol.py +65 -0
- acp/bridge/README.md +162 -0
- acp/bridge/__init__.py +6 -0
- acp/bridge/__main__.py +91 -0
- acp/bridge/bridge.py +246 -0
- acp/bridge/py.typed +0 -0
- acp/bridge/settings.py +15 -0
- acp/client/__init__.py +7 -0
- acp/client/connection.py +251 -0
- acp/client/implementations/__init__.py +7 -0
- acp/client/implementations/default_client.py +185 -0
- acp/client/implementations/headless_client.py +266 -0
- acp/client/implementations/noop_client.py +110 -0
- acp/client/protocol.py +61 -0
- acp/connection.py +280 -0
- acp/exceptions.py +46 -0
- acp/filesystem.py +524 -0
- acp/notifications.py +832 -0
- acp/py.typed +0 -0
- acp/schema/__init__.py +265 -0
- acp/schema/agent_plan.py +30 -0
- acp/schema/agent_requests.py +126 -0
- acp/schema/agent_responses.py +256 -0
- acp/schema/base.py +39 -0
- acp/schema/capabilities.py +230 -0
- acp/schema/client_requests.py +247 -0
- acp/schema/client_responses.py +96 -0
- acp/schema/common.py +81 -0
- acp/schema/content_blocks.py +188 -0
- acp/schema/mcp.py +82 -0
- acp/schema/messages.py +171 -0
- acp/schema/notifications.py +82 -0
- acp/schema/protocol_stuff.md +3 -0
- acp/schema/session_state.py +160 -0
- acp/schema/session_updates.py +419 -0
- acp/schema/slash_commands.py +51 -0
- acp/schema/terminal.py +15 -0
- acp/schema/tool_call.py +347 -0
- acp/stdio.py +250 -0
- acp/task/__init__.py +53 -0
- acp/task/debug.py +197 -0
- acp/task/dispatcher.py +93 -0
- acp/task/queue.py +69 -0
- acp/task/sender.py +82 -0
- acp/task/state.py +87 -0
- acp/task/supervisor.py +93 -0
- acp/terminal_handle.py +30 -0
- acp/tool_call_reporter.py +199 -0
- acp/tool_call_state.py +178 -0
- acp/transports.py +104 -0
- acp/utils.py +240 -0
- agentpool/__init__.py +63 -0
- agentpool/__main__.py +7 -0
- agentpool/agents/__init__.py +30 -0
- agentpool/agents/acp_agent/__init__.py +5 -0
- agentpool/agents/acp_agent/acp_agent.py +837 -0
- agentpool/agents/acp_agent/acp_converters.py +294 -0
- agentpool/agents/acp_agent/client_handler.py +317 -0
- agentpool/agents/acp_agent/session_state.py +44 -0
- agentpool/agents/agent.py +1264 -0
- agentpool/agents/agui_agent/__init__.py +19 -0
- agentpool/agents/agui_agent/agui_agent.py +677 -0
- agentpool/agents/agui_agent/agui_converters.py +423 -0
- agentpool/agents/agui_agent/chunk_transformer.py +204 -0
- agentpool/agents/agui_agent/event_types.py +83 -0
- agentpool/agents/agui_agent/helpers.py +192 -0
- agentpool/agents/architect.py +71 -0
- agentpool/agents/base_agent.py +177 -0
- agentpool/agents/claude_code_agent/__init__.py +11 -0
- agentpool/agents/claude_code_agent/claude_code_agent.py +1021 -0
- agentpool/agents/claude_code_agent/converters.py +243 -0
- agentpool/agents/context.py +105 -0
- agentpool/agents/events/__init__.py +61 -0
- agentpool/agents/events/builtin_handlers.py +129 -0
- agentpool/agents/events/event_emitter.py +320 -0
- agentpool/agents/events/events.py +561 -0
- agentpool/agents/events/tts_handlers.py +186 -0
- agentpool/agents/interactions.py +419 -0
- agentpool/agents/slashed_agent.py +244 -0
- agentpool/agents/sys_prompts.py +178 -0
- agentpool/agents/tool_wrapping.py +184 -0
- agentpool/base_provider.py +28 -0
- agentpool/common_types.py +226 -0
- agentpool/config_resources/__init__.py +16 -0
- agentpool/config_resources/acp_assistant.yml +24 -0
- agentpool/config_resources/agents.yml +109 -0
- agentpool/config_resources/agents_template.yml +18 -0
- agentpool/config_resources/agui_test.yml +18 -0
- agentpool/config_resources/claude_code_agent.yml +16 -0
- agentpool/config_resources/claude_style_subagent.md +30 -0
- agentpool/config_resources/external_acp_agents.yml +77 -0
- agentpool/config_resources/opencode_style_subagent.md +19 -0
- agentpool/config_resources/tts_test_agents.yml +78 -0
- agentpool/delegation/__init__.py +8 -0
- agentpool/delegation/base_team.py +504 -0
- agentpool/delegation/message_flow_tracker.py +39 -0
- agentpool/delegation/pool.py +1129 -0
- agentpool/delegation/team.py +325 -0
- agentpool/delegation/teamrun.py +343 -0
- agentpool/docs/__init__.py +5 -0
- agentpool/docs/gen_examples.py +42 -0
- agentpool/docs/utils.py +370 -0
- agentpool/functional/__init__.py +20 -0
- agentpool/functional/py.typed +0 -0
- agentpool/functional/run.py +80 -0
- agentpool/functional/structure.py +136 -0
- agentpool/hooks/__init__.py +20 -0
- agentpool/hooks/agent_hooks.py +247 -0
- agentpool/hooks/base.py +119 -0
- agentpool/hooks/callable.py +140 -0
- agentpool/hooks/command.py +180 -0
- agentpool/hooks/prompt.py +122 -0
- agentpool/jinja_filters.py +132 -0
- agentpool/log.py +224 -0
- agentpool/mcp_server/__init__.py +17 -0
- agentpool/mcp_server/client.py +429 -0
- agentpool/mcp_server/constants.py +32 -0
- agentpool/mcp_server/conversions.py +172 -0
- agentpool/mcp_server/helpers.py +47 -0
- agentpool/mcp_server/manager.py +232 -0
- agentpool/mcp_server/message_handler.py +164 -0
- agentpool/mcp_server/registries/__init__.py +1 -0
- agentpool/mcp_server/registries/official_registry_client.py +345 -0
- agentpool/mcp_server/registries/pulsemcp_client.py +88 -0
- agentpool/mcp_server/tool_bridge.py +548 -0
- agentpool/messaging/__init__.py +58 -0
- agentpool/messaging/compaction.py +928 -0
- agentpool/messaging/connection_manager.py +319 -0
- agentpool/messaging/context.py +66 -0
- agentpool/messaging/event_manager.py +426 -0
- agentpool/messaging/events.py +39 -0
- agentpool/messaging/message_container.py +209 -0
- agentpool/messaging/message_history.py +491 -0
- agentpool/messaging/messagenode.py +377 -0
- agentpool/messaging/messages.py +655 -0
- agentpool/messaging/processing.py +76 -0
- agentpool/mime_utils.py +95 -0
- agentpool/models/__init__.py +21 -0
- agentpool/models/acp_agents/__init__.py +22 -0
- agentpool/models/acp_agents/base.py +308 -0
- agentpool/models/acp_agents/mcp_capable.py +790 -0
- agentpool/models/acp_agents/non_mcp.py +842 -0
- agentpool/models/agents.py +450 -0
- agentpool/models/agui_agents.py +89 -0
- agentpool/models/claude_code_agents.py +238 -0
- agentpool/models/file_agents.py +116 -0
- agentpool/models/file_parsing.py +367 -0
- agentpool/models/manifest.py +658 -0
- agentpool/observability/__init__.py +9 -0
- agentpool/observability/observability_registry.py +97 -0
- agentpool/prompts/__init__.py +1 -0
- agentpool/prompts/base.py +27 -0
- agentpool/prompts/builtin_provider.py +75 -0
- agentpool/prompts/conversion_manager.py +95 -0
- agentpool/prompts/convert.py +96 -0
- agentpool/prompts/manager.py +204 -0
- agentpool/prompts/parts/zed.md +33 -0
- agentpool/prompts/prompts.py +581 -0
- agentpool/py.typed +0 -0
- agentpool/queries/tree-sitter-language-pack/README.md +7 -0
- agentpool/queries/tree-sitter-language-pack/arduino-tags.scm +5 -0
- agentpool/queries/tree-sitter-language-pack/c-tags.scm +9 -0
- agentpool/queries/tree-sitter-language-pack/chatito-tags.scm +16 -0
- agentpool/queries/tree-sitter-language-pack/clojure-tags.scm +7 -0
- agentpool/queries/tree-sitter-language-pack/commonlisp-tags.scm +122 -0
- agentpool/queries/tree-sitter-language-pack/cpp-tags.scm +15 -0
- agentpool/queries/tree-sitter-language-pack/csharp-tags.scm +26 -0
- agentpool/queries/tree-sitter-language-pack/d-tags.scm +26 -0
- agentpool/queries/tree-sitter-language-pack/dart-tags.scm +92 -0
- agentpool/queries/tree-sitter-language-pack/elisp-tags.scm +5 -0
- agentpool/queries/tree-sitter-language-pack/elixir-tags.scm +54 -0
- agentpool/queries/tree-sitter-language-pack/elm-tags.scm +19 -0
- agentpool/queries/tree-sitter-language-pack/gleam-tags.scm +41 -0
- agentpool/queries/tree-sitter-language-pack/go-tags.scm +42 -0
- agentpool/queries/tree-sitter-language-pack/java-tags.scm +20 -0
- agentpool/queries/tree-sitter-language-pack/javascript-tags.scm +88 -0
- agentpool/queries/tree-sitter-language-pack/lua-tags.scm +34 -0
- agentpool/queries/tree-sitter-language-pack/matlab-tags.scm +10 -0
- agentpool/queries/tree-sitter-language-pack/ocaml-tags.scm +115 -0
- agentpool/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +98 -0
- agentpool/queries/tree-sitter-language-pack/pony-tags.scm +39 -0
- agentpool/queries/tree-sitter-language-pack/properties-tags.scm +5 -0
- agentpool/queries/tree-sitter-language-pack/python-tags.scm +14 -0
- agentpool/queries/tree-sitter-language-pack/r-tags.scm +21 -0
- agentpool/queries/tree-sitter-language-pack/racket-tags.scm +12 -0
- agentpool/queries/tree-sitter-language-pack/ruby-tags.scm +64 -0
- agentpool/queries/tree-sitter-language-pack/rust-tags.scm +60 -0
- agentpool/queries/tree-sitter-language-pack/solidity-tags.scm +43 -0
- agentpool/queries/tree-sitter-language-pack/swift-tags.scm +51 -0
- agentpool/queries/tree-sitter-language-pack/udev-tags.scm +20 -0
- agentpool/queries/tree-sitter-languages/README.md +24 -0
- agentpool/queries/tree-sitter-languages/c-tags.scm +9 -0
- agentpool/queries/tree-sitter-languages/c_sharp-tags.scm +46 -0
- agentpool/queries/tree-sitter-languages/cpp-tags.scm +15 -0
- agentpool/queries/tree-sitter-languages/dart-tags.scm +91 -0
- agentpool/queries/tree-sitter-languages/elisp-tags.scm +8 -0
- agentpool/queries/tree-sitter-languages/elixir-tags.scm +54 -0
- agentpool/queries/tree-sitter-languages/elm-tags.scm +19 -0
- agentpool/queries/tree-sitter-languages/fortran-tags.scm +15 -0
- agentpool/queries/tree-sitter-languages/go-tags.scm +30 -0
- agentpool/queries/tree-sitter-languages/haskell-tags.scm +3 -0
- agentpool/queries/tree-sitter-languages/hcl-tags.scm +77 -0
- agentpool/queries/tree-sitter-languages/java-tags.scm +20 -0
- agentpool/queries/tree-sitter-languages/javascript-tags.scm +88 -0
- agentpool/queries/tree-sitter-languages/julia-tags.scm +60 -0
- agentpool/queries/tree-sitter-languages/kotlin-tags.scm +27 -0
- agentpool/queries/tree-sitter-languages/matlab-tags.scm +10 -0
- agentpool/queries/tree-sitter-languages/ocaml-tags.scm +115 -0
- agentpool/queries/tree-sitter-languages/ocaml_interface-tags.scm +98 -0
- agentpool/queries/tree-sitter-languages/php-tags.scm +26 -0
- agentpool/queries/tree-sitter-languages/python-tags.scm +12 -0
- agentpool/queries/tree-sitter-languages/ql-tags.scm +26 -0
- agentpool/queries/tree-sitter-languages/ruby-tags.scm +64 -0
- agentpool/queries/tree-sitter-languages/rust-tags.scm +60 -0
- agentpool/queries/tree-sitter-languages/scala-tags.scm +65 -0
- agentpool/queries/tree-sitter-languages/typescript-tags.scm +41 -0
- agentpool/queries/tree-sitter-languages/zig-tags.scm +3 -0
- agentpool/repomap.py +1231 -0
- agentpool/resource_providers/__init__.py +17 -0
- agentpool/resource_providers/aggregating.py +54 -0
- agentpool/resource_providers/base.py +172 -0
- agentpool/resource_providers/codemode/__init__.py +9 -0
- agentpool/resource_providers/codemode/code_executor.py +215 -0
- agentpool/resource_providers/codemode/default_prompt.py +19 -0
- agentpool/resource_providers/codemode/helpers.py +83 -0
- agentpool/resource_providers/codemode/progress_executor.py +212 -0
- agentpool/resource_providers/codemode/provider.py +150 -0
- agentpool/resource_providers/codemode/remote_mcp_execution.py +143 -0
- agentpool/resource_providers/codemode/remote_provider.py +171 -0
- agentpool/resource_providers/filtering.py +42 -0
- agentpool/resource_providers/mcp_provider.py +246 -0
- agentpool/resource_providers/plan_provider.py +196 -0
- agentpool/resource_providers/pool.py +69 -0
- agentpool/resource_providers/static.py +289 -0
- agentpool/running/__init__.py +20 -0
- agentpool/running/decorators.py +56 -0
- agentpool/running/discovery.py +101 -0
- agentpool/running/executor.py +284 -0
- agentpool/running/injection.py +111 -0
- agentpool/running/py.typed +0 -0
- agentpool/running/run_nodes.py +87 -0
- agentpool/server.py +122 -0
- agentpool/sessions/__init__.py +13 -0
- agentpool/sessions/manager.py +302 -0
- agentpool/sessions/models.py +71 -0
- agentpool/sessions/session.py +239 -0
- agentpool/sessions/store.py +163 -0
- agentpool/skills/__init__.py +5 -0
- agentpool/skills/manager.py +120 -0
- agentpool/skills/registry.py +210 -0
- agentpool/skills/skill.py +36 -0
- agentpool/storage/__init__.py +17 -0
- agentpool/storage/manager.py +419 -0
- agentpool/storage/serialization.py +136 -0
- agentpool/talk/__init__.py +13 -0
- agentpool/talk/registry.py +128 -0
- agentpool/talk/stats.py +159 -0
- agentpool/talk/talk.py +604 -0
- agentpool/tasks/__init__.py +20 -0
- agentpool/tasks/exceptions.py +25 -0
- agentpool/tasks/registry.py +33 -0
- agentpool/testing.py +129 -0
- agentpool/text_templates/__init__.py +39 -0
- agentpool/text_templates/system_prompt.jinja +30 -0
- agentpool/text_templates/tool_call_default.jinja +13 -0
- agentpool/text_templates/tool_call_markdown.jinja +25 -0
- agentpool/text_templates/tool_call_simple.jinja +5 -0
- agentpool/tools/__init__.py +16 -0
- agentpool/tools/base.py +269 -0
- agentpool/tools/exceptions.py +9 -0
- agentpool/tools/manager.py +255 -0
- agentpool/tools/tool_call_info.py +87 -0
- agentpool/ui/__init__.py +2 -0
- agentpool/ui/base.py +89 -0
- agentpool/ui/mock_provider.py +81 -0
- agentpool/ui/stdlib_provider.py +150 -0
- agentpool/utils/__init__.py +44 -0
- agentpool/utils/baseregistry.py +185 -0
- agentpool/utils/count_tokens.py +62 -0
- agentpool/utils/dag.py +184 -0
- agentpool/utils/importing.py +206 -0
- agentpool/utils/inspection.py +334 -0
- agentpool/utils/model_capabilities.py +25 -0
- agentpool/utils/network.py +28 -0
- agentpool/utils/now.py +22 -0
- agentpool/utils/parse_time.py +87 -0
- agentpool/utils/result_utils.py +35 -0
- agentpool/utils/signatures.py +305 -0
- agentpool/utils/streams.py +112 -0
- agentpool/utils/tasks.py +186 -0
- agentpool/vfs_registry.py +250 -0
- agentpool-2.1.9.dist-info/METADATA +336 -0
- agentpool-2.1.9.dist-info/RECORD +474 -0
- agentpool-2.1.9.dist-info/WHEEL +4 -0
- agentpool-2.1.9.dist-info/entry_points.txt +14 -0
- agentpool-2.1.9.dist-info/licenses/LICENSE +22 -0
- agentpool_cli/__init__.py +34 -0
- agentpool_cli/__main__.py +66 -0
- agentpool_cli/agent.py +175 -0
- agentpool_cli/cli_types.py +23 -0
- agentpool_cli/common.py +163 -0
- agentpool_cli/create.py +175 -0
- agentpool_cli/history.py +217 -0
- agentpool_cli/log.py +78 -0
- agentpool_cli/py.typed +0 -0
- agentpool_cli/run.py +84 -0
- agentpool_cli/serve_acp.py +177 -0
- agentpool_cli/serve_api.py +69 -0
- agentpool_cli/serve_mcp.py +74 -0
- agentpool_cli/serve_vercel.py +233 -0
- agentpool_cli/store.py +171 -0
- agentpool_cli/task.py +84 -0
- agentpool_cli/utils.py +104 -0
- agentpool_cli/watch.py +54 -0
- agentpool_commands/__init__.py +180 -0
- agentpool_commands/agents.py +199 -0
- agentpool_commands/base.py +45 -0
- agentpool_commands/commands.py +58 -0
- agentpool_commands/completers.py +110 -0
- agentpool_commands/connections.py +175 -0
- agentpool_commands/markdown_utils.py +31 -0
- agentpool_commands/models.py +62 -0
- agentpool_commands/prompts.py +78 -0
- agentpool_commands/py.typed +0 -0
- agentpool_commands/read.py +77 -0
- agentpool_commands/resources.py +210 -0
- agentpool_commands/session.py +48 -0
- agentpool_commands/tools.py +269 -0
- agentpool_commands/utils.py +189 -0
- agentpool_commands/workers.py +163 -0
- agentpool_config/__init__.py +53 -0
- agentpool_config/builtin_tools.py +265 -0
- agentpool_config/commands.py +237 -0
- agentpool_config/conditions.py +301 -0
- agentpool_config/converters.py +30 -0
- agentpool_config/durable.py +331 -0
- agentpool_config/event_handlers.py +600 -0
- agentpool_config/events.py +153 -0
- agentpool_config/forward_targets.py +251 -0
- agentpool_config/hook_conditions.py +331 -0
- agentpool_config/hooks.py +241 -0
- agentpool_config/jinja.py +206 -0
- agentpool_config/knowledge.py +41 -0
- agentpool_config/loaders.py +350 -0
- agentpool_config/mcp_server.py +243 -0
- agentpool_config/nodes.py +202 -0
- agentpool_config/observability.py +191 -0
- agentpool_config/output_types.py +55 -0
- agentpool_config/pool_server.py +267 -0
- agentpool_config/prompt_hubs.py +105 -0
- agentpool_config/prompts.py +185 -0
- agentpool_config/py.typed +0 -0
- agentpool_config/resources.py +33 -0
- agentpool_config/session.py +119 -0
- agentpool_config/skills.py +17 -0
- agentpool_config/storage.py +288 -0
- agentpool_config/system_prompts.py +190 -0
- agentpool_config/task.py +162 -0
- agentpool_config/teams.py +52 -0
- agentpool_config/tools.py +112 -0
- agentpool_config/toolsets.py +1033 -0
- agentpool_config/workers.py +86 -0
- agentpool_prompts/__init__.py +1 -0
- agentpool_prompts/braintrust_hub.py +235 -0
- agentpool_prompts/fabric.py +75 -0
- agentpool_prompts/langfuse_hub.py +79 -0
- agentpool_prompts/promptlayer_provider.py +59 -0
- agentpool_prompts/py.typed +0 -0
- agentpool_server/__init__.py +9 -0
- agentpool_server/a2a_server/__init__.py +5 -0
- agentpool_server/a2a_server/a2a_types.py +41 -0
- agentpool_server/a2a_server/server.py +190 -0
- agentpool_server/a2a_server/storage.py +81 -0
- agentpool_server/acp_server/__init__.py +22 -0
- agentpool_server/acp_server/acp_agent.py +786 -0
- agentpool_server/acp_server/acp_tools.py +43 -0
- agentpool_server/acp_server/commands/__init__.py +18 -0
- agentpool_server/acp_server/commands/acp_commands.py +594 -0
- agentpool_server/acp_server/commands/debug_commands.py +376 -0
- agentpool_server/acp_server/commands/docs_commands/__init__.py +39 -0
- agentpool_server/acp_server/commands/docs_commands/fetch_repo.py +169 -0
- agentpool_server/acp_server/commands/docs_commands/get_schema.py +176 -0
- agentpool_server/acp_server/commands/docs_commands/get_source.py +110 -0
- agentpool_server/acp_server/commands/docs_commands/git_diff.py +111 -0
- agentpool_server/acp_server/commands/docs_commands/helpers.py +33 -0
- agentpool_server/acp_server/commands/docs_commands/url_to_markdown.py +90 -0
- agentpool_server/acp_server/commands/spawn.py +210 -0
- agentpool_server/acp_server/converters.py +235 -0
- agentpool_server/acp_server/input_provider.py +338 -0
- agentpool_server/acp_server/server.py +288 -0
- agentpool_server/acp_server/session.py +969 -0
- agentpool_server/acp_server/session_manager.py +313 -0
- agentpool_server/acp_server/syntax_detection.py +250 -0
- agentpool_server/acp_server/zed_tools.md +90 -0
- agentpool_server/aggregating_server.py +309 -0
- agentpool_server/agui_server/__init__.py +11 -0
- agentpool_server/agui_server/server.py +128 -0
- agentpool_server/base.py +189 -0
- agentpool_server/http_server.py +164 -0
- agentpool_server/mcp_server/__init__.py +6 -0
- agentpool_server/mcp_server/server.py +314 -0
- agentpool_server/mcp_server/zed_wrapper.py +110 -0
- agentpool_server/openai_api_server/__init__.py +5 -0
- agentpool_server/openai_api_server/completions/__init__.py +1 -0
- agentpool_server/openai_api_server/completions/helpers.py +81 -0
- agentpool_server/openai_api_server/completions/models.py +98 -0
- agentpool_server/openai_api_server/responses/__init__.py +1 -0
- agentpool_server/openai_api_server/responses/helpers.py +74 -0
- agentpool_server/openai_api_server/responses/models.py +96 -0
- agentpool_server/openai_api_server/server.py +242 -0
- agentpool_server/py.typed +0 -0
- agentpool_storage/__init__.py +9 -0
- agentpool_storage/base.py +310 -0
- agentpool_storage/file_provider.py +378 -0
- agentpool_storage/formatters.py +129 -0
- agentpool_storage/memory_provider.py +396 -0
- agentpool_storage/models.py +108 -0
- agentpool_storage/py.typed +0 -0
- agentpool_storage/session_store.py +262 -0
- agentpool_storage/sql_provider/__init__.py +21 -0
- agentpool_storage/sql_provider/cli.py +146 -0
- agentpool_storage/sql_provider/models.py +249 -0
- agentpool_storage/sql_provider/queries.py +15 -0
- agentpool_storage/sql_provider/sql_provider.py +444 -0
- agentpool_storage/sql_provider/utils.py +234 -0
- agentpool_storage/text_log_provider.py +275 -0
- agentpool_toolsets/__init__.py +15 -0
- agentpool_toolsets/builtin/__init__.py +33 -0
- agentpool_toolsets/builtin/agent_management.py +239 -0
- agentpool_toolsets/builtin/chain.py +288 -0
- agentpool_toolsets/builtin/code.py +398 -0
- agentpool_toolsets/builtin/debug.py +291 -0
- agentpool_toolsets/builtin/execution_environment.py +381 -0
- agentpool_toolsets/builtin/file_edit/__init__.py +11 -0
- agentpool_toolsets/builtin/file_edit/file_edit.py +747 -0
- agentpool_toolsets/builtin/file_edit/fuzzy_matcher/__init__.py +5 -0
- agentpool_toolsets/builtin/file_edit/fuzzy_matcher/example_usage.py +311 -0
- agentpool_toolsets/builtin/file_edit/fuzzy_matcher/streaming_fuzzy_matcher.py +443 -0
- agentpool_toolsets/builtin/history.py +36 -0
- agentpool_toolsets/builtin/integration.py +85 -0
- agentpool_toolsets/builtin/skills.py +77 -0
- agentpool_toolsets/builtin/subagent_tools.py +324 -0
- agentpool_toolsets/builtin/tool_management.py +90 -0
- agentpool_toolsets/builtin/user_interaction.py +52 -0
- agentpool_toolsets/builtin/workers.py +128 -0
- agentpool_toolsets/composio_toolset.py +96 -0
- agentpool_toolsets/config_creation.py +192 -0
- agentpool_toolsets/entry_points.py +47 -0
- agentpool_toolsets/fsspec_toolset/__init__.py +7 -0
- agentpool_toolsets/fsspec_toolset/diagnostics.py +115 -0
- agentpool_toolsets/fsspec_toolset/grep.py +450 -0
- agentpool_toolsets/fsspec_toolset/helpers.py +631 -0
- agentpool_toolsets/fsspec_toolset/streaming_diff_parser.py +249 -0
- agentpool_toolsets/fsspec_toolset/toolset.py +1384 -0
- agentpool_toolsets/mcp_run_toolset.py +61 -0
- agentpool_toolsets/notifications.py +146 -0
- agentpool_toolsets/openapi.py +118 -0
- agentpool_toolsets/py.typed +0 -0
- agentpool_toolsets/search_toolset.py +202 -0
- agentpool_toolsets/semantic_memory_toolset.py +536 -0
- agentpool_toolsets/streaming_tools.py +265 -0
- agentpool_toolsets/vfs_toolset.py +124 -0
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
"""Configuration models for ACP (Agent Client Protocol) agents."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Literal, assert_never, cast
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
from tokonomics.model_discovery import ProviderType # noqa: TC002
|
|
10
|
+
|
|
11
|
+
from agentpool.models.acp_agents.base import BaseACPAgentConfig
|
|
12
|
+
from agentpool_config.output_types import StructuredResponseConfig # noqa: TC001
|
|
13
|
+
from agentpool_config.toolsets import ToolsetConfig # noqa: TC001
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from agentpool.prompts.manager import PromptManager
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
ClaudeCodeModelName = Literal["default", "sonnet", "opus", "haiku", "sonnet[1m]", "opusplan"]
|
|
21
|
+
ClaudeCodeToolName = Literal[
|
|
22
|
+
"AskUserQuestion",
|
|
23
|
+
"Bash",
|
|
24
|
+
"BashOutput",
|
|
25
|
+
"Edit",
|
|
26
|
+
"ExitPlanMode",
|
|
27
|
+
"Glob",
|
|
28
|
+
"Grep",
|
|
29
|
+
"KillShell",
|
|
30
|
+
"NotebookEdit",
|
|
31
|
+
"Read",
|
|
32
|
+
"Skill",
|
|
33
|
+
"SlashCommand",
|
|
34
|
+
"Task",
|
|
35
|
+
"TodoWrite",
|
|
36
|
+
"WebFetch",
|
|
37
|
+
"WebSearch",
|
|
38
|
+
"Write",
|
|
39
|
+
]
|
|
40
|
+
ClaudeCodePermissionmode = Literal["default", "acceptEdits", "bypassPermissions", "dontAsk", "plan"]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class MCPCapableACPAgentConfig(BaseACPAgentConfig):
|
|
44
|
+
"""Base class for ACP agents that support MCP (Model Context Protocol) servers.
|
|
45
|
+
|
|
46
|
+
Extends BaseACPAgentConfig with MCP-specific capabilities including toolsets
|
|
47
|
+
that can be exposed via an internal MCP bridge.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
toolsets: list[ToolsetConfig] = Field(
|
|
51
|
+
default_factory=list,
|
|
52
|
+
title="Toolsets",
|
|
53
|
+
examples=[
|
|
54
|
+
[
|
|
55
|
+
{"type": "subagent"},
|
|
56
|
+
{"type": "agent_management"},
|
|
57
|
+
],
|
|
58
|
+
],
|
|
59
|
+
)
|
|
60
|
+
"""Toolsets to expose to this ACP agent via MCP bridge.
|
|
61
|
+
|
|
62
|
+
These toolsets will be started as an in-process MCP server and made
|
|
63
|
+
available to the external ACP agent. This allows ACP agents to use
|
|
64
|
+
internal agentpool toolsets like subagent delegation.
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
def build_mcp_config_json(self) -> str | None:
|
|
68
|
+
"""Convert inherited mcp_servers to standard MCP config JSON format.
|
|
69
|
+
|
|
70
|
+
This format is used by Claude Desktop, VS Code extensions, and other tools.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
JSON string for MCP config, or None if no servers configured.
|
|
74
|
+
"""
|
|
75
|
+
from urllib.parse import urlparse
|
|
76
|
+
|
|
77
|
+
from agentpool_config.mcp_server import (
|
|
78
|
+
SSEMCPServerConfig,
|
|
79
|
+
StdioMCPServerConfig,
|
|
80
|
+
StreamableHTTPMCPServerConfig,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
servers = self.get_mcp_servers()
|
|
84
|
+
if not servers:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
mcp_servers: dict[str, dict[str, Any]] = {}
|
|
88
|
+
for idx, server in enumerate(servers):
|
|
89
|
+
# Determine server name: explicit > derived
|
|
90
|
+
match server:
|
|
91
|
+
case _ if server.name:
|
|
92
|
+
name = server.name
|
|
93
|
+
case StdioMCPServerConfig(args=[*_, last]):
|
|
94
|
+
name = last.split("/")[-1].split("@")[0]
|
|
95
|
+
case StdioMCPServerConfig(command=cmd):
|
|
96
|
+
name = cmd
|
|
97
|
+
case SSEMCPServerConfig(url=url) | StreamableHTTPMCPServerConfig(url=url):
|
|
98
|
+
name = urlparse(str(url)).hostname or f"server_{idx}"
|
|
99
|
+
case _ as unreachable:
|
|
100
|
+
assert_never(unreachable) # ty: ignore
|
|
101
|
+
|
|
102
|
+
config: dict[str, Any]
|
|
103
|
+
match server:
|
|
104
|
+
case StdioMCPServerConfig(command=command, args=args):
|
|
105
|
+
config = {"command": command, "args": args}
|
|
106
|
+
if server.env:
|
|
107
|
+
config["env"] = server.get_env_vars()
|
|
108
|
+
case SSEMCPServerConfig(url=url):
|
|
109
|
+
config = {"url": str(url), "transport": "sse"}
|
|
110
|
+
case StreamableHTTPMCPServerConfig(url=url):
|
|
111
|
+
config = {"url": str(url), "transport": "http"}
|
|
112
|
+
case _ as unreachable:
|
|
113
|
+
assert_never(unreachable) # ty: ignore
|
|
114
|
+
mcp_servers[name] = config
|
|
115
|
+
|
|
116
|
+
if not mcp_servers:
|
|
117
|
+
return None
|
|
118
|
+
|
|
119
|
+
return json.dumps({"mcpServers": mcp_servers})
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class ClaudeACPAgentConfig(MCPCapableACPAgentConfig):
|
|
123
|
+
"""Configuration for Claude Code via ACP.
|
|
124
|
+
|
|
125
|
+
Provides typed settings for the claude-code-acp server.
|
|
126
|
+
|
|
127
|
+
Note:
|
|
128
|
+
If ANTHROPIC_API_KEY is set in your environment, Claude Code will use it
|
|
129
|
+
directly instead of the subscription. To force subscription usage, set
|
|
130
|
+
`env: {"ANTHROPIC_API_KEY": ""}` in the config.
|
|
131
|
+
|
|
132
|
+
Example:
|
|
133
|
+
```yaml
|
|
134
|
+
agents:
|
|
135
|
+
coder:
|
|
136
|
+
type: acp
|
|
137
|
+
provider: claude
|
|
138
|
+
cwd: /path/to/project
|
|
139
|
+
model: sonnet
|
|
140
|
+
permission_mode: acceptEdits
|
|
141
|
+
env:
|
|
142
|
+
ANTHROPIC_API_KEY: "" # Use subscription instead of API key
|
|
143
|
+
allowed_tools:
|
|
144
|
+
- Read
|
|
145
|
+
- Write
|
|
146
|
+
- Bash(git:*)
|
|
147
|
+
```
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
model_config = ConfigDict(json_schema_extra={"title": "Claude ACP Agent Configuration"})
|
|
151
|
+
|
|
152
|
+
provider: Literal["claude"] = Field("claude", init=False)
|
|
153
|
+
"""Discriminator for Claude ACP agent."""
|
|
154
|
+
|
|
155
|
+
include_builtin_system_prompt: bool = Field(
|
|
156
|
+
default=True,
|
|
157
|
+
title="Include Builtin System Prompt",
|
|
158
|
+
)
|
|
159
|
+
"""If True, system_prompt is appended to Claude's builtin prompt.
|
|
160
|
+
If False, system_prompt replaces the builtin prompt entirely."""
|
|
161
|
+
|
|
162
|
+
model: ClaudeCodeModelName | None = Field(
|
|
163
|
+
default=None,
|
|
164
|
+
title="Model",
|
|
165
|
+
examples=["sonnet", "opus", "claude-sonnet-4-20250514"],
|
|
166
|
+
)
|
|
167
|
+
"""Model override. Use alias ('sonnet', 'opus') or full name."""
|
|
168
|
+
|
|
169
|
+
permission_mode: ClaudeCodePermissionmode | None = Field(
|
|
170
|
+
default=None,
|
|
171
|
+
title="Permission Mode",
|
|
172
|
+
examples=["acceptEdits", "bypassPermissions", "plan"],
|
|
173
|
+
)
|
|
174
|
+
"""Permission handling mode for tool execution."""
|
|
175
|
+
|
|
176
|
+
allowed_tools: list[ClaudeCodeToolName | str] | None = Field(
|
|
177
|
+
default=None,
|
|
178
|
+
title="Allowed Tools",
|
|
179
|
+
examples=[["Read", "Write", "Bash(git:*)"], ["Edit", "Glob"]],
|
|
180
|
+
)
|
|
181
|
+
"""Whitelist of allowed tools (e.g., ['Read', 'Write', 'Bash(git:*)'])."""
|
|
182
|
+
|
|
183
|
+
disallowed_tools: list[ClaudeCodeToolName | str] | None = Field(
|
|
184
|
+
default=None,
|
|
185
|
+
title="Disallowed Tools",
|
|
186
|
+
examples=[["WebSearch", "WebFetch"], ["KillShell"]],
|
|
187
|
+
)
|
|
188
|
+
"""Blacklist of disallowed tools."""
|
|
189
|
+
|
|
190
|
+
strict_mcp_config: bool = Field(default=False, title="Strict MCP Config")
|
|
191
|
+
"""Only use MCP servers from mcp_config, ignoring all other configs."""
|
|
192
|
+
|
|
193
|
+
add_dir: list[str] | None = Field(
|
|
194
|
+
default=None,
|
|
195
|
+
title="Additional Directories",
|
|
196
|
+
examples=[["/tmp", "/var/log"], ["/home/user/data"]],
|
|
197
|
+
)
|
|
198
|
+
"""Additional directories to allow tool access to."""
|
|
199
|
+
|
|
200
|
+
tools: list[ClaudeCodeToolName | str] | None = Field(
|
|
201
|
+
default=None,
|
|
202
|
+
title="Tools",
|
|
203
|
+
examples=[["Bash", "Edit", "Read"], []],
|
|
204
|
+
)
|
|
205
|
+
"""Available tools from built-in set. Empty list disables all tools."""
|
|
206
|
+
|
|
207
|
+
fallback_model: ClaudeCodeModelName | None = Field(
|
|
208
|
+
default=None,
|
|
209
|
+
title="Fallback Model",
|
|
210
|
+
examples=["sonnet", "haiku"],
|
|
211
|
+
)
|
|
212
|
+
"""Fallback model when default is overloaded."""
|
|
213
|
+
|
|
214
|
+
dangerously_skip_permissions: bool = Field(
|
|
215
|
+
default=False,
|
|
216
|
+
title="Dangerously Skip Permissions",
|
|
217
|
+
)
|
|
218
|
+
"""Bypass all permission checks. Only for sandboxed environments."""
|
|
219
|
+
|
|
220
|
+
output_type: str | StructuredResponseConfig | None = Field(
|
|
221
|
+
default=None,
|
|
222
|
+
title="Output Type",
|
|
223
|
+
examples=[
|
|
224
|
+
"json_response",
|
|
225
|
+
{"response_schema": {"type": "import", "import_path": "mymodule:MyModel"}},
|
|
226
|
+
],
|
|
227
|
+
)
|
|
228
|
+
"""Structured output configuration. Generates --output-format and --json-schema."""
|
|
229
|
+
|
|
230
|
+
def get_command(self) -> str:
|
|
231
|
+
"""Get the command to spawn the ACP server."""
|
|
232
|
+
return "claude-code-acp"
|
|
233
|
+
|
|
234
|
+
async def get_args(self, prompt_manager: PromptManager | None = None) -> list[str]:
|
|
235
|
+
"""Build command arguments from settings."""
|
|
236
|
+
args: list[str] = []
|
|
237
|
+
|
|
238
|
+
# Handle system prompt from base class
|
|
239
|
+
rendered_prompt = await self.render_system_prompt(prompt_manager)
|
|
240
|
+
if rendered_prompt:
|
|
241
|
+
if self.include_builtin_system_prompt:
|
|
242
|
+
args.extend(["--append-system-prompt", rendered_prompt])
|
|
243
|
+
else:
|
|
244
|
+
args.extend(["--system-prompt", rendered_prompt])
|
|
245
|
+
if self.model:
|
|
246
|
+
args.extend(["--model", self.model])
|
|
247
|
+
if self.permission_mode:
|
|
248
|
+
args.extend(["--permission-mode", self.permission_mode])
|
|
249
|
+
if self.allowed_tools:
|
|
250
|
+
args.extend(["--allowed-tools", *self.allowed_tools])
|
|
251
|
+
if self.disallowed_tools:
|
|
252
|
+
args.extend(["--disallowed-tools", *self.disallowed_tools])
|
|
253
|
+
|
|
254
|
+
# Convert inherited mcp_servers to Claude's --mcp-config JSON format
|
|
255
|
+
mcp_json = self.build_mcp_config_json()
|
|
256
|
+
if mcp_json:
|
|
257
|
+
args.extend(["--mcp-config", mcp_json])
|
|
258
|
+
|
|
259
|
+
if self.strict_mcp_config:
|
|
260
|
+
args.append("--strict-mcp-config")
|
|
261
|
+
if self.add_dir:
|
|
262
|
+
args.extend(["--add-dir", *self.add_dir])
|
|
263
|
+
if self.tools is not None:
|
|
264
|
+
if self.tools:
|
|
265
|
+
args.extend(["--tools", ",".join(self.tools)])
|
|
266
|
+
else:
|
|
267
|
+
args.extend(["--tools", ""])
|
|
268
|
+
if self.fallback_model:
|
|
269
|
+
args.extend(["--fallback-model", self.fallback_model])
|
|
270
|
+
if self.dangerously_skip_permissions:
|
|
271
|
+
args.append("--dangerously-skip-permissions")
|
|
272
|
+
if self.output_type:
|
|
273
|
+
args.extend(["--output-format", "json"])
|
|
274
|
+
schema = self._resolve_json_schema()
|
|
275
|
+
if schema:
|
|
276
|
+
args.extend(["--json-schema", schema])
|
|
277
|
+
|
|
278
|
+
return args
|
|
279
|
+
|
|
280
|
+
def _resolve_json_schema(self) -> str | None:
|
|
281
|
+
"""Resolve output_type to a JSON schema string."""
|
|
282
|
+
if self.output_type is None:
|
|
283
|
+
return None
|
|
284
|
+
if isinstance(self.output_type, str):
|
|
285
|
+
# Named reference - caller must resolve
|
|
286
|
+
return None
|
|
287
|
+
# StructuredResponseConfig - resolve schema via get_schema()
|
|
288
|
+
model_cls = cast(type[BaseModel], self.output_type.response_schema.get_schema())
|
|
289
|
+
return json.dumps(model_cls.model_json_schema())
|
|
290
|
+
|
|
291
|
+
@property
|
|
292
|
+
def model_providers(self) -> list[ProviderType]:
|
|
293
|
+
"""Claude Code uses Anthropic models."""
|
|
294
|
+
return ["anthropic"]
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
class GeminiACPAgentConfig(MCPCapableACPAgentConfig):
|
|
298
|
+
"""Configuration for Gemini CLI via ACP.
|
|
299
|
+
|
|
300
|
+
Provides typed settings for the gemini CLI with ACP support.
|
|
301
|
+
|
|
302
|
+
Example:
|
|
303
|
+
```yaml
|
|
304
|
+
agents:
|
|
305
|
+
coder:
|
|
306
|
+
type: acp
|
|
307
|
+
provider: gemini
|
|
308
|
+
cwd: /path/to/project
|
|
309
|
+
model: gemini-2.5-pro
|
|
310
|
+
approval_mode: auto_edit
|
|
311
|
+
allowed_tools:
|
|
312
|
+
- read_file
|
|
313
|
+
- write_file
|
|
314
|
+
- terminal
|
|
315
|
+
```
|
|
316
|
+
"""
|
|
317
|
+
|
|
318
|
+
model_config = ConfigDict(json_schema_extra={"title": "Gemini ACP Agent Configuration"})
|
|
319
|
+
|
|
320
|
+
provider: Literal["gemini"] = Field("gemini", init=False)
|
|
321
|
+
"""Discriminator for Gemini ACP agent."""
|
|
322
|
+
|
|
323
|
+
model: str | None = Field(
|
|
324
|
+
default=None,
|
|
325
|
+
title="Model",
|
|
326
|
+
examples=["gemini-2.5-pro", "gemini-2.5-flash"],
|
|
327
|
+
)
|
|
328
|
+
"""Model override."""
|
|
329
|
+
|
|
330
|
+
approval_mode: Literal["default", "auto_edit", "yolo"] | None = Field(
|
|
331
|
+
default=None,
|
|
332
|
+
title="Approval Mode",
|
|
333
|
+
examples=["auto_edit", "yolo"],
|
|
334
|
+
)
|
|
335
|
+
"""Approval mode for tool execution."""
|
|
336
|
+
|
|
337
|
+
sandbox: bool = Field(default=False, title="Sandbox")
|
|
338
|
+
"""Run in sandbox mode."""
|
|
339
|
+
|
|
340
|
+
yolo: bool = Field(default=False, title="YOLO")
|
|
341
|
+
"""Automatically accept all actions."""
|
|
342
|
+
|
|
343
|
+
allowed_tools: list[str] | None = Field(
|
|
344
|
+
default=None,
|
|
345
|
+
title="Allowed Tools",
|
|
346
|
+
examples=[["read_file", "write_file", "terminal"], ["search"]],
|
|
347
|
+
)
|
|
348
|
+
"""Tools allowed to run without confirmation."""
|
|
349
|
+
|
|
350
|
+
allowed_mcp_server_names: list[str] | None = Field(
|
|
351
|
+
default=None,
|
|
352
|
+
title="Allowed MCP Server Names",
|
|
353
|
+
examples=[["filesystem", "github"], ["slack"]],
|
|
354
|
+
)
|
|
355
|
+
"""Allowed MCP server names."""
|
|
356
|
+
|
|
357
|
+
extensions: list[str] | None = Field(
|
|
358
|
+
default=None,
|
|
359
|
+
title="Extensions",
|
|
360
|
+
examples=[["python", "typescript"], ["rust", "go"]],
|
|
361
|
+
)
|
|
362
|
+
"""List of extensions to use. If not provided, all are used."""
|
|
363
|
+
|
|
364
|
+
include_directories: list[str] | None = Field(
|
|
365
|
+
default=None,
|
|
366
|
+
title="Include Directories",
|
|
367
|
+
examples=[["/path/to/lib", "/path/to/shared"], ["./vendor"]],
|
|
368
|
+
)
|
|
369
|
+
"""Additional directories to include in the workspace."""
|
|
370
|
+
|
|
371
|
+
output_format: Literal["text", "json", "stream-json"] | None = Field(
|
|
372
|
+
default=None,
|
|
373
|
+
title="Output Format",
|
|
374
|
+
examples=["json", "stream-json"],
|
|
375
|
+
)
|
|
376
|
+
"""Output format."""
|
|
377
|
+
|
|
378
|
+
def get_command(self) -> str:
|
|
379
|
+
"""Get the command to spawn the ACP server."""
|
|
380
|
+
return "gemini"
|
|
381
|
+
|
|
382
|
+
@property
|
|
383
|
+
def model_providers(self) -> list[ProviderType]:
|
|
384
|
+
"""Gemini CLI uses Google Gemini models."""
|
|
385
|
+
return ["gemini"]
|
|
386
|
+
|
|
387
|
+
async def get_args(self, prompt_manager: PromptManager | None = None) -> list[str]:
|
|
388
|
+
"""Build command arguments from settings."""
|
|
389
|
+
args: list[str] = ["--experimental-acp"]
|
|
390
|
+
|
|
391
|
+
if self.model:
|
|
392
|
+
args.extend(["--model", self.model])
|
|
393
|
+
if self.approval_mode:
|
|
394
|
+
args.extend(["--approval-mode", self.approval_mode])
|
|
395
|
+
if self.sandbox:
|
|
396
|
+
args.append("--sandbox")
|
|
397
|
+
if self.yolo:
|
|
398
|
+
args.append("--yolo")
|
|
399
|
+
if self.allowed_tools:
|
|
400
|
+
args.extend(["--allowed-tools", *self.allowed_tools])
|
|
401
|
+
if self.allowed_mcp_server_names:
|
|
402
|
+
args.extend(["--allowed-mcp-server-names", *self.allowed_mcp_server_names])
|
|
403
|
+
if self.extensions:
|
|
404
|
+
args.extend(["--extensions", *self.extensions])
|
|
405
|
+
if self.include_directories:
|
|
406
|
+
args.extend(["--include-directories", *self.include_directories])
|
|
407
|
+
if self.output_format:
|
|
408
|
+
args.extend(["--output-format", self.output_format])
|
|
409
|
+
|
|
410
|
+
return args
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
class FastAgentACPAgentConfig(MCPCapableACPAgentConfig):
|
|
414
|
+
"""Configuration for fast-agent via ACP.
|
|
415
|
+
|
|
416
|
+
Robust LLM agent with comprehensive MCP support.
|
|
417
|
+
|
|
418
|
+
Supports MCP server integration via:
|
|
419
|
+
- Internal bridge: Use `toolsets` field to expose agentpool toolsets
|
|
420
|
+
- External servers: Use `url` field to connect to external MCP servers
|
|
421
|
+
- Skills: Use `skills_dir` to specify custom skills directory
|
|
422
|
+
|
|
423
|
+
Example:
|
|
424
|
+
```yaml
|
|
425
|
+
agents:
|
|
426
|
+
coder:
|
|
427
|
+
type: acp
|
|
428
|
+
provider: fast-agent
|
|
429
|
+
cwd: /path/to/project
|
|
430
|
+
model: claude-3.5-sonnet-20241022
|
|
431
|
+
toolsets:
|
|
432
|
+
- type: subagent
|
|
433
|
+
- type: agent_management
|
|
434
|
+
skills_dir: ./my-skills
|
|
435
|
+
```
|
|
436
|
+
"""
|
|
437
|
+
|
|
438
|
+
model_config = ConfigDict(json_schema_extra={"title": "FastAgent ACP Agent Configuration"})
|
|
439
|
+
|
|
440
|
+
provider: Literal["fast-agent"] = Field("fast-agent", init=False)
|
|
441
|
+
"""Discriminator for fast-agent ACP agent."""
|
|
442
|
+
|
|
443
|
+
model: str = Field(
|
|
444
|
+
...,
|
|
445
|
+
title="Model",
|
|
446
|
+
examples=[
|
|
447
|
+
"anthropic.claude-3-7-sonnet-latest",
|
|
448
|
+
"openai.o3-mini.high",
|
|
449
|
+
"openrouter.google/gemini-2.5-pro-exp-03-25:free",
|
|
450
|
+
],
|
|
451
|
+
)
|
|
452
|
+
"""Model to use."""
|
|
453
|
+
|
|
454
|
+
shell_access: bool = Field(default=False, title="Shell Access")
|
|
455
|
+
"""Enable shell and file access (-x flag)."""
|
|
456
|
+
|
|
457
|
+
skills_dir: str | None = Field(
|
|
458
|
+
default=None,
|
|
459
|
+
title="Skills Directory",
|
|
460
|
+
examples=["./skills", "/path/to/custom-skills", "~/.fast-agent/skills"],
|
|
461
|
+
)
|
|
462
|
+
"""Override the default skills directory for custom agent skills."""
|
|
463
|
+
|
|
464
|
+
url: str | None = Field(
|
|
465
|
+
default=None,
|
|
466
|
+
title="URL",
|
|
467
|
+
examples=["https://huggingface.co/mcp", "http://localhost:8080"],
|
|
468
|
+
)
|
|
469
|
+
"""MCP server URL to connect to. Can also be used with internal toolsets bridge."""
|
|
470
|
+
|
|
471
|
+
auth: str | None = Field(
|
|
472
|
+
default=None,
|
|
473
|
+
title="Auth",
|
|
474
|
+
examples=["bearer-token-123", "api-key-xyz"],
|
|
475
|
+
)
|
|
476
|
+
"""Authentication token for MCP server."""
|
|
477
|
+
|
|
478
|
+
def get_command(self) -> str:
|
|
479
|
+
"""Get the command to spawn the ACP server."""
|
|
480
|
+
return "fast-agent-acp"
|
|
481
|
+
|
|
482
|
+
async def get_args(self, prompt_manager: PromptManager | None = None) -> list[str]:
|
|
483
|
+
"""Build command arguments from settings."""
|
|
484
|
+
args: list[str] = []
|
|
485
|
+
|
|
486
|
+
if self.model:
|
|
487
|
+
args.extend(["--model", self.model])
|
|
488
|
+
if self.shell_access:
|
|
489
|
+
args.append("-x")
|
|
490
|
+
if self.skills_dir:
|
|
491
|
+
args.extend(["--skills-dir", self.skills_dir])
|
|
492
|
+
|
|
493
|
+
# Collect URLs from toolsets bridge + user-specified URL
|
|
494
|
+
urls: list[str] = []
|
|
495
|
+
if self.url:
|
|
496
|
+
urls.append(self.url)
|
|
497
|
+
|
|
498
|
+
# Extract URLs from MCP config JSON (from toolsets)
|
|
499
|
+
mcp_json = self.build_mcp_config_json()
|
|
500
|
+
if mcp_json:
|
|
501
|
+
mcp_config = json.loads(mcp_json)
|
|
502
|
+
urls.extend(
|
|
503
|
+
server_config["url"]
|
|
504
|
+
for server_config in mcp_config.get("mcpServers", {}).values()
|
|
505
|
+
if "url" in server_config
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
if urls:
|
|
509
|
+
args.extend(["--url", ",".join(urls)])
|
|
510
|
+
|
|
511
|
+
if self.auth:
|
|
512
|
+
args.extend(["--auth", self.auth])
|
|
513
|
+
|
|
514
|
+
return args
|
|
515
|
+
|
|
516
|
+
@property
|
|
517
|
+
def model_providers(self) -> list[ProviderType]:
|
|
518
|
+
"""fast-agent supports multiple providers."""
|
|
519
|
+
return ["openai", "anthropic", "gemini", "openrouter"]
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
class AuggieACPAgentConfig(MCPCapableACPAgentConfig):
|
|
523
|
+
"""Configuration for Auggie (Augment Code) via ACP.
|
|
524
|
+
|
|
525
|
+
AI agent that brings Augment Code's power to the terminal.
|
|
526
|
+
|
|
527
|
+
Example:
|
|
528
|
+
```yaml
|
|
529
|
+
agents:
|
|
530
|
+
auggie:
|
|
531
|
+
type: acp
|
|
532
|
+
provider: auggie
|
|
533
|
+
cwd: /path/to/project
|
|
534
|
+
model: auggie-sonnet
|
|
535
|
+
workspace_root: /path/to/workspace
|
|
536
|
+
rules: [rules.md]
|
|
537
|
+
shell: bash
|
|
538
|
+
```
|
|
539
|
+
"""
|
|
540
|
+
|
|
541
|
+
model_config = ConfigDict(json_schema_extra={"title": "Auggie ACP Agent Configuration"})
|
|
542
|
+
|
|
543
|
+
provider: Literal["auggie"] = Field("auggie", init=False)
|
|
544
|
+
"""Discriminator for Auggie ACP agent."""
|
|
545
|
+
|
|
546
|
+
model: str | None = Field(
|
|
547
|
+
default=None,
|
|
548
|
+
title="Model",
|
|
549
|
+
examples=["auggie-sonnet", "auggie-haiku"],
|
|
550
|
+
)
|
|
551
|
+
"""Model to use."""
|
|
552
|
+
|
|
553
|
+
workspace_root: str | None = Field(
|
|
554
|
+
default=None,
|
|
555
|
+
title="Workspace Root",
|
|
556
|
+
examples=["/path/to/workspace", "/home/user/project"],
|
|
557
|
+
)
|
|
558
|
+
"""Workspace root (auto-detects git root if absent)."""
|
|
559
|
+
|
|
560
|
+
rules: list[str] | None = Field(
|
|
561
|
+
default=None,
|
|
562
|
+
title="Rules",
|
|
563
|
+
examples=[["rules.md", "coding-standards.md"], ["./custom-rules.txt"]],
|
|
564
|
+
)
|
|
565
|
+
"""Additional rules files."""
|
|
566
|
+
|
|
567
|
+
augment_cache_dir: str | None = Field(
|
|
568
|
+
default=None,
|
|
569
|
+
title="Augment Cache Dir",
|
|
570
|
+
examples=["~/.augment", "/tmp/augment-cache"],
|
|
571
|
+
)
|
|
572
|
+
"""Cache directory (default: ~/.augment)."""
|
|
573
|
+
|
|
574
|
+
retry_timeout: int | None = Field(
|
|
575
|
+
default=None,
|
|
576
|
+
title="Retry Timeout",
|
|
577
|
+
examples=[30, 60],
|
|
578
|
+
)
|
|
579
|
+
"""Timeout for rate-limit retries (seconds)."""
|
|
580
|
+
|
|
581
|
+
allow_indexing: bool = Field(default=False, title="Allow Indexing")
|
|
582
|
+
"""Skip the indexing confirmation screen in interactive mode."""
|
|
583
|
+
|
|
584
|
+
augment_token_file: str | None = Field(
|
|
585
|
+
default=None,
|
|
586
|
+
title="Augment Token File",
|
|
587
|
+
examples=["~/.augment/token", "/etc/augment/auth.token"],
|
|
588
|
+
)
|
|
589
|
+
"""Path to file containing authentication token."""
|
|
590
|
+
|
|
591
|
+
github_api_token: str | None = Field(
|
|
592
|
+
default=None,
|
|
593
|
+
title="GitHub API Token",
|
|
594
|
+
examples=["~/.github/token", "/secrets/github.token"],
|
|
595
|
+
)
|
|
596
|
+
"""Path to file containing GitHub API token."""
|
|
597
|
+
|
|
598
|
+
permission: list[str] | None = Field(
|
|
599
|
+
default=None,
|
|
600
|
+
title="Permission",
|
|
601
|
+
examples=[["bash:allow", "edit:confirm"], ["read:allow", "write:deny"]],
|
|
602
|
+
)
|
|
603
|
+
"""Tool permissions with 'tool-name:policy' format."""
|
|
604
|
+
|
|
605
|
+
remove_tool: list[str] | None = Field(
|
|
606
|
+
default=None,
|
|
607
|
+
title="Remove Tool",
|
|
608
|
+
examples=[["deprecated-tool", "legacy-search"], ["old-formatter"]],
|
|
609
|
+
)
|
|
610
|
+
"""Remove specific tools by name."""
|
|
611
|
+
|
|
612
|
+
shell: Literal["bash", "zsh", "fish", "powershell"] | None = Field(
|
|
613
|
+
default=None,
|
|
614
|
+
title="Shell",
|
|
615
|
+
examples=["bash", "zsh"],
|
|
616
|
+
)
|
|
617
|
+
"""Select shell."""
|
|
618
|
+
|
|
619
|
+
startup_script: str | None = Field(
|
|
620
|
+
default=None,
|
|
621
|
+
title="Startup Script",
|
|
622
|
+
examples=["export PATH=$PATH:/usr/local/bin", "source ~/.bashrc"],
|
|
623
|
+
)
|
|
624
|
+
"""Inline startup script to run before each command."""
|
|
625
|
+
|
|
626
|
+
startup_script_file: str | None = Field(
|
|
627
|
+
default=None,
|
|
628
|
+
title="Startup Script File",
|
|
629
|
+
examples=["~/.augment_startup.sh", "/etc/augment/init.sh"],
|
|
630
|
+
)
|
|
631
|
+
"""Load startup script from file."""
|
|
632
|
+
|
|
633
|
+
def get_command(self) -> str:
|
|
634
|
+
"""Get the command to spawn the ACP server."""
|
|
635
|
+
return "auggie"
|
|
636
|
+
|
|
637
|
+
async def get_args(self, prompt_manager: PromptManager | None = None) -> list[str]:
|
|
638
|
+
"""Build command arguments from settings."""
|
|
639
|
+
args = ["--acp"]
|
|
640
|
+
|
|
641
|
+
# Handle system prompt from base class - Auggie uses instruction-file
|
|
642
|
+
prompt_file = await self.write_system_prompt_file(prompt_manager)
|
|
643
|
+
if prompt_file:
|
|
644
|
+
args.extend(["--instruction-file", prompt_file])
|
|
645
|
+
|
|
646
|
+
if self.model:
|
|
647
|
+
args.extend(["--model", self.model])
|
|
648
|
+
if self.workspace_root:
|
|
649
|
+
args.extend(["--workspace-root", self.workspace_root])
|
|
650
|
+
if self.rules:
|
|
651
|
+
for rule_file in self.rules:
|
|
652
|
+
args.extend(["--rules", rule_file])
|
|
653
|
+
if self.augment_cache_dir:
|
|
654
|
+
args.extend(["--augment-cache-dir", self.augment_cache_dir])
|
|
655
|
+
if self.retry_timeout is not None:
|
|
656
|
+
args.extend(["--retry-timeout", str(self.retry_timeout)])
|
|
657
|
+
if self.allow_indexing:
|
|
658
|
+
args.append("--allow-indexing")
|
|
659
|
+
if self.augment_token_file:
|
|
660
|
+
args.extend(["--augment-token-file", self.augment_token_file])
|
|
661
|
+
if self.github_api_token:
|
|
662
|
+
args.extend(["--github-api-token", self.github_api_token])
|
|
663
|
+
|
|
664
|
+
# Convert inherited mcp_servers to Auggie's --mcp-config format
|
|
665
|
+
mcp_json = self.build_mcp_config_json()
|
|
666
|
+
if mcp_json:
|
|
667
|
+
args.extend(["--mcp-config", mcp_json])
|
|
668
|
+
|
|
669
|
+
if self.permission:
|
|
670
|
+
for perm in self.permission:
|
|
671
|
+
args.extend(["--permission", perm])
|
|
672
|
+
if self.remove_tool:
|
|
673
|
+
for tool in self.remove_tool:
|
|
674
|
+
args.extend(["--remove-tool", tool])
|
|
675
|
+
if self.shell:
|
|
676
|
+
args.extend(["--shell", self.shell])
|
|
677
|
+
if self.startup_script:
|
|
678
|
+
args.extend(["--startup-script", self.startup_script])
|
|
679
|
+
if self.startup_script_file:
|
|
680
|
+
args.extend(["--startup-script-file", self.startup_script_file])
|
|
681
|
+
|
|
682
|
+
return args
|
|
683
|
+
|
|
684
|
+
@property
|
|
685
|
+
def model_providers(self) -> list[ProviderType]:
|
|
686
|
+
"""Auggie uses Augment Code's models."""
|
|
687
|
+
return []
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
class KimiACPAgentConfig(MCPCapableACPAgentConfig):
|
|
691
|
+
"""Configuration for Kimi CLI via ACP.
|
|
692
|
+
|
|
693
|
+
Command-line agent from Moonshot AI with ACP support.
|
|
694
|
+
|
|
695
|
+
Example:
|
|
696
|
+
```yaml
|
|
697
|
+
agents:
|
|
698
|
+
kimi:
|
|
699
|
+
type: acp
|
|
700
|
+
provider: kimi
|
|
701
|
+
cwd: /path/to/project
|
|
702
|
+
model: kimi-v1
|
|
703
|
+
work_dir: /path/to/work
|
|
704
|
+
yolo: true
|
|
705
|
+
```
|
|
706
|
+
"""
|
|
707
|
+
|
|
708
|
+
model_config = ConfigDict(json_schema_extra={"title": "Kimi ACP Agent Configuration"})
|
|
709
|
+
|
|
710
|
+
provider: Literal["kimi"] = Field("kimi", init=False)
|
|
711
|
+
"""Discriminator for Kimi CLI ACP agent."""
|
|
712
|
+
|
|
713
|
+
verbose: bool = Field(default=False, title="Verbose")
|
|
714
|
+
"""Print verbose information."""
|
|
715
|
+
|
|
716
|
+
debug: bool = Field(default=False, title="Debug")
|
|
717
|
+
"""Log debug information."""
|
|
718
|
+
|
|
719
|
+
agent_file: str | None = Field(
|
|
720
|
+
default=None,
|
|
721
|
+
title="Agent File",
|
|
722
|
+
examples=["./my-agent.yaml", "/etc/kimi/agent.json"],
|
|
723
|
+
)
|
|
724
|
+
"""Custom agent specification file."""
|
|
725
|
+
|
|
726
|
+
model: str | None = Field(
|
|
727
|
+
default=None,
|
|
728
|
+
title="Model",
|
|
729
|
+
examples=["kimi-v1", "kimi-v2"],
|
|
730
|
+
)
|
|
731
|
+
"""LLM model to use."""
|
|
732
|
+
|
|
733
|
+
work_dir: str | None = Field(
|
|
734
|
+
default=None,
|
|
735
|
+
title="Work Dir",
|
|
736
|
+
examples=["/path/to/work", "/tmp/kimi-workspace"],
|
|
737
|
+
)
|
|
738
|
+
"""Working directory for the agent."""
|
|
739
|
+
|
|
740
|
+
yolo: bool = Field(default=False, title="YOLO")
|
|
741
|
+
"""Automatically approve all actions."""
|
|
742
|
+
|
|
743
|
+
thinking: bool | None = Field(default=None, title="Thinking")
|
|
744
|
+
"""Enable thinking mode if supported."""
|
|
745
|
+
|
|
746
|
+
def get_command(self) -> str:
|
|
747
|
+
"""Get the command to spawn the ACP server."""
|
|
748
|
+
return "kimi"
|
|
749
|
+
|
|
750
|
+
async def get_args(self, prompt_manager: PromptManager | None = None) -> list[str]:
|
|
751
|
+
"""Build command arguments from settings."""
|
|
752
|
+
args = ["--acp"]
|
|
753
|
+
|
|
754
|
+
if self.verbose:
|
|
755
|
+
args.append("--verbose")
|
|
756
|
+
if self.debug:
|
|
757
|
+
args.append("--debug")
|
|
758
|
+
if self.agent_file:
|
|
759
|
+
args.extend(["--agent-file", self.agent_file])
|
|
760
|
+
if self.model:
|
|
761
|
+
args.extend(["--model", self.model])
|
|
762
|
+
if self.work_dir:
|
|
763
|
+
args.extend(["--work-dir", self.work_dir])
|
|
764
|
+
|
|
765
|
+
# Convert inherited mcp_servers to Kimi's --mcp-config format
|
|
766
|
+
mcp_json = self.build_mcp_config_json()
|
|
767
|
+
if mcp_json:
|
|
768
|
+
args.extend(["--mcp-config", mcp_json])
|
|
769
|
+
|
|
770
|
+
if self.yolo:
|
|
771
|
+
args.append("--yolo")
|
|
772
|
+
if self.thinking is not None and self.thinking:
|
|
773
|
+
args.append("--thinking")
|
|
774
|
+
|
|
775
|
+
return args
|
|
776
|
+
|
|
777
|
+
@property
|
|
778
|
+
def model_providers(self) -> list[ProviderType]:
|
|
779
|
+
"""Kimi uses Moonshot AI's models."""
|
|
780
|
+
return []
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
# Union of all ACP agent config types
|
|
784
|
+
MCPCapableACPAgentConfigTypes = (
|
|
785
|
+
ClaudeACPAgentConfig
|
|
786
|
+
| GeminiACPAgentConfig
|
|
787
|
+
| FastAgentACPAgentConfig
|
|
788
|
+
| AuggieACPAgentConfig
|
|
789
|
+
| KimiACPAgentConfig
|
|
790
|
+
)
|