agentpool 2.1.9__py3-none-any.whl → 2.2.3__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.
- acp/__init__.py +13 -0
- acp/bridge/README.md +15 -2
- acp/bridge/__init__.py +3 -2
- acp/bridge/__main__.py +60 -19
- acp/bridge/ws_server.py +173 -0
- acp/bridge/ws_server_cli.py +89 -0
- acp/notifications.py +2 -1
- acp/stdio.py +39 -9
- acp/transports.py +362 -2
- acp/utils.py +15 -2
- agentpool/__init__.py +4 -1
- agentpool/agents/__init__.py +2 -0
- agentpool/agents/acp_agent/acp_agent.py +203 -88
- agentpool/agents/acp_agent/acp_converters.py +46 -21
- agentpool/agents/acp_agent/client_handler.py +157 -3
- agentpool/agents/acp_agent/session_state.py +4 -1
- agentpool/agents/agent.py +314 -107
- agentpool/agents/agui_agent/__init__.py +0 -2
- agentpool/agents/agui_agent/agui_agent.py +90 -21
- agentpool/agents/agui_agent/agui_converters.py +0 -131
- agentpool/agents/base_agent.py +163 -1
- agentpool/agents/claude_code_agent/claude_code_agent.py +626 -179
- agentpool/agents/claude_code_agent/converters.py +71 -3
- agentpool/agents/claude_code_agent/history.py +474 -0
- agentpool/agents/context.py +40 -0
- agentpool/agents/events/__init__.py +2 -0
- agentpool/agents/events/builtin_handlers.py +2 -1
- agentpool/agents/events/event_emitter.py +29 -2
- agentpool/agents/events/events.py +20 -0
- agentpool/agents/modes.py +54 -0
- agentpool/agents/tool_call_accumulator.py +213 -0
- agentpool/common_types.py +21 -0
- agentpool/config_resources/__init__.py +38 -1
- agentpool/config_resources/claude_code_agent.yml +3 -0
- agentpool/delegation/pool.py +37 -29
- agentpool/delegation/team.py +1 -0
- agentpool/delegation/teamrun.py +1 -0
- agentpool/diagnostics/__init__.py +53 -0
- agentpool/diagnostics/lsp_manager.py +1593 -0
- agentpool/diagnostics/lsp_proxy.py +41 -0
- agentpool/diagnostics/lsp_proxy_script.py +229 -0
- agentpool/diagnostics/models.py +398 -0
- agentpool/mcp_server/__init__.py +0 -2
- agentpool/mcp_server/client.py +12 -3
- agentpool/mcp_server/manager.py +25 -31
- agentpool/mcp_server/registries/official_registry_client.py +25 -0
- agentpool/mcp_server/tool_bridge.py +78 -66
- agentpool/messaging/__init__.py +0 -2
- agentpool/messaging/compaction.py +72 -197
- agentpool/messaging/message_history.py +12 -0
- agentpool/messaging/messages.py +52 -9
- agentpool/messaging/processing.py +3 -1
- agentpool/models/acp_agents/base.py +0 -22
- agentpool/models/acp_agents/mcp_capable.py +8 -148
- agentpool/models/acp_agents/non_mcp.py +129 -72
- agentpool/models/agents.py +35 -13
- agentpool/models/claude_code_agents.py +33 -2
- agentpool/models/manifest.py +43 -0
- agentpool/repomap.py +1 -1
- agentpool/resource_providers/__init__.py +9 -1
- agentpool/resource_providers/aggregating.py +52 -3
- agentpool/resource_providers/base.py +57 -1
- agentpool/resource_providers/mcp_provider.py +23 -0
- agentpool/resource_providers/plan_provider.py +130 -41
- agentpool/resource_providers/pool.py +2 -0
- agentpool/resource_providers/static.py +2 -0
- agentpool/sessions/__init__.py +2 -1
- agentpool/sessions/manager.py +31 -2
- agentpool/sessions/models.py +50 -0
- agentpool/skills/registry.py +13 -8
- agentpool/storage/manager.py +217 -1
- agentpool/testing.py +537 -19
- agentpool/utils/file_watcher.py +269 -0
- agentpool/utils/identifiers.py +121 -0
- agentpool/utils/pydantic_ai_helpers.py +46 -0
- agentpool/utils/streams.py +690 -1
- agentpool/utils/subprocess_utils.py +155 -0
- agentpool/utils/token_breakdown.py +461 -0
- {agentpool-2.1.9.dist-info → agentpool-2.2.3.dist-info}/METADATA +27 -7
- {agentpool-2.1.9.dist-info → agentpool-2.2.3.dist-info}/RECORD +170 -112
- {agentpool-2.1.9.dist-info → agentpool-2.2.3.dist-info}/WHEEL +1 -1
- agentpool_cli/__main__.py +4 -0
- agentpool_cli/serve_acp.py +41 -20
- agentpool_cli/serve_agui.py +87 -0
- agentpool_cli/serve_opencode.py +119 -0
- agentpool_commands/__init__.py +30 -0
- agentpool_commands/agents.py +74 -1
- agentpool_commands/history.py +62 -0
- agentpool_commands/mcp.py +176 -0
- agentpool_commands/models.py +56 -3
- agentpool_commands/tools.py +57 -0
- agentpool_commands/utils.py +51 -0
- agentpool_config/builtin_tools.py +77 -22
- agentpool_config/commands.py +24 -1
- agentpool_config/compaction.py +258 -0
- agentpool_config/mcp_server.py +131 -1
- agentpool_config/storage.py +46 -1
- agentpool_config/tools.py +7 -1
- agentpool_config/toolsets.py +92 -148
- agentpool_server/acp_server/acp_agent.py +134 -150
- agentpool_server/acp_server/commands/acp_commands.py +216 -51
- agentpool_server/acp_server/commands/docs_commands/fetch_repo.py +10 -10
- agentpool_server/acp_server/server.py +23 -79
- agentpool_server/acp_server/session.py +181 -19
- agentpool_server/opencode_server/.rules +95 -0
- agentpool_server/opencode_server/ENDPOINTS.md +362 -0
- agentpool_server/opencode_server/__init__.py +27 -0
- agentpool_server/opencode_server/command_validation.py +172 -0
- agentpool_server/opencode_server/converters.py +869 -0
- agentpool_server/opencode_server/dependencies.py +24 -0
- agentpool_server/opencode_server/input_provider.py +269 -0
- agentpool_server/opencode_server/models/__init__.py +228 -0
- agentpool_server/opencode_server/models/agent.py +53 -0
- agentpool_server/opencode_server/models/app.py +60 -0
- agentpool_server/opencode_server/models/base.py +26 -0
- agentpool_server/opencode_server/models/common.py +23 -0
- agentpool_server/opencode_server/models/config.py +37 -0
- agentpool_server/opencode_server/models/events.py +647 -0
- agentpool_server/opencode_server/models/file.py +88 -0
- agentpool_server/opencode_server/models/mcp.py +25 -0
- agentpool_server/opencode_server/models/message.py +162 -0
- agentpool_server/opencode_server/models/parts.py +190 -0
- agentpool_server/opencode_server/models/provider.py +81 -0
- agentpool_server/opencode_server/models/pty.py +43 -0
- agentpool_server/opencode_server/models/session.py +99 -0
- agentpool_server/opencode_server/routes/__init__.py +25 -0
- agentpool_server/opencode_server/routes/agent_routes.py +442 -0
- agentpool_server/opencode_server/routes/app_routes.py +139 -0
- agentpool_server/opencode_server/routes/config_routes.py +241 -0
- agentpool_server/opencode_server/routes/file_routes.py +392 -0
- agentpool_server/opencode_server/routes/global_routes.py +94 -0
- agentpool_server/opencode_server/routes/lsp_routes.py +319 -0
- agentpool_server/opencode_server/routes/message_routes.py +705 -0
- agentpool_server/opencode_server/routes/pty_routes.py +299 -0
- agentpool_server/opencode_server/routes/session_routes.py +1205 -0
- agentpool_server/opencode_server/routes/tui_routes.py +139 -0
- agentpool_server/opencode_server/server.py +430 -0
- agentpool_server/opencode_server/state.py +121 -0
- agentpool_server/opencode_server/time_utils.py +8 -0
- agentpool_storage/__init__.py +16 -0
- agentpool_storage/base.py +103 -0
- agentpool_storage/claude_provider.py +907 -0
- agentpool_storage/file_provider.py +129 -0
- agentpool_storage/memory_provider.py +61 -0
- agentpool_storage/models.py +3 -0
- agentpool_storage/opencode_provider.py +730 -0
- agentpool_storage/project_store.py +325 -0
- agentpool_storage/session_store.py +6 -0
- agentpool_storage/sql_provider/__init__.py +4 -2
- agentpool_storage/sql_provider/models.py +48 -0
- agentpool_storage/sql_provider/sql_provider.py +134 -1
- agentpool_storage/sql_provider/utils.py +10 -1
- agentpool_storage/text_log_provider.py +1 -0
- agentpool_toolsets/builtin/__init__.py +0 -8
- agentpool_toolsets/builtin/code.py +95 -56
- agentpool_toolsets/builtin/debug.py +16 -21
- agentpool_toolsets/builtin/execution_environment.py +99 -103
- agentpool_toolsets/builtin/file_edit/file_edit.py +115 -7
- agentpool_toolsets/builtin/skills.py +86 -4
- agentpool_toolsets/fsspec_toolset/__init__.py +13 -1
- agentpool_toolsets/fsspec_toolset/diagnostics.py +860 -73
- agentpool_toolsets/fsspec_toolset/grep.py +74 -2
- agentpool_toolsets/fsspec_toolset/image_utils.py +161 -0
- agentpool_toolsets/fsspec_toolset/toolset.py +159 -38
- agentpool_toolsets/mcp_discovery/__init__.py +5 -0
- agentpool_toolsets/mcp_discovery/data/mcp_servers.parquet +0 -0
- agentpool_toolsets/mcp_discovery/toolset.py +454 -0
- agentpool_toolsets/mcp_run_toolset.py +84 -6
- agentpool_toolsets/builtin/agent_management.py +0 -239
- agentpool_toolsets/builtin/history.py +0 -36
- agentpool_toolsets/builtin/integration.py +0 -85
- agentpool_toolsets/builtin/tool_management.py +0 -90
- {agentpool-2.1.9.dist-info → agentpool-2.2.3.dist-info}/entry_points.txt +0 -0
- {agentpool-2.1.9.dist-info → agentpool-2.2.3.dist-info}/licenses/LICENSE +0 -0
agentpool_config/toolsets.py
CHANGED
|
@@ -33,12 +33,6 @@ if TYPE_CHECKING:
|
|
|
33
33
|
|
|
34
34
|
MarkupType = Literal["yaml", "json", "toml"]
|
|
35
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
36
|
SubagentToolName = Literal[
|
|
43
37
|
"list_available_nodes",
|
|
44
38
|
"delegate_to",
|
|
@@ -46,7 +40,7 @@ SubagentToolName = Literal[
|
|
|
46
40
|
]
|
|
47
41
|
ExecutionEnvironmentToolName = Literal[
|
|
48
42
|
"execute_code",
|
|
49
|
-
"
|
|
43
|
+
"bash",
|
|
50
44
|
"start_process",
|
|
51
45
|
"get_process_output",
|
|
52
46
|
"wait_for_process",
|
|
@@ -55,13 +49,11 @@ ExecutionEnvironmentToolName = Literal[
|
|
|
55
49
|
"list_processes",
|
|
56
50
|
]
|
|
57
51
|
|
|
58
|
-
ToolManagementToolName = Literal["register_tool", "register_code_tool"]
|
|
59
52
|
UserInteractionToolName = Literal["ask_user",]
|
|
60
|
-
HistoryToolName = Literal["search_history", "show_statistics"]
|
|
61
53
|
SkillsToolName = Literal["load_skill", "list_skills"]
|
|
62
|
-
IntegrationToolName = Literal["add_local_mcp_server", "add_remote_mcp_server"]
|
|
63
54
|
CodeToolName = Literal["format_code", "ast_grep"]
|
|
64
55
|
PlanToolName = Literal["get_plan", "add_plan_entry", "update_plan_entry", "remove_plan_entry"]
|
|
56
|
+
PlanToolMode = Literal["granular", "declarative", "hybrid"]
|
|
65
57
|
|
|
66
58
|
|
|
67
59
|
class BaseToolsetConfig(Schema):
|
|
@@ -176,37 +168,6 @@ class ComposioToolSetConfig(BaseToolsetConfig):
|
|
|
176
168
|
return ComposioTools(user_id=self.user_id, toolsets=self.toolsets, api_key=key)
|
|
177
169
|
|
|
178
170
|
|
|
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
171
|
class SubagentToolsetConfig(BaseToolsetConfig):
|
|
211
172
|
"""Configuration for subagent interaction tools."""
|
|
212
173
|
|
|
@@ -312,37 +273,6 @@ class ExecutionEnvironmentToolsetConfig(BaseToolsetConfig):
|
|
|
312
273
|
return provider
|
|
313
274
|
|
|
314
275
|
|
|
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
276
|
class UserInteractionToolsetConfig(BaseToolsetConfig):
|
|
347
277
|
"""Configuration for user interaction toolset."""
|
|
348
278
|
|
|
@@ -374,37 +304,6 @@ class UserInteractionToolsetConfig(BaseToolsetConfig):
|
|
|
374
304
|
return provider
|
|
375
305
|
|
|
376
306
|
|
|
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
307
|
class SkillsToolsetConfig(BaseToolsetConfig):
|
|
409
308
|
"""Configuration for skills toolset.
|
|
410
309
|
|
|
@@ -441,37 +340,6 @@ class SkillsToolsetConfig(BaseToolsetConfig):
|
|
|
441
340
|
return provider
|
|
442
341
|
|
|
443
342
|
|
|
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
343
|
class CodeToolsetConfig(BaseToolsetConfig):
|
|
476
344
|
"""Configuration for code toolset."""
|
|
477
345
|
|
|
@@ -607,6 +475,32 @@ class FSSpecToolsetConfig(BaseToolsetConfig):
|
|
|
607
475
|
)
|
|
608
476
|
"""Maximum tokens for structure map output when reading large files."""
|
|
609
477
|
|
|
478
|
+
edit_tool: Literal["simple", "batch", "agentic"] = Field(
|
|
479
|
+
default="simple",
|
|
480
|
+
title="Edit tool variant",
|
|
481
|
+
)
|
|
482
|
+
"""Which edit tool to expose: "simple" (single replacement),
|
|
483
|
+
"batch" (multiple replacements), or "agentic" (LLM-driven editing)."""
|
|
484
|
+
|
|
485
|
+
max_image_size: int | None = Field(
|
|
486
|
+
default=2000,
|
|
487
|
+
ge=100,
|
|
488
|
+
le=8192,
|
|
489
|
+
title="Maximum image dimension",
|
|
490
|
+
)
|
|
491
|
+
"""Max width/height for images in pixels. Larger images are auto-resized
|
|
492
|
+
for better model compatibility. Set to None to disable resizing."""
|
|
493
|
+
|
|
494
|
+
max_image_bytes: int | None = Field(
|
|
495
|
+
default=None,
|
|
496
|
+
ge=102400,
|
|
497
|
+
le=20971520,
|
|
498
|
+
title="Maximum image file size",
|
|
499
|
+
)
|
|
500
|
+
"""Max file size for images in bytes. Images exceeding this are compressed
|
|
501
|
+
using progressive quality/dimension reduction. Default: 4.5MB (Anthropic limit).
|
|
502
|
+
Set to None to use the default 4.5MB limit."""
|
|
503
|
+
|
|
610
504
|
def get_provider(self) -> ResourceProvider:
|
|
611
505
|
"""Create FSSpec filesystem tools provider."""
|
|
612
506
|
import fsspec
|
|
@@ -641,6 +535,9 @@ class FSSpecToolsetConfig(BaseToolsetConfig):
|
|
|
641
535
|
enable_diagnostics=self.enable_diagnostics,
|
|
642
536
|
large_file_tokens=self.large_file_tokens,
|
|
643
537
|
map_max_tokens=self.map_max_tokens,
|
|
538
|
+
edit_tool=self.edit_tool,
|
|
539
|
+
max_image_size=self.max_image_size,
|
|
540
|
+
max_image_bytes=self.max_image_bytes,
|
|
644
541
|
)
|
|
645
542
|
|
|
646
543
|
|
|
@@ -949,6 +846,16 @@ class PlanToolsetConfig(BaseToolsetConfig):
|
|
|
949
846
|
type: Literal["plan"] = Field("plan", init=False)
|
|
950
847
|
"""Plan toolset."""
|
|
951
848
|
|
|
849
|
+
mode: PlanToolMode = Field(
|
|
850
|
+
default="granular",
|
|
851
|
+
title="Plan tool mode",
|
|
852
|
+
)
|
|
853
|
+
"""Tool mode:
|
|
854
|
+
- 'granular': Separate tools (get/add/update/remove) - better for simpler models
|
|
855
|
+
- 'declarative': Single set_plan tool with full list - fewer calls, suits capable models
|
|
856
|
+
- 'hybrid': Both approaches available - model chooses most efficient per situation
|
|
857
|
+
"""
|
|
858
|
+
|
|
952
859
|
tools: dict[PlanToolName, bool] | None = Field(
|
|
953
860
|
default=None,
|
|
954
861
|
title="Tool filter",
|
|
@@ -959,7 +866,7 @@ class PlanToolsetConfig(BaseToolsetConfig):
|
|
|
959
866
|
"""Create plan tools provider."""
|
|
960
867
|
from agentpool.resource_providers import PlanProvider
|
|
961
868
|
|
|
962
|
-
provider = PlanProvider()
|
|
869
|
+
provider = PlanProvider(mode=self.mode)
|
|
963
870
|
if self.tools is not None:
|
|
964
871
|
from agentpool.resource_providers import FilteringResourceProvider
|
|
965
872
|
|
|
@@ -987,19 +894,59 @@ class DebugToolsetConfig(BaseToolsetConfig):
|
|
|
987
894
|
type: Literal["debug"] = Field("debug", init=False)
|
|
988
895
|
"""Debug toolset."""
|
|
989
896
|
|
|
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
897
|
def get_provider(self) -> ResourceProvider:
|
|
997
898
|
"""Create debug tools provider."""
|
|
998
899
|
from agentpool_toolsets.builtin.debug import DebugTools
|
|
999
900
|
|
|
1000
|
-
return DebugTools(
|
|
1001
|
-
|
|
1002
|
-
|
|
901
|
+
return DebugTools(name=self.namespace or "debug")
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
class MCPDiscoveryToolsetConfig(BaseToolsetConfig):
|
|
905
|
+
"""Configuration for MCP discovery toolset.
|
|
906
|
+
|
|
907
|
+
Enables dynamic discovery and use of MCP servers without preloading tools.
|
|
908
|
+
Uses semantic search over 1000+ indexed servers for intelligent matching.
|
|
909
|
+
|
|
910
|
+
Requires the `mcp-discovery` extra: `pip install agentpool[mcp-discovery]`
|
|
911
|
+
"""
|
|
912
|
+
|
|
913
|
+
model_config = ConfigDict(
|
|
914
|
+
json_schema_extra={
|
|
915
|
+
"x-icon": "octicon:search-16",
|
|
916
|
+
"x-doc-title": "MCP Discovery Toolset",
|
|
917
|
+
}
|
|
918
|
+
)
|
|
919
|
+
|
|
920
|
+
type: Literal["mcp_discovery"] = Field("mcp_discovery", init=False)
|
|
921
|
+
"""MCP discovery toolset."""
|
|
922
|
+
|
|
923
|
+
registry_url: str = Field(
|
|
924
|
+
default="https://registry.modelcontextprotocol.io",
|
|
925
|
+
title="Registry URL",
|
|
926
|
+
)
|
|
927
|
+
"""Base URL for the MCP registry API."""
|
|
928
|
+
|
|
929
|
+
allowed_servers: list[str] | None = Field(
|
|
930
|
+
default=None,
|
|
931
|
+
title="Allowed servers",
|
|
932
|
+
)
|
|
933
|
+
"""If set, only these server names can be used."""
|
|
934
|
+
|
|
935
|
+
blocked_servers: list[str] | None = Field(
|
|
936
|
+
default=None,
|
|
937
|
+
title="Blocked servers",
|
|
938
|
+
)
|
|
939
|
+
"""Server names that cannot be used."""
|
|
940
|
+
|
|
941
|
+
def get_provider(self) -> ResourceProvider:
|
|
942
|
+
"""Create MCP discovery tools provider."""
|
|
943
|
+
from agentpool_toolsets.mcp_discovery.toolset import MCPDiscoveryToolset
|
|
944
|
+
|
|
945
|
+
return MCPDiscoveryToolset(
|
|
946
|
+
name=self.namespace or "mcp_discovery",
|
|
947
|
+
registry_url=self.registry_url,
|
|
948
|
+
allowed_servers=self.allowed_servers,
|
|
949
|
+
blocked_servers=self.blocked_servers,
|
|
1003
950
|
)
|
|
1004
951
|
|
|
1005
952
|
|
|
@@ -1007,13 +954,9 @@ ToolsetConfig = Annotated[
|
|
|
1007
954
|
OpenAPIToolsetConfig
|
|
1008
955
|
| EntryPointToolsetConfig
|
|
1009
956
|
| ComposioToolSetConfig
|
|
1010
|
-
| AgentManagementToolsetConfig
|
|
1011
957
|
| ExecutionEnvironmentToolsetConfig
|
|
1012
|
-
| ToolManagementToolsetConfig
|
|
1013
958
|
| UserInteractionToolsetConfig
|
|
1014
|
-
| HistoryToolsetConfig
|
|
1015
959
|
| SkillsToolsetConfig
|
|
1016
|
-
| IntegrationToolsetConfig
|
|
1017
960
|
| CodeToolsetConfig
|
|
1018
961
|
| FSSpecToolsetConfig
|
|
1019
962
|
| VFSToolsetConfig
|
|
@@ -1028,6 +971,7 @@ ToolsetConfig = Annotated[
|
|
|
1028
971
|
| ImportToolsToolsetConfig
|
|
1029
972
|
| PlanToolsetConfig
|
|
1030
973
|
| DebugToolsetConfig
|
|
974
|
+
| MCPDiscoveryToolsetConfig
|
|
1031
975
|
| CustomToolsetConfig,
|
|
1032
976
|
Field(discriminator="type"),
|
|
1033
977
|
]
|