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,1033 @@
|
|
|
1
|
+
"""Models for toolsets."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from typing import TYPE_CHECKING, Annotated, Literal, cast
|
|
7
|
+
|
|
8
|
+
from exxec.configs import ExecutionEnvironmentConfig
|
|
9
|
+
from llmling_models.configs.model_configs import AnyModelConfig
|
|
10
|
+
from pydantic import ConfigDict, EmailStr, Field, HttpUrl, SecretStr
|
|
11
|
+
from schemez import Schema
|
|
12
|
+
from searchly.config import (
|
|
13
|
+
NewsSearchProviderConfig,
|
|
14
|
+
NewsSearchProviderName,
|
|
15
|
+
WebSearchProviderConfig,
|
|
16
|
+
WebSearchProviderName,
|
|
17
|
+
get_config_class,
|
|
18
|
+
)
|
|
19
|
+
from tokonomics.model_names import ModelId
|
|
20
|
+
from upathtools import UPath
|
|
21
|
+
from upathtools.configs import FilesystemConfigType
|
|
22
|
+
from upathtools.configs.base import FileSystemConfig
|
|
23
|
+
|
|
24
|
+
from agentpool_config.converters import ConversionConfig
|
|
25
|
+
from agentpool_config.tools import ImportToolConfig
|
|
26
|
+
from agentpool_config.workers import WorkerConfig
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if TYPE_CHECKING:
|
|
30
|
+
from agentpool.resource_providers import ResourceProvider
|
|
31
|
+
from agentpool_toolsets.search_toolset import SearchTools
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
MarkupType = Literal["yaml", "json", "toml"]
|
|
35
|
+
# Tool name literals for statically-defined toolsets
|
|
36
|
+
AgentManagementToolName = Literal[
|
|
37
|
+
"create_worker_agent",
|
|
38
|
+
"add_agent",
|
|
39
|
+
"add_team",
|
|
40
|
+
"connect_nodes",
|
|
41
|
+
]
|
|
42
|
+
SubagentToolName = Literal[
|
|
43
|
+
"list_available_nodes",
|
|
44
|
+
"delegate_to",
|
|
45
|
+
"ask_agent",
|
|
46
|
+
]
|
|
47
|
+
ExecutionEnvironmentToolName = Literal[
|
|
48
|
+
"execute_code",
|
|
49
|
+
"execute_command",
|
|
50
|
+
"start_process",
|
|
51
|
+
"get_process_output",
|
|
52
|
+
"wait_for_process",
|
|
53
|
+
"kill_process",
|
|
54
|
+
"release_process",
|
|
55
|
+
"list_processes",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
ToolManagementToolName = Literal["register_tool", "register_code_tool"]
|
|
59
|
+
UserInteractionToolName = Literal["ask_user",]
|
|
60
|
+
HistoryToolName = Literal["search_history", "show_statistics"]
|
|
61
|
+
SkillsToolName = Literal["load_skill", "list_skills"]
|
|
62
|
+
IntegrationToolName = Literal["add_local_mcp_server", "add_remote_mcp_server"]
|
|
63
|
+
CodeToolName = Literal["format_code", "ast_grep"]
|
|
64
|
+
PlanToolName = Literal["get_plan", "add_plan_entry", "update_plan_entry", "remove_plan_entry"]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class BaseToolsetConfig(Schema):
|
|
68
|
+
"""Base configuration for toolsets."""
|
|
69
|
+
|
|
70
|
+
model_config = ConfigDict(
|
|
71
|
+
json_schema_extra={
|
|
72
|
+
"x-icon": "octicon:package-16",
|
|
73
|
+
"x-doc-title": "Toolset Configuration",
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
namespace: str | None = Field(default=None, examples=["web", "files"], title="Tool namespace")
|
|
78
|
+
"""Optional namespace prefix for tool names"""
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class OpenAPIToolsetConfig(BaseToolsetConfig):
|
|
82
|
+
"""Configuration for OpenAPI toolsets."""
|
|
83
|
+
|
|
84
|
+
model_config = ConfigDict(
|
|
85
|
+
json_schema_extra={
|
|
86
|
+
"x-icon": "octicon:globe-16",
|
|
87
|
+
"x-doc-title": "OpenAPI Toolset",
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
type: Literal["openapi"] = Field("openapi", init=False)
|
|
92
|
+
"""OpenAPI toolset."""
|
|
93
|
+
|
|
94
|
+
spec: UPath = Field(
|
|
95
|
+
examples=["https://api.example.com/openapi.json", "/path/to/spec.yaml"],
|
|
96
|
+
title="OpenAPI specification",
|
|
97
|
+
)
|
|
98
|
+
"""URL or path to the OpenAPI specification document."""
|
|
99
|
+
|
|
100
|
+
base_url: HttpUrl | None = Field(
|
|
101
|
+
default=None,
|
|
102
|
+
examples=["https://api.example.com", "http://localhost:8080"],
|
|
103
|
+
title="Base URL override",
|
|
104
|
+
)
|
|
105
|
+
"""Optional base URL for API requests, overrides the one in spec."""
|
|
106
|
+
|
|
107
|
+
def get_provider(self) -> ResourceProvider:
|
|
108
|
+
"""Create OpenAPI tools provider from this config."""
|
|
109
|
+
from agentpool_toolsets.openapi import OpenAPITools
|
|
110
|
+
|
|
111
|
+
base_url = str(self.base_url) if self.base_url else ""
|
|
112
|
+
return OpenAPITools(spec=self.spec, base_url=base_url)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class EntryPointToolsetConfig(BaseToolsetConfig):
|
|
116
|
+
"""Configuration for entry point toolsets."""
|
|
117
|
+
|
|
118
|
+
model_config = ConfigDict(
|
|
119
|
+
json_schema_extra={
|
|
120
|
+
"x-icon": "octicon:plug-16",
|
|
121
|
+
"x-doc-title": "Entry Point Toolset",
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
type: Literal["entry_points"] = Field("entry_points", init=False)
|
|
126
|
+
"""Entry point toolset."""
|
|
127
|
+
|
|
128
|
+
module: str = Field(
|
|
129
|
+
examples=["myapp.tools", "external_package.plugins"],
|
|
130
|
+
title="Module path",
|
|
131
|
+
)
|
|
132
|
+
"""Python module path to load tools from via entry points."""
|
|
133
|
+
|
|
134
|
+
def get_provider(self) -> ResourceProvider:
|
|
135
|
+
"""Create provider from this config."""
|
|
136
|
+
from agentpool_toolsets.entry_points import EntryPointTools
|
|
137
|
+
|
|
138
|
+
return EntryPointTools(module=self.module)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class ComposioToolSetConfig(BaseToolsetConfig):
|
|
142
|
+
"""Configuration for Composio toolsets."""
|
|
143
|
+
|
|
144
|
+
model_config = ConfigDict(
|
|
145
|
+
json_schema_extra={
|
|
146
|
+
"x-icon": "octicon:apps-16",
|
|
147
|
+
"x-doc-title": "Composio Toolset",
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
type: Literal["composio"] = Field("composio", init=False)
|
|
152
|
+
"""Composio Toolsets."""
|
|
153
|
+
|
|
154
|
+
api_key: SecretStr | None = Field(default=None, title="Composio API key")
|
|
155
|
+
"""Composio API Key."""
|
|
156
|
+
|
|
157
|
+
user_id: EmailStr = Field(
|
|
158
|
+
default="user@example.com",
|
|
159
|
+
examples=["user@example.com", "admin@company.com"],
|
|
160
|
+
title="User ID",
|
|
161
|
+
)
|
|
162
|
+
"""User ID for composio tools."""
|
|
163
|
+
|
|
164
|
+
toolsets: list[str] = Field(
|
|
165
|
+
default_factory=list,
|
|
166
|
+
examples=[["github", "slack"], ["gmail", "calendar"]],
|
|
167
|
+
title="Toolset list",
|
|
168
|
+
)
|
|
169
|
+
"""List of toolsets to load."""
|
|
170
|
+
|
|
171
|
+
def get_provider(self) -> ResourceProvider:
|
|
172
|
+
"""Create provider from this config."""
|
|
173
|
+
from agentpool_toolsets.composio_toolset import ComposioTools
|
|
174
|
+
|
|
175
|
+
key = self.api_key.get_secret_value() if self.api_key else os.getenv("COMPOSIO_API_KEY")
|
|
176
|
+
return ComposioTools(user_id=self.user_id, toolsets=self.toolsets, api_key=key)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class AgentManagementToolsetConfig(BaseToolsetConfig):
|
|
180
|
+
"""Configuration for agent pool building tools."""
|
|
181
|
+
|
|
182
|
+
model_config = ConfigDict(
|
|
183
|
+
json_schema_extra={
|
|
184
|
+
"x-icon": "octicon:people-16",
|
|
185
|
+
"x-doc-title": "Agent Management Toolset",
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
type: Literal["agent_management"] = Field("agent_management", init=False)
|
|
190
|
+
"""Agent pool building toolset (create_worker_agent, add_agent, add_team, connect_nodes)."""
|
|
191
|
+
|
|
192
|
+
tools: dict[AgentManagementToolName, bool] | None = Field(
|
|
193
|
+
default=None,
|
|
194
|
+
title="Tool filter",
|
|
195
|
+
)
|
|
196
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
197
|
+
|
|
198
|
+
def get_provider(self) -> ResourceProvider:
|
|
199
|
+
"""Create agent management tools provider."""
|
|
200
|
+
from agentpool_toolsets.builtin import AgentManagementTools
|
|
201
|
+
|
|
202
|
+
provider = AgentManagementTools(name="agent_management")
|
|
203
|
+
if self.tools is not None:
|
|
204
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
205
|
+
|
|
206
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
207
|
+
return provider
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
class SubagentToolsetConfig(BaseToolsetConfig):
|
|
211
|
+
"""Configuration for subagent interaction tools."""
|
|
212
|
+
|
|
213
|
+
model_config = ConfigDict(
|
|
214
|
+
json_schema_extra={
|
|
215
|
+
"x-icon": "octicon:share-16",
|
|
216
|
+
"x-doc-title": "Subagent Toolset",
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
type: Literal["subagent"] = Field("subagent", init=False)
|
|
221
|
+
"""Subagent interaction toolset (delegate_to, ask_agent, list_available_agents/teams)."""
|
|
222
|
+
|
|
223
|
+
tools: dict[SubagentToolName, bool] | None = Field(
|
|
224
|
+
default=None,
|
|
225
|
+
title="Tool filter",
|
|
226
|
+
)
|
|
227
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
228
|
+
|
|
229
|
+
batch_stream_deltas: bool = Field(
|
|
230
|
+
default=False,
|
|
231
|
+
title="Batch stream deltas",
|
|
232
|
+
)
|
|
233
|
+
"""Batch consecutive text/thinking deltas for fewer UI updates."""
|
|
234
|
+
|
|
235
|
+
def get_provider(self) -> ResourceProvider:
|
|
236
|
+
"""Create subagent tools provider."""
|
|
237
|
+
from agentpool_toolsets.builtin.subagent_tools import SubagentTools
|
|
238
|
+
|
|
239
|
+
provider = SubagentTools(
|
|
240
|
+
name="subagent_tools",
|
|
241
|
+
batch_stream_deltas=self.batch_stream_deltas,
|
|
242
|
+
)
|
|
243
|
+
if self.tools is not None:
|
|
244
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
245
|
+
|
|
246
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
247
|
+
return provider
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
class WorkersToolsetConfig(BaseToolsetConfig):
|
|
251
|
+
"""Configuration for worker agent tools.
|
|
252
|
+
|
|
253
|
+
Workers are agents or teams registered as tools for the parent agent.
|
|
254
|
+
This provides a predefined set of worker tools based on configuration.
|
|
255
|
+
"""
|
|
256
|
+
|
|
257
|
+
model_config = ConfigDict(
|
|
258
|
+
json_schema_extra={
|
|
259
|
+
"x-icon": "octicon:people-16",
|
|
260
|
+
"x-doc-title": "Workers Toolset",
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
type: Literal["workers"] = Field("workers", init=False)
|
|
265
|
+
"""Workers toolset (predefined agent/team tools)."""
|
|
266
|
+
|
|
267
|
+
workers: list[WorkerConfig] = Field(default_factory=list, title="Worker configurations")
|
|
268
|
+
"""List of workers to register as tools."""
|
|
269
|
+
|
|
270
|
+
def get_provider(self) -> ResourceProvider:
|
|
271
|
+
"""Create workers tools provider."""
|
|
272
|
+
from agentpool_toolsets.builtin.workers import WorkersTools
|
|
273
|
+
|
|
274
|
+
return WorkersTools(workers=self.workers, name="workers")
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
class ExecutionEnvironmentToolsetConfig(BaseToolsetConfig):
|
|
278
|
+
"""Configuration for execution environment toolset (code + process management)."""
|
|
279
|
+
|
|
280
|
+
model_config = ConfigDict(
|
|
281
|
+
json_schema_extra={
|
|
282
|
+
"x-icon": "octicon:terminal-16",
|
|
283
|
+
"x-doc-title": "Execution Environment Toolset",
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
type: Literal["execution"] = Field("execution", init=False)
|
|
288
|
+
"""Execution environment toolset."""
|
|
289
|
+
|
|
290
|
+
environment: ExecutionEnvironmentConfig | None = Field(
|
|
291
|
+
default=None,
|
|
292
|
+
title="Execution environment",
|
|
293
|
+
)
|
|
294
|
+
"""Optional execution environment configuration (defaults to local)."""
|
|
295
|
+
|
|
296
|
+
tools: dict[ExecutionEnvironmentToolName, bool] | None = Field(
|
|
297
|
+
default=None,
|
|
298
|
+
title="Tool filter",
|
|
299
|
+
)
|
|
300
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
301
|
+
|
|
302
|
+
def get_provider(self) -> ResourceProvider:
|
|
303
|
+
"""Create execution environment tools provider."""
|
|
304
|
+
from agentpool_toolsets.builtin import ExecutionEnvironmentTools
|
|
305
|
+
|
|
306
|
+
env = self.environment.get_provider() if self.environment else None
|
|
307
|
+
provider = ExecutionEnvironmentTools(env=env, name="execution")
|
|
308
|
+
if self.tools is not None:
|
|
309
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
310
|
+
|
|
311
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
312
|
+
return provider
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
class ToolManagementToolsetConfig(BaseToolsetConfig):
|
|
316
|
+
"""Configuration for tool management toolset."""
|
|
317
|
+
|
|
318
|
+
model_config = ConfigDict(
|
|
319
|
+
json_schema_extra={
|
|
320
|
+
"x-icon": "octicon:tools-16",
|
|
321
|
+
"x-doc-title": "Tool Management Toolset",
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
type: Literal["tool_management"] = Field("tool_management", init=False)
|
|
326
|
+
"""Tool management toolset."""
|
|
327
|
+
|
|
328
|
+
tools: dict[ToolManagementToolName, bool] | None = Field(
|
|
329
|
+
default=None,
|
|
330
|
+
title="Tool filter",
|
|
331
|
+
)
|
|
332
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
333
|
+
|
|
334
|
+
def get_provider(self) -> ResourceProvider:
|
|
335
|
+
"""Create tool management tools provider."""
|
|
336
|
+
from agentpool_toolsets.builtin import ToolManagementTools
|
|
337
|
+
|
|
338
|
+
provider = ToolManagementTools(name="tool_management")
|
|
339
|
+
if self.tools is not None:
|
|
340
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
341
|
+
|
|
342
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
343
|
+
return provider
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
class UserInteractionToolsetConfig(BaseToolsetConfig):
|
|
347
|
+
"""Configuration for user interaction toolset."""
|
|
348
|
+
|
|
349
|
+
model_config = ConfigDict(
|
|
350
|
+
json_schema_extra={
|
|
351
|
+
"x-icon": "octicon:comment-discussion-16",
|
|
352
|
+
"x-doc-title": "User Interaction Toolset",
|
|
353
|
+
}
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
type: Literal["user_interaction"] = Field("user_interaction", init=False)
|
|
357
|
+
"""User interaction toolset."""
|
|
358
|
+
|
|
359
|
+
tools: dict[UserInteractionToolName, bool] | None = Field(
|
|
360
|
+
default=None,
|
|
361
|
+
title="Tool filter",
|
|
362
|
+
)
|
|
363
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
364
|
+
|
|
365
|
+
def get_provider(self) -> ResourceProvider:
|
|
366
|
+
"""Create user interaction tools provider."""
|
|
367
|
+
from agentpool_toolsets.builtin import UserInteractionTools
|
|
368
|
+
|
|
369
|
+
provider = UserInteractionTools(name="user_interaction")
|
|
370
|
+
if self.tools is not None:
|
|
371
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
372
|
+
|
|
373
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
374
|
+
return provider
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
class HistoryToolsetConfig(BaseToolsetConfig):
|
|
378
|
+
"""Configuration for history toolset."""
|
|
379
|
+
|
|
380
|
+
model_config = ConfigDict(
|
|
381
|
+
json_schema_extra={
|
|
382
|
+
"x-icon": "octicon:history-16",
|
|
383
|
+
"x-doc-title": "History Toolset",
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
type: Literal["history"] = Field("history", init=False)
|
|
388
|
+
"""History toolset."""
|
|
389
|
+
|
|
390
|
+
tools: dict[HistoryToolName, bool] | None = Field(
|
|
391
|
+
default=None,
|
|
392
|
+
title="Tool filter",
|
|
393
|
+
)
|
|
394
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
395
|
+
|
|
396
|
+
def get_provider(self) -> ResourceProvider:
|
|
397
|
+
"""Create history tools provider."""
|
|
398
|
+
from agentpool_toolsets.builtin import HistoryTools
|
|
399
|
+
|
|
400
|
+
provider = HistoryTools(name="history")
|
|
401
|
+
if self.tools is not None:
|
|
402
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
403
|
+
|
|
404
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
405
|
+
return provider
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
class SkillsToolsetConfig(BaseToolsetConfig):
|
|
409
|
+
"""Configuration for skills toolset.
|
|
410
|
+
|
|
411
|
+
Provides tools to discover and load Claude Code Skills from the pool's
|
|
412
|
+
skills registry. Skills are discovered from configured directories
|
|
413
|
+
(e.g., ~/.claude/skills/, .claude/skills/).
|
|
414
|
+
"""
|
|
415
|
+
|
|
416
|
+
model_config = ConfigDict(
|
|
417
|
+
json_schema_extra={
|
|
418
|
+
"x-icon": "octicon:mortar-board-16",
|
|
419
|
+
"x-doc-title": "Skills Toolset",
|
|
420
|
+
}
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
type: Literal["skills"] = Field("skills", init=False)
|
|
424
|
+
"""Skills toolset."""
|
|
425
|
+
|
|
426
|
+
tools: dict[SkillsToolName, bool] | None = Field(
|
|
427
|
+
default=None,
|
|
428
|
+
title="Tool filter",
|
|
429
|
+
)
|
|
430
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
431
|
+
|
|
432
|
+
def get_provider(self) -> ResourceProvider:
|
|
433
|
+
"""Create skills tools provider."""
|
|
434
|
+
from agentpool_toolsets.builtin import SkillsTools
|
|
435
|
+
|
|
436
|
+
provider = SkillsTools(name="skills")
|
|
437
|
+
if self.tools is not None:
|
|
438
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
439
|
+
|
|
440
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
441
|
+
return provider
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
class IntegrationToolsetConfig(BaseToolsetConfig):
|
|
445
|
+
"""Configuration for integration toolset."""
|
|
446
|
+
|
|
447
|
+
model_config = ConfigDict(
|
|
448
|
+
json_schema_extra={
|
|
449
|
+
"x-icon": "octicon:link-16",
|
|
450
|
+
"x-doc-title": "Integration Toolset",
|
|
451
|
+
}
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
type: Literal["integrations"] = Field("integrations", init=False)
|
|
455
|
+
"""Integration toolset."""
|
|
456
|
+
|
|
457
|
+
tools: dict[IntegrationToolName, bool] | None = Field(
|
|
458
|
+
default=None,
|
|
459
|
+
title="Tool filter",
|
|
460
|
+
)
|
|
461
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
462
|
+
|
|
463
|
+
def get_provider(self) -> ResourceProvider:
|
|
464
|
+
"""Create integration tools provider."""
|
|
465
|
+
from agentpool_toolsets.builtin import IntegrationTools
|
|
466
|
+
|
|
467
|
+
provider = IntegrationTools(name="integrations")
|
|
468
|
+
if self.tools is not None:
|
|
469
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
470
|
+
|
|
471
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
472
|
+
return provider
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
class CodeToolsetConfig(BaseToolsetConfig):
|
|
476
|
+
"""Configuration for code toolset."""
|
|
477
|
+
|
|
478
|
+
model_config = ConfigDict(
|
|
479
|
+
json_schema_extra={
|
|
480
|
+
"x-icon": "octicon:code-16",
|
|
481
|
+
"x-doc-title": "Code Toolset",
|
|
482
|
+
}
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
type: Literal["code"] = Field("code", init=False)
|
|
486
|
+
"""Code toolset."""
|
|
487
|
+
|
|
488
|
+
tools: dict[CodeToolName, bool] | None = Field(
|
|
489
|
+
default=None,
|
|
490
|
+
title="Tool filter",
|
|
491
|
+
)
|
|
492
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
493
|
+
|
|
494
|
+
environment: ExecutionEnvironmentConfig | None = Field(
|
|
495
|
+
default=None,
|
|
496
|
+
title="Execution environment",
|
|
497
|
+
)
|
|
498
|
+
"""Optional execution environment. If None, falls back to agent's env at runtime."""
|
|
499
|
+
|
|
500
|
+
def get_provider(self) -> ResourceProvider:
|
|
501
|
+
"""Create code tools provider."""
|
|
502
|
+
from agentpool_toolsets.builtin.code import CodeTools
|
|
503
|
+
|
|
504
|
+
env = self.environment.get_provider() if self.environment else None
|
|
505
|
+
provider = CodeTools(env=env, name="code")
|
|
506
|
+
if self.tools is not None:
|
|
507
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
508
|
+
|
|
509
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
510
|
+
return provider
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
class FSSpecToolsetConfig(BaseToolsetConfig):
|
|
514
|
+
"""Configuration for file access toolset (supports local and remote filesystems)."""
|
|
515
|
+
|
|
516
|
+
model_config = ConfigDict(
|
|
517
|
+
json_schema_extra={
|
|
518
|
+
"x-icon": "octicon:file-directory-16",
|
|
519
|
+
"x-doc-title": "File Access Toolset",
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
type: Literal["file_access"] = Field("file_access", init=False)
|
|
524
|
+
"""File access toolset."""
|
|
525
|
+
|
|
526
|
+
fs: str | FilesystemConfigType | None = Field(
|
|
527
|
+
default=None,
|
|
528
|
+
examples=[
|
|
529
|
+
"file:///",
|
|
530
|
+
"s3://my-bucket",
|
|
531
|
+
{"type": "github", "org": "sveltejs", "repo": "svelte"},
|
|
532
|
+
{
|
|
533
|
+
"type": "union",
|
|
534
|
+
"filesystems": {"docs": {"type": "github", "org": "org", "repo": "repo"}},
|
|
535
|
+
},
|
|
536
|
+
],
|
|
537
|
+
title="Filesystem",
|
|
538
|
+
)
|
|
539
|
+
"""Filesystem URI string or configuration object. If None, use agent default FS.
|
|
540
|
+
|
|
541
|
+
Supports:
|
|
542
|
+
- URI strings: "file:///", "s3://bucket", "github://org/repo"
|
|
543
|
+
- Full configs: {"type": "github", "org": "...", "repo": "..."}
|
|
544
|
+
- Composed filesystems: {"type": "union", "filesystems": {...}}
|
|
545
|
+
"""
|
|
546
|
+
|
|
547
|
+
model: str | ModelId | AnyModelConfig | None = Field(
|
|
548
|
+
default=None,
|
|
549
|
+
examples=["openai:gpt-5-nano"],
|
|
550
|
+
title="Model for edit sub-agent",
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
storage_options: dict[str, str] = Field(
|
|
554
|
+
default_factory=dict,
|
|
555
|
+
examples=[
|
|
556
|
+
{"region": "us-east-1", "profile": "default"},
|
|
557
|
+
{"token": "ghp_123456789", "timeout": "30"},
|
|
558
|
+
],
|
|
559
|
+
title="Storage options",
|
|
560
|
+
)
|
|
561
|
+
"""Additional options for URI-based filesystems (ignored when using config object)."""
|
|
562
|
+
|
|
563
|
+
conversion: ConversionConfig | None = Field(default=None, title="Conversion config")
|
|
564
|
+
"""Optional conversion configuration for markdown conversion."""
|
|
565
|
+
|
|
566
|
+
max_file_size_kb: int = Field(
|
|
567
|
+
default=64,
|
|
568
|
+
ge=1,
|
|
569
|
+
le=10240,
|
|
570
|
+
title="Maximum file size",
|
|
571
|
+
)
|
|
572
|
+
"""Maximum file size in kilobytes for read/write operations (default: 64KB)."""
|
|
573
|
+
|
|
574
|
+
max_grep_output_kb: int = Field(
|
|
575
|
+
default=64,
|
|
576
|
+
ge=1,
|
|
577
|
+
le=10240,
|
|
578
|
+
title="Maximum grep output size",
|
|
579
|
+
)
|
|
580
|
+
"""Maximum grep output size in kilobytes (default: 64KB)."""
|
|
581
|
+
|
|
582
|
+
use_subprocess_grep: bool = Field(
|
|
583
|
+
default=True,
|
|
584
|
+
title="Use subprocess grep",
|
|
585
|
+
)
|
|
586
|
+
"""Use ripgrep/grep subprocess if available (faster than Python regex)."""
|
|
587
|
+
|
|
588
|
+
enable_diagnostics: bool = Field(
|
|
589
|
+
default=False,
|
|
590
|
+
title="Enable diagnostics",
|
|
591
|
+
)
|
|
592
|
+
"""Run LSP CLI diagnostics (type checking, linting) after file writes."""
|
|
593
|
+
|
|
594
|
+
large_file_tokens: int = Field(
|
|
595
|
+
default=12_000,
|
|
596
|
+
ge=1000,
|
|
597
|
+
le=100_000,
|
|
598
|
+
title="Large file threshold",
|
|
599
|
+
)
|
|
600
|
+
"""Token threshold for switching to structure map instead of full content."""
|
|
601
|
+
|
|
602
|
+
map_max_tokens: int = Field(
|
|
603
|
+
default=2048,
|
|
604
|
+
ge=256,
|
|
605
|
+
le=16_000,
|
|
606
|
+
title="Structure map max tokens",
|
|
607
|
+
)
|
|
608
|
+
"""Maximum tokens for structure map output when reading large files."""
|
|
609
|
+
|
|
610
|
+
def get_provider(self) -> ResourceProvider:
|
|
611
|
+
"""Create FSSpec filesystem tools provider."""
|
|
612
|
+
import fsspec
|
|
613
|
+
|
|
614
|
+
from agentpool.prompts.conversion_manager import ConversionManager
|
|
615
|
+
from agentpool_toolsets.fsspec_toolset import FSSpecTools
|
|
616
|
+
|
|
617
|
+
model = (
|
|
618
|
+
self.model
|
|
619
|
+
if isinstance(self.model, str) or self.model is None
|
|
620
|
+
else self.model.get_model()
|
|
621
|
+
)
|
|
622
|
+
# Create filesystem from config
|
|
623
|
+
if self.fs is None:
|
|
624
|
+
fs = None
|
|
625
|
+
elif isinstance(self.fs, str):
|
|
626
|
+
# URI string - use fsspec directly
|
|
627
|
+
fs, _url_path = fsspec.url_to_fs(self.fs, **self.storage_options)
|
|
628
|
+
elif isinstance(self.fs, FileSystemConfig):
|
|
629
|
+
# Full config object - use create_fs()
|
|
630
|
+
fs = self.fs.create_fs()
|
|
631
|
+
else:
|
|
632
|
+
fs = None
|
|
633
|
+
converter = ConversionManager(self.conversion) if self.conversion else None
|
|
634
|
+
return FSSpecTools(
|
|
635
|
+
fs,
|
|
636
|
+
converter=converter,
|
|
637
|
+
edit_model=model,
|
|
638
|
+
max_file_size_kb=self.max_file_size_kb,
|
|
639
|
+
max_grep_output_kb=self.max_grep_output_kb,
|
|
640
|
+
use_subprocess_grep=self.use_subprocess_grep,
|
|
641
|
+
enable_diagnostics=self.enable_diagnostics,
|
|
642
|
+
large_file_tokens=self.large_file_tokens,
|
|
643
|
+
map_max_tokens=self.map_max_tokens,
|
|
644
|
+
)
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
class VFSToolsetConfig(BaseToolsetConfig):
|
|
648
|
+
"""Configuration for VFS registry filesystem toolset."""
|
|
649
|
+
|
|
650
|
+
model_config = ConfigDict(
|
|
651
|
+
json_schema_extra={
|
|
652
|
+
"x-icon": "octicon:file-symlink-directory-16",
|
|
653
|
+
"x-doc-title": "VFS Toolset",
|
|
654
|
+
}
|
|
655
|
+
)
|
|
656
|
+
|
|
657
|
+
type: Literal["vfs"] = Field("vfs", init=False)
|
|
658
|
+
"""VFS registry filesystem toolset."""
|
|
659
|
+
|
|
660
|
+
def get_provider(self) -> ResourceProvider:
|
|
661
|
+
"""Create VFS registry filesystem tools provider."""
|
|
662
|
+
from agentpool_toolsets.vfs_toolset import VFSTools
|
|
663
|
+
|
|
664
|
+
return VFSTools(name="vfs")
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
class SearchToolsetConfig(BaseToolsetConfig):
|
|
668
|
+
"""Configuration for web/news search toolset."""
|
|
669
|
+
|
|
670
|
+
model_config = ConfigDict(
|
|
671
|
+
json_schema_extra={
|
|
672
|
+
"x-icon": "octicon:search-16",
|
|
673
|
+
"x-doc-title": "Search Toolset",
|
|
674
|
+
}
|
|
675
|
+
)
|
|
676
|
+
|
|
677
|
+
type: Literal["search"] = Field("search", init=False)
|
|
678
|
+
"""Search toolset."""
|
|
679
|
+
|
|
680
|
+
web_search: WebSearchProviderConfig | WebSearchProviderName | None = Field(
|
|
681
|
+
default=None, title="Web search"
|
|
682
|
+
)
|
|
683
|
+
"""Web search provider configuration."""
|
|
684
|
+
|
|
685
|
+
news_search: NewsSearchProviderConfig | NewsSearchProviderName | None = Field(
|
|
686
|
+
default=None, title="News search"
|
|
687
|
+
)
|
|
688
|
+
"""News search provider configuration."""
|
|
689
|
+
|
|
690
|
+
def get_provider(self) -> SearchTools:
|
|
691
|
+
"""Create search tools provider."""
|
|
692
|
+
from searchly import BaseSearchProviderConfig, NewsSearchProvider, WebSearchProvider
|
|
693
|
+
|
|
694
|
+
from agentpool_toolsets.search_toolset import SearchTools
|
|
695
|
+
|
|
696
|
+
match self.web_search:
|
|
697
|
+
case str():
|
|
698
|
+
kls = get_config_class(self.web_search)
|
|
699
|
+
web: WebSearchProvider | NewsSearchProvider | None = kls().get_provider() # type: ignore[call-arg]
|
|
700
|
+
case BaseSearchProviderConfig():
|
|
701
|
+
web = self.web_search.get_provider()
|
|
702
|
+
case None:
|
|
703
|
+
web = None
|
|
704
|
+
match self.news_search:
|
|
705
|
+
case str():
|
|
706
|
+
kls = get_config_class(self.news_search)
|
|
707
|
+
news: WebSearchProvider | NewsSearchProvider | None = kls().get_provider() # type: ignore[call-arg]
|
|
708
|
+
case BaseSearchProviderConfig():
|
|
709
|
+
news = self.news_search.get_provider()
|
|
710
|
+
case None:
|
|
711
|
+
news = None
|
|
712
|
+
assert isinstance(web, WebSearchProvider) or web is None
|
|
713
|
+
assert isinstance(news, NewsSearchProvider) or news is None
|
|
714
|
+
return SearchTools(web_search=web, news_search=news)
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
class NotificationsToolsetConfig(BaseToolsetConfig):
|
|
718
|
+
"""Configuration for Apprise-based notifications toolset."""
|
|
719
|
+
|
|
720
|
+
model_config = ConfigDict(
|
|
721
|
+
json_schema_extra={
|
|
722
|
+
"x-icon": "octicon:bell-16",
|
|
723
|
+
"x-doc-title": "Notifications Toolset",
|
|
724
|
+
}
|
|
725
|
+
)
|
|
726
|
+
|
|
727
|
+
type: Literal["notifications"] = Field("notifications", init=False)
|
|
728
|
+
"""Notifications toolset."""
|
|
729
|
+
|
|
730
|
+
channels: dict[str, str | list[str]] = Field(
|
|
731
|
+
default_factory=dict,
|
|
732
|
+
examples=[
|
|
733
|
+
{
|
|
734
|
+
"team_slack": "slack://TokenA/TokenB/TokenC/",
|
|
735
|
+
"personal": "tgram://bottoken/ChatID",
|
|
736
|
+
"ops_alerts": ["slack://ops/", "mailto://ops@company.com"],
|
|
737
|
+
}
|
|
738
|
+
],
|
|
739
|
+
title="Notification channels",
|
|
740
|
+
)
|
|
741
|
+
"""Named notification channels. Values can be a single Apprise URL or list of URLs."""
|
|
742
|
+
|
|
743
|
+
def get_provider(self) -> ResourceProvider:
|
|
744
|
+
"""Create notifications tools provider."""
|
|
745
|
+
from agentpool_toolsets.notifications import NotificationsTools
|
|
746
|
+
|
|
747
|
+
return NotificationsTools(channels=self.channels)
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
class SemanticMemoryToolsetConfig(BaseToolsetConfig):
|
|
751
|
+
"""Configuration for semantic memory / knowledge processing toolset."""
|
|
752
|
+
|
|
753
|
+
model_config = ConfigDict(
|
|
754
|
+
json_schema_extra={
|
|
755
|
+
"x-icon": "octicon:database-16",
|
|
756
|
+
"x-doc-title": "Semantic Memory Toolset",
|
|
757
|
+
}
|
|
758
|
+
)
|
|
759
|
+
|
|
760
|
+
type: Literal["semantic_memory"] = Field("semantic_memory", init=False)
|
|
761
|
+
"""Semantic memory toolset using TypeAgent's KnowPro."""
|
|
762
|
+
|
|
763
|
+
model: str | ModelId | AnyModelConfig | None = Field(
|
|
764
|
+
default=None,
|
|
765
|
+
examples=["openai:gpt-4o", "anthropic:claude-sonnet-4-20250514"],
|
|
766
|
+
title="Model for LLM sampling",
|
|
767
|
+
)
|
|
768
|
+
"""Model to use for query translation and answer generation."""
|
|
769
|
+
|
|
770
|
+
dbname: str | None = Field(
|
|
771
|
+
default=None,
|
|
772
|
+
examples=["knowledge.db", "/path/to/memory.db"],
|
|
773
|
+
title="Database path",
|
|
774
|
+
)
|
|
775
|
+
"""SQLite database path for persistent storage, or None for in-memory."""
|
|
776
|
+
|
|
777
|
+
def get_provider(self) -> ResourceProvider:
|
|
778
|
+
"""Create semantic memory tools provider."""
|
|
779
|
+
from agentpool_toolsets.semantic_memory_toolset import SemanticMemoryTools
|
|
780
|
+
|
|
781
|
+
model = m if isinstance(m := self.model, str) or m is None else m.get_model()
|
|
782
|
+
return SemanticMemoryTools(model=model, dbname=self.dbname)
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
class CustomToolsetConfig(BaseToolsetConfig):
|
|
786
|
+
"""Configuration for custom toolsets."""
|
|
787
|
+
|
|
788
|
+
model_config = ConfigDict(
|
|
789
|
+
json_schema_extra={
|
|
790
|
+
"x-icon": "octicon:gear-16",
|
|
791
|
+
"x-doc-title": "Custom Toolset",
|
|
792
|
+
}
|
|
793
|
+
)
|
|
794
|
+
|
|
795
|
+
type: Literal["custom"] = Field("custom", init=False)
|
|
796
|
+
"""Custom toolset."""
|
|
797
|
+
|
|
798
|
+
import_path: str = Field(
|
|
799
|
+
examples=["myapp.toolsets.CustomTools", "external.providers:MyProvider"],
|
|
800
|
+
title="Import path",
|
|
801
|
+
)
|
|
802
|
+
"""Dotted import path to the custom toolset implementation class."""
|
|
803
|
+
|
|
804
|
+
def get_provider(self) -> ResourceProvider:
|
|
805
|
+
"""Create custom provider from import path."""
|
|
806
|
+
from agentpool.resource_providers import ResourceProvider
|
|
807
|
+
from agentpool.utils.importing import import_class
|
|
808
|
+
|
|
809
|
+
provider_cls = import_class(self.import_path)
|
|
810
|
+
if not issubclass(provider_cls, ResourceProvider):
|
|
811
|
+
raise ValueError(f"{self.import_path} must be a ResourceProvider subclass") # noqa: TRY004
|
|
812
|
+
return provider_cls(name=provider_cls.__name__)
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
class CodeModeToolsetConfig(BaseToolsetConfig):
|
|
816
|
+
"""Configuration for code mode tools."""
|
|
817
|
+
|
|
818
|
+
model_config = ConfigDict(
|
|
819
|
+
json_schema_extra={
|
|
820
|
+
"x-icon": "octicon:code-square-16",
|
|
821
|
+
"x-doc-title": "Code Mode Toolset",
|
|
822
|
+
}
|
|
823
|
+
)
|
|
824
|
+
|
|
825
|
+
type: Literal["code_mode"] = Field("code_mode", init=False)
|
|
826
|
+
"""Code mode toolset."""
|
|
827
|
+
|
|
828
|
+
toolsets: list[ToolsetConfig] = Field(title="Wrapped toolsets")
|
|
829
|
+
"""List of toolsets to expose as a codemode toolset."""
|
|
830
|
+
|
|
831
|
+
def get_provider(self) -> ResourceProvider:
|
|
832
|
+
"""Create Codemode toolset."""
|
|
833
|
+
from agentpool.resource_providers.codemode import CodeModeResourceProvider
|
|
834
|
+
|
|
835
|
+
providers = [p.get_provider() for p in self.toolsets]
|
|
836
|
+
return CodeModeResourceProvider(providers=providers)
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
class RemoteCodeModeToolsetConfig(BaseToolsetConfig):
|
|
840
|
+
"""Configuration for code mode tools."""
|
|
841
|
+
|
|
842
|
+
model_config = ConfigDict(
|
|
843
|
+
json_schema_extra={
|
|
844
|
+
"x-icon": "octicon:cloud-offline-16",
|
|
845
|
+
"x-doc-title": "Remote Code Mode Toolset",
|
|
846
|
+
}
|
|
847
|
+
)
|
|
848
|
+
|
|
849
|
+
type: Literal["remote_code_mode"] = Field("remote_code_mode", init=False)
|
|
850
|
+
"""Code mode toolset."""
|
|
851
|
+
|
|
852
|
+
environment: ExecutionEnvironmentConfig = Field(title="Execution environment")
|
|
853
|
+
"""Execution environment configuration."""
|
|
854
|
+
|
|
855
|
+
toolsets: list[ToolsetConfig] = Field(title="Wrapped toolsets")
|
|
856
|
+
"""List of toolsets to expose as a codemode toolset."""
|
|
857
|
+
|
|
858
|
+
def get_provider(self) -> ResourceProvider:
|
|
859
|
+
"""Create Codemode toolset."""
|
|
860
|
+
from agentpool.resource_providers.codemode import RemoteCodeModeResourceProvider
|
|
861
|
+
|
|
862
|
+
providers = [p.get_provider() for p in self.toolsets]
|
|
863
|
+
return RemoteCodeModeResourceProvider(
|
|
864
|
+
providers=providers,
|
|
865
|
+
execution_config=self.environment,
|
|
866
|
+
)
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
class ImportToolsToolsetConfig(BaseToolsetConfig):
|
|
870
|
+
"""Configuration for importing individual functions as tools.
|
|
871
|
+
|
|
872
|
+
Allows adding arbitrary Python callables as agent tools via import paths.
|
|
873
|
+
"""
|
|
874
|
+
|
|
875
|
+
model_config = ConfigDict(
|
|
876
|
+
json_schema_extra={
|
|
877
|
+
"x-icon": "octicon:package-dependencies-16",
|
|
878
|
+
"x-doc-title": "Import Tools Toolset",
|
|
879
|
+
}
|
|
880
|
+
)
|
|
881
|
+
|
|
882
|
+
type: Literal["import_tools"] = Field("import_tools", init=False)
|
|
883
|
+
"""Import tools toolset."""
|
|
884
|
+
|
|
885
|
+
tools: list[ImportToolConfig] = Field(
|
|
886
|
+
title="Tools to import",
|
|
887
|
+
examples=[
|
|
888
|
+
[
|
|
889
|
+
{"import_path": "os.listdir", "name": "list_files"},
|
|
890
|
+
{"import_path": "webbrowser.open", "description": "Open URL in browser"},
|
|
891
|
+
]
|
|
892
|
+
],
|
|
893
|
+
)
|
|
894
|
+
"""List of tool configurations to import."""
|
|
895
|
+
|
|
896
|
+
def get_provider(self) -> ResourceProvider:
|
|
897
|
+
"""Create static provider with imported tools."""
|
|
898
|
+
from agentpool.resource_providers import StaticResourceProvider
|
|
899
|
+
|
|
900
|
+
tools = [tool_config.get_tool() for tool_config in self.tools]
|
|
901
|
+
name = self.namespace or "import_tools"
|
|
902
|
+
return StaticResourceProvider(name=name, tools=tools)
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
class ConfigCreationToolsetConfig(BaseToolsetConfig):
|
|
906
|
+
"""Configuration for config creation with schema validation."""
|
|
907
|
+
|
|
908
|
+
model_config = ConfigDict(
|
|
909
|
+
json_schema_extra={
|
|
910
|
+
"x-icon": "octicon:file-code-16",
|
|
911
|
+
"x-doc-title": "Config Creation Toolset",
|
|
912
|
+
}
|
|
913
|
+
)
|
|
914
|
+
|
|
915
|
+
type: Literal["config_creation"] = Field("config_creation", init=False)
|
|
916
|
+
"""Config creation toolset."""
|
|
917
|
+
|
|
918
|
+
schema_path: UPath = Field(
|
|
919
|
+
examples=["schema/config-schema.json", "https://example.com/schema.json"],
|
|
920
|
+
title="JSON Schema path",
|
|
921
|
+
)
|
|
922
|
+
"""Path or URL to the JSON schema for validation."""
|
|
923
|
+
|
|
924
|
+
markup: MarkupType = Field(default="yaml", title="Markup language")
|
|
925
|
+
"""Markup language for the configuration (yaml, json, toml)."""
|
|
926
|
+
|
|
927
|
+
def get_provider(self) -> ResourceProvider:
|
|
928
|
+
"""Create config creation toolset."""
|
|
929
|
+
from agentpool_toolsets.config_creation import ConfigCreationTools
|
|
930
|
+
|
|
931
|
+
name = self.namespace or "config_creation"
|
|
932
|
+
return ConfigCreationTools(schema_path=self.schema_path, markup=self.markup, name=name)
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
class PlanToolsetConfig(BaseToolsetConfig):
|
|
936
|
+
"""Configuration for plan management toolset.
|
|
937
|
+
|
|
938
|
+
Provides tools for managing agent execution plans and task tracking.
|
|
939
|
+
Agents can create, update, and track progress on plan entries.
|
|
940
|
+
"""
|
|
941
|
+
|
|
942
|
+
model_config = ConfigDict(
|
|
943
|
+
json_schema_extra={
|
|
944
|
+
"x-icon": "octicon:tasklist-16",
|
|
945
|
+
"x-doc-title": "Plan Toolset",
|
|
946
|
+
}
|
|
947
|
+
)
|
|
948
|
+
|
|
949
|
+
type: Literal["plan"] = Field("plan", init=False)
|
|
950
|
+
"""Plan toolset."""
|
|
951
|
+
|
|
952
|
+
tools: dict[PlanToolName, bool] | None = Field(
|
|
953
|
+
default=None,
|
|
954
|
+
title="Tool filter",
|
|
955
|
+
)
|
|
956
|
+
"""Optional tool filter to enable/disable specific tools."""
|
|
957
|
+
|
|
958
|
+
def get_provider(self) -> ResourceProvider:
|
|
959
|
+
"""Create plan tools provider."""
|
|
960
|
+
from agentpool.resource_providers import PlanProvider
|
|
961
|
+
|
|
962
|
+
provider = PlanProvider()
|
|
963
|
+
if self.tools is not None:
|
|
964
|
+
from agentpool.resource_providers import FilteringResourceProvider
|
|
965
|
+
|
|
966
|
+
return FilteringResourceProvider(provider, cast(dict[str, bool], self.tools))
|
|
967
|
+
return provider
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
class DebugToolsetConfig(BaseToolsetConfig):
|
|
971
|
+
"""Configuration for debug/introspection toolset.
|
|
972
|
+
|
|
973
|
+
Provides tools for agent self-inspection and runtime debugging:
|
|
974
|
+
- Code execution with access to runtime context (ctx, run_ctx, me)
|
|
975
|
+
- In-memory log inspection and management
|
|
976
|
+
- Platform path discovery
|
|
977
|
+
- Agent and pool state inspection
|
|
978
|
+
"""
|
|
979
|
+
|
|
980
|
+
model_config = ConfigDict(
|
|
981
|
+
json_schema_extra={
|
|
982
|
+
"x-icon": "octicon:bug-16",
|
|
983
|
+
"x-doc-title": "Debug Toolset",
|
|
984
|
+
}
|
|
985
|
+
)
|
|
986
|
+
|
|
987
|
+
type: Literal["debug"] = Field("debug", init=False)
|
|
988
|
+
"""Debug toolset."""
|
|
989
|
+
|
|
990
|
+
install_log_handler: bool = Field(
|
|
991
|
+
default=True,
|
|
992
|
+
title="Install log handler",
|
|
993
|
+
)
|
|
994
|
+
"""Whether to install the memory log handler for log inspection."""
|
|
995
|
+
|
|
996
|
+
def get_provider(self) -> ResourceProvider:
|
|
997
|
+
"""Create debug tools provider."""
|
|
998
|
+
from agentpool_toolsets.builtin.debug import DebugTools
|
|
999
|
+
|
|
1000
|
+
return DebugTools(
|
|
1001
|
+
name=self.namespace or "debug",
|
|
1002
|
+
install_log_handler=self.install_log_handler,
|
|
1003
|
+
)
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
ToolsetConfig = Annotated[
|
|
1007
|
+
OpenAPIToolsetConfig
|
|
1008
|
+
| EntryPointToolsetConfig
|
|
1009
|
+
| ComposioToolSetConfig
|
|
1010
|
+
| AgentManagementToolsetConfig
|
|
1011
|
+
| ExecutionEnvironmentToolsetConfig
|
|
1012
|
+
| ToolManagementToolsetConfig
|
|
1013
|
+
| UserInteractionToolsetConfig
|
|
1014
|
+
| HistoryToolsetConfig
|
|
1015
|
+
| SkillsToolsetConfig
|
|
1016
|
+
| IntegrationToolsetConfig
|
|
1017
|
+
| CodeToolsetConfig
|
|
1018
|
+
| FSSpecToolsetConfig
|
|
1019
|
+
| VFSToolsetConfig
|
|
1020
|
+
| SubagentToolsetConfig
|
|
1021
|
+
| WorkersToolsetConfig
|
|
1022
|
+
| CodeModeToolsetConfig
|
|
1023
|
+
| RemoteCodeModeToolsetConfig
|
|
1024
|
+
| SearchToolsetConfig
|
|
1025
|
+
| NotificationsToolsetConfig
|
|
1026
|
+
| SemanticMemoryToolsetConfig
|
|
1027
|
+
| ConfigCreationToolsetConfig
|
|
1028
|
+
| ImportToolsToolsetConfig
|
|
1029
|
+
| PlanToolsetConfig
|
|
1030
|
+
| DebugToolsetConfig
|
|
1031
|
+
| CustomToolsetConfig,
|
|
1032
|
+
Field(discriminator="type"),
|
|
1033
|
+
]
|