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
acp/agent/connection.py
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"""Agent ACP Connection."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from functools import partial
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Self
|
|
7
|
+
|
|
8
|
+
import logfire
|
|
9
|
+
|
|
10
|
+
from acp.agent.protocol import Agent
|
|
11
|
+
from acp.client.protocol import Client
|
|
12
|
+
from acp.connection import Connection
|
|
13
|
+
from acp.exceptions import RequestError
|
|
14
|
+
from acp.schema import (
|
|
15
|
+
AuthenticateRequest,
|
|
16
|
+
CancelNotification,
|
|
17
|
+
CreateTerminalRequest,
|
|
18
|
+
CreateTerminalResponse,
|
|
19
|
+
InitializeRequest,
|
|
20
|
+
KillTerminalCommandRequest,
|
|
21
|
+
KillTerminalCommandResponse,
|
|
22
|
+
ListSessionsRequest,
|
|
23
|
+
LoadSessionRequest,
|
|
24
|
+
NewSessionRequest,
|
|
25
|
+
PromptRequest,
|
|
26
|
+
ReadTextFileRequest,
|
|
27
|
+
ReadTextFileResponse,
|
|
28
|
+
ReleaseTerminalRequest,
|
|
29
|
+
ReleaseTerminalResponse,
|
|
30
|
+
RequestPermissionRequest,
|
|
31
|
+
RequestPermissionResponse,
|
|
32
|
+
SessionNotification,
|
|
33
|
+
SetSessionModelRequest,
|
|
34
|
+
SetSessionModeRequest,
|
|
35
|
+
TerminalOutputRequest,
|
|
36
|
+
TerminalOutputResponse,
|
|
37
|
+
WaitForTerminalExitRequest,
|
|
38
|
+
WaitForTerminalExitResponse,
|
|
39
|
+
WriteTextFileRequest,
|
|
40
|
+
WriteTextFileResponse,
|
|
41
|
+
)
|
|
42
|
+
from acp.task import DebuggingMessageStateStore
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
if TYPE_CHECKING:
|
|
46
|
+
from collections.abc import Callable
|
|
47
|
+
|
|
48
|
+
from anyio.abc import ByteReceiveStream, ByteSendStream
|
|
49
|
+
|
|
50
|
+
from acp.agent.protocol import Agent
|
|
51
|
+
from acp.connection import StreamObserver
|
|
52
|
+
from acp.schema import (
|
|
53
|
+
AgentMethod,
|
|
54
|
+
CreateTerminalRequest,
|
|
55
|
+
InitializeResponse,
|
|
56
|
+
KillTerminalCommandRequest,
|
|
57
|
+
ListSessionsResponse,
|
|
58
|
+
LoadSessionResponse,
|
|
59
|
+
NewSessionResponse,
|
|
60
|
+
PromptResponse,
|
|
61
|
+
ReadTextFileRequest,
|
|
62
|
+
ReleaseTerminalRequest,
|
|
63
|
+
RequestPermissionRequest,
|
|
64
|
+
SessionNotification,
|
|
65
|
+
TerminalOutputRequest,
|
|
66
|
+
WaitForTerminalExitRequest,
|
|
67
|
+
WriteTextFileRequest,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class AgentSideConnection(Client):
|
|
72
|
+
"""Agent-side connection.
|
|
73
|
+
|
|
74
|
+
Use when you implement the Agent and need to talk to a Client.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
to_agent: factory that receives this connection and returns your Agent
|
|
78
|
+
input: ByteSendStream (local -> peer)
|
|
79
|
+
output: ByteReceiveStream (peer -> local)
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
def __init__(
|
|
83
|
+
self,
|
|
84
|
+
to_agent: Callable[[AgentSideConnection], Agent],
|
|
85
|
+
input_stream: ByteSendStream,
|
|
86
|
+
output_stream: ByteReceiveStream,
|
|
87
|
+
observers: list[StreamObserver] | None = None,
|
|
88
|
+
*,
|
|
89
|
+
debug_file: str | None = None,
|
|
90
|
+
) -> None:
|
|
91
|
+
"""Initialize the agent-side connection.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
to_agent: factory that receives this connection and returns your Agent
|
|
95
|
+
input_stream: ByteSendStream (local -> peer)
|
|
96
|
+
output_stream: ByteReceiveStream (peer -> local)
|
|
97
|
+
observers: list of StreamObserver instances to observe the connection
|
|
98
|
+
debug_file: path to a file to write debug information to
|
|
99
|
+
"""
|
|
100
|
+
agent = to_agent(self)
|
|
101
|
+
handler = partial(_agent_handler, agent)
|
|
102
|
+
store = DebuggingMessageStateStore(debug_file=debug_file) if debug_file else None
|
|
103
|
+
self._conn = Connection(
|
|
104
|
+
handler,
|
|
105
|
+
input_stream,
|
|
106
|
+
output_stream,
|
|
107
|
+
state_store=store,
|
|
108
|
+
observers=observers,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
# client-bound methods (agent -> client)
|
|
112
|
+
async def session_update(self, params: SessionNotification) -> None:
|
|
113
|
+
"""Send session update notification."""
|
|
114
|
+
dct = params.model_dump(by_alias=True, exclude_none=True)
|
|
115
|
+
await self._conn.send_notification("session/update", dct)
|
|
116
|
+
|
|
117
|
+
async def request_permission(
|
|
118
|
+
self, params: RequestPermissionRequest
|
|
119
|
+
) -> RequestPermissionResponse:
|
|
120
|
+
"""Request permission from the client."""
|
|
121
|
+
dct = params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True)
|
|
122
|
+
method = "session/request_permission"
|
|
123
|
+
resp = await self._conn.send_request(method, dct)
|
|
124
|
+
return RequestPermissionResponse.model_validate(resp)
|
|
125
|
+
|
|
126
|
+
async def read_text_file(self, params: ReadTextFileRequest) -> ReadTextFileResponse:
|
|
127
|
+
"""Read text file from the client."""
|
|
128
|
+
dct = params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True)
|
|
129
|
+
resp = await self._conn.send_request("fs/read_text_file", dct)
|
|
130
|
+
return ReadTextFileResponse.model_validate(resp)
|
|
131
|
+
|
|
132
|
+
async def write_text_file(self, params: WriteTextFileRequest) -> WriteTextFileResponse:
|
|
133
|
+
"""Write text file to the client."""
|
|
134
|
+
dct = params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True)
|
|
135
|
+
r = await self._conn.send_request("fs/write_text_file", dct)
|
|
136
|
+
return WriteTextFileResponse.model_validate(r)
|
|
137
|
+
|
|
138
|
+
# async def createTerminal(self, params: CreateTerminalRequest) -> TerminalHandle:
|
|
139
|
+
async def create_terminal(self, params: CreateTerminalRequest) -> CreateTerminalResponse:
|
|
140
|
+
"""Create a terminal on the client."""
|
|
141
|
+
dct = params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True)
|
|
142
|
+
resp = await self._conn.send_request("terminal/create", dct)
|
|
143
|
+
# resp = CreateTerminalResponse.model_validate(resp)
|
|
144
|
+
# return TerminalHandle(resp.terminal_id, params.session_id, self._conn)
|
|
145
|
+
return CreateTerminalResponse.model_validate(resp)
|
|
146
|
+
|
|
147
|
+
async def ext_method(self, method: str, params: dict[str, Any]) -> dict[str, Any]:
|
|
148
|
+
"""Call an extension method on the client."""
|
|
149
|
+
return await self._conn.send_request(f"_{method}", params) # type: ignore[no-any-return]
|
|
150
|
+
|
|
151
|
+
async def ext_notification(self, method: str, params: dict[str, Any]) -> None:
|
|
152
|
+
"""Send an extension notification to the client."""
|
|
153
|
+
await self._conn.send_notification(f"_{method}", params)
|
|
154
|
+
|
|
155
|
+
async def terminal_output(self, params: TerminalOutputRequest) -> TerminalOutputResponse:
|
|
156
|
+
"""Show terminal output on the client."""
|
|
157
|
+
dct = params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True)
|
|
158
|
+
resp = await self._conn.send_request("terminal/output", dct)
|
|
159
|
+
return TerminalOutputResponse.model_validate(resp)
|
|
160
|
+
|
|
161
|
+
async def release_terminal(self, params: ReleaseTerminalRequest) -> ReleaseTerminalResponse:
|
|
162
|
+
"""Release a terminal on the client."""
|
|
163
|
+
dct = params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True)
|
|
164
|
+
resp = await self._conn.send_request("terminal/release", dct)
|
|
165
|
+
return ReleaseTerminalResponse.model_validate(resp)
|
|
166
|
+
|
|
167
|
+
async def wait_for_terminal_exit(
|
|
168
|
+
self, params: WaitForTerminalExitRequest
|
|
169
|
+
) -> WaitForTerminalExitResponse:
|
|
170
|
+
"""Wait for a terminal to exit on the client."""
|
|
171
|
+
dct = params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True)
|
|
172
|
+
resp = await self._conn.send_request("terminal/wait_for_exit", dct)
|
|
173
|
+
return WaitForTerminalExitResponse.model_validate(resp)
|
|
174
|
+
|
|
175
|
+
async def kill_terminal(
|
|
176
|
+
self, params: KillTerminalCommandRequest
|
|
177
|
+
) -> KillTerminalCommandResponse:
|
|
178
|
+
"""Kill a terminal on the client."""
|
|
179
|
+
dct = params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True)
|
|
180
|
+
resp = await self._conn.send_request("terminal/kill", dct)
|
|
181
|
+
return KillTerminalCommandResponse.model_validate(resp)
|
|
182
|
+
|
|
183
|
+
async def close(self) -> None:
|
|
184
|
+
"""Close the connection."""
|
|
185
|
+
await self._conn.close()
|
|
186
|
+
|
|
187
|
+
async def __aenter__(self) -> Self:
|
|
188
|
+
"""Enter the async context."""
|
|
189
|
+
return self
|
|
190
|
+
|
|
191
|
+
async def __aexit__(self, *args: object) -> None:
|
|
192
|
+
"""Exit the async context (close the connection)."""
|
|
193
|
+
await self.close()
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
@logfire.instrument(r"Handle Agent Request {method}")
|
|
197
|
+
async def _agent_handler( # noqa: PLR0911
|
|
198
|
+
agent: Agent,
|
|
199
|
+
method: AgentMethod | str,
|
|
200
|
+
params: dict[str, Any] | None,
|
|
201
|
+
is_notification: bool,
|
|
202
|
+
) -> (
|
|
203
|
+
NewSessionResponse
|
|
204
|
+
| InitializeResponse
|
|
205
|
+
| PromptResponse
|
|
206
|
+
| LoadSessionResponse
|
|
207
|
+
| ListSessionsResponse
|
|
208
|
+
| dict[str, Any]
|
|
209
|
+
| None
|
|
210
|
+
):
|
|
211
|
+
"""Handle an agent request."""
|
|
212
|
+
match method:
|
|
213
|
+
case "initialize":
|
|
214
|
+
initialize_request = InitializeRequest.model_validate(params)
|
|
215
|
+
return await agent.initialize(initialize_request)
|
|
216
|
+
case "session/new":
|
|
217
|
+
new_session_request = NewSessionRequest.model_validate(params)
|
|
218
|
+
return await agent.new_session(new_session_request)
|
|
219
|
+
case "session/load":
|
|
220
|
+
load_request = LoadSessionRequest.model_validate(params)
|
|
221
|
+
return await agent.load_session(load_request)
|
|
222
|
+
case "session/list":
|
|
223
|
+
list_request = ListSessionsRequest.model_validate(params)
|
|
224
|
+
return await agent.list_sessions(list_request)
|
|
225
|
+
case "session/set_mode":
|
|
226
|
+
set_mode_request = SetSessionModeRequest.model_validate(params)
|
|
227
|
+
return (
|
|
228
|
+
session_resp.model_dump(by_alias=True, exclude_none=True)
|
|
229
|
+
if (session_resp := await agent.set_session_mode(set_mode_request))
|
|
230
|
+
else {}
|
|
231
|
+
)
|
|
232
|
+
case "session/prompt":
|
|
233
|
+
prompt_request = PromptRequest.model_validate(params)
|
|
234
|
+
return await agent.prompt(prompt_request)
|
|
235
|
+
case "session/cancel":
|
|
236
|
+
cancel_notification = CancelNotification.model_validate(params)
|
|
237
|
+
await agent.cancel(cancel_notification)
|
|
238
|
+
return None
|
|
239
|
+
case "session/set_model":
|
|
240
|
+
set_model_request = SetSessionModelRequest.model_validate(params)
|
|
241
|
+
return (
|
|
242
|
+
model_result.model_dump(by_alias=True, exclude_none=True)
|
|
243
|
+
if (model_result := await agent.set_session_model(set_model_request))
|
|
244
|
+
else {}
|
|
245
|
+
)
|
|
246
|
+
case "authenticate":
|
|
247
|
+
p = AuthenticateRequest.model_validate(params)
|
|
248
|
+
result = await agent.authenticate(p)
|
|
249
|
+
return result.model_dump(by_alias=True, exclude_none=True) if result else {}
|
|
250
|
+
case str() if method.startswith("_") and is_notification:
|
|
251
|
+
await agent.ext_notification(method[1:], params or {})
|
|
252
|
+
return None
|
|
253
|
+
case str() if method.startswith("_"):
|
|
254
|
+
return await agent.ext_method(method[1:], params or {})
|
|
255
|
+
case _:
|
|
256
|
+
raise RequestError.method_not_found(method)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""ACP Debug Server."""
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""CLI for ACP Debug Server.
|
|
2
|
+
|
|
3
|
+
Simple command-line interface for the ACP debug server that combines
|
|
4
|
+
ACP protocol server with FastAPI web interface for testing.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import argparse
|
|
8
|
+
import logging
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
import anyio
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def main() -> None:
|
|
15
|
+
"""Main CLI entry point."""
|
|
16
|
+
parser = argparse.ArgumentParser(
|
|
17
|
+
description="ACP Debug Server - Combined ACP + FastAPI testing server",
|
|
18
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
19
|
+
epilog="""
|
|
20
|
+
Examples:
|
|
21
|
+
# Run with defaults (ACP on stdio, web UI on localhost:8000)
|
|
22
|
+
python -m acp.cli
|
|
23
|
+
|
|
24
|
+
# Custom port for web interface
|
|
25
|
+
python -m acp.cli --port 9000
|
|
26
|
+
|
|
27
|
+
# Custom host and port
|
|
28
|
+
python -m acp.cli --host 0.0.0.0 --port 8080
|
|
29
|
+
|
|
30
|
+
# Test ACP connection
|
|
31
|
+
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":1},"id":1}' | python -m acp
|
|
32
|
+
|
|
33
|
+
# Open web interface at http://localhost:8000 to manually send notifications
|
|
34
|
+
""", # noqa: E501
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"--port",
|
|
39
|
+
type=int,
|
|
40
|
+
default=7777,
|
|
41
|
+
help="Port for FastAPI web interface (default: 8000)",
|
|
42
|
+
)
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
"--host",
|
|
45
|
+
default="127.0.0.1",
|
|
46
|
+
help="Host for FastAPI web interface (default: 127.0.0.1)",
|
|
47
|
+
)
|
|
48
|
+
parser.add_argument(
|
|
49
|
+
"--log-level",
|
|
50
|
+
choices=["debug", "info", "warning", "error"],
|
|
51
|
+
default="info",
|
|
52
|
+
help="Logging level (default: info)",
|
|
53
|
+
)
|
|
54
|
+
from acp.agent.implementations.debug_server.debug_server import ACPDebugServer
|
|
55
|
+
|
|
56
|
+
args = parser.parse_args()
|
|
57
|
+
|
|
58
|
+
# Configure logging
|
|
59
|
+
level = getattr(logging, args.log_level.upper())
|
|
60
|
+
logging.basicConfig(
|
|
61
|
+
level=level,
|
|
62
|
+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
63
|
+
handlers=[logging.StreamHandler(sys.stderr)],
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Create and run debug server
|
|
67
|
+
server = ACPDebugServer(fastapi_port=args.port, fastapi_host=args.host)
|
|
68
|
+
|
|
69
|
+
try:
|
|
70
|
+
anyio.run(server.run)
|
|
71
|
+
except KeyboardInterrupt:
|
|
72
|
+
print("\nDebug server interrupted", file=sys.stderr)
|
|
73
|
+
except Exception as e: # noqa: BLE001
|
|
74
|
+
print(f"Debug server error: {e}", file=sys.stderr)
|
|
75
|
+
sys.exit(1)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if __name__ == "__main__":
|
|
79
|
+
main()
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>ACP Debug Server</title>
|
|
5
|
+
<style>
|
|
6
|
+
body {
|
|
7
|
+
font-family: Arial, sans-serif;
|
|
8
|
+
margin: 20px;
|
|
9
|
+
}
|
|
10
|
+
.container {
|
|
11
|
+
max-width: 1200px;
|
|
12
|
+
margin: 0 auto;
|
|
13
|
+
}
|
|
14
|
+
.section {
|
|
15
|
+
margin: 20px 0;
|
|
16
|
+
padding: 15px;
|
|
17
|
+
border: 1px solid #ddd;
|
|
18
|
+
border-radius: 5px;
|
|
19
|
+
}
|
|
20
|
+
.form-group {
|
|
21
|
+
margin: 10px 0;
|
|
22
|
+
}
|
|
23
|
+
label {
|
|
24
|
+
display: block;
|
|
25
|
+
margin-bottom: 5px;
|
|
26
|
+
}
|
|
27
|
+
input,
|
|
28
|
+
select,
|
|
29
|
+
textarea {
|
|
30
|
+
width: 100%;
|
|
31
|
+
padding: 5px;
|
|
32
|
+
}
|
|
33
|
+
button {
|
|
34
|
+
padding: 10px 20px;
|
|
35
|
+
margin: 5px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
.status {
|
|
39
|
+
background: #f0f8ff;
|
|
40
|
+
}
|
|
41
|
+
.notifications {
|
|
42
|
+
background: #f8f8f0;
|
|
43
|
+
}
|
|
44
|
+
.response {
|
|
45
|
+
background: #f0f0f0;
|
|
46
|
+
margin-top: 10px;
|
|
47
|
+
padding: 10px;
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
50
|
+
</head>
|
|
51
|
+
<body>
|
|
52
|
+
<div class="container">
|
|
53
|
+
<h1>🐛 ACP Debug Server</h1>
|
|
54
|
+
|
|
55
|
+
<div class="section status">
|
|
56
|
+
<h2>Status</h2>
|
|
57
|
+
<div id="status">Loading...</div>
|
|
58
|
+
<button onclick="refreshStatus()">Refresh Status</button>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div class="section notifications">
|
|
62
|
+
<h2>Send Notifications</h2>
|
|
63
|
+
<div class="form-group">
|
|
64
|
+
<label>Session ID:</label>
|
|
65
|
+
<input type="text" id="sessionId" placeholder="Enter session ID" />
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="form-group">
|
|
69
|
+
<label>Notification Type:</label>
|
|
70
|
+
<select id="notificationType" onchange="updateForm()">
|
|
71
|
+
<option value="agent_message">Agent Message</option>
|
|
72
|
+
<option value="user_message">User Message</option>
|
|
73
|
+
<option value="agent_thought">Agent Thought</option>
|
|
74
|
+
<option value="tool_call_start">Tool Call Start</option>
|
|
75
|
+
<option value="tool_call_progress">Tool Call Progress</option>
|
|
76
|
+
<option value="plan_update">Plan Update</option>
|
|
77
|
+
<option value="commands_update">Commands Update</option>
|
|
78
|
+
<option value="mode_update">Mode Update</option>
|
|
79
|
+
</select>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div id="dynamicForm"></div>
|
|
83
|
+
|
|
84
|
+
<button onclick="sendNotification()">Send Notification</button>
|
|
85
|
+
<div id="response" class="response" style="display: none"></div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<script>
|
|
90
|
+
async function refreshStatus() {
|
|
91
|
+
try {
|
|
92
|
+
const response = await fetch("/status");
|
|
93
|
+
const status = await response.json();
|
|
94
|
+
document.getElementById("status").innerHTML = `
|
|
95
|
+
<strong>Sessions:</strong> ${status.active_sessions.join(", ") || "None"}<br>
|
|
96
|
+
<strong>Current Session:</strong> ${status.current_session || "None"}<br>
|
|
97
|
+
<strong>Notifications Sent:</strong> ${status.notifications_sent}<br>
|
|
98
|
+
<strong>ACP Connected:</strong> ${status.acp_connected ? "Yes" : "No"}
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
// Auto-fill session ID if available
|
|
102
|
+
if (
|
|
103
|
+
status.current_session &&
|
|
104
|
+
!document.getElementById("sessionId").value
|
|
105
|
+
) {
|
|
106
|
+
document.getElementById("sessionId").value =
|
|
107
|
+
status.current_session;
|
|
108
|
+
}
|
|
109
|
+
} catch (e) {
|
|
110
|
+
document.getElementById("status").innerHTML = "Error loading status";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function updateForm() {
|
|
115
|
+
const type = document.getElementById("notificationType").value;
|
|
116
|
+
const form = document.getElementById("dynamicForm");
|
|
117
|
+
|
|
118
|
+
switch (type) {
|
|
119
|
+
case "agent_message":
|
|
120
|
+
case "user_message":
|
|
121
|
+
case "agent_thought":
|
|
122
|
+
form.innerHTML = `
|
|
123
|
+
<div class="form-group">
|
|
124
|
+
<label>Text Content:</label>
|
|
125
|
+
<textarea id="text" rows="3" placeholder="Enter message text"></textarea>
|
|
126
|
+
</div>
|
|
127
|
+
`;
|
|
128
|
+
break;
|
|
129
|
+
case "tool_call_start":
|
|
130
|
+
form.innerHTML = `
|
|
131
|
+
<div class="form-group">
|
|
132
|
+
<label>Tool Call ID:</label>
|
|
133
|
+
<input type="text" id="toolCallId" placeholder="tool-call-123">
|
|
134
|
+
</div>
|
|
135
|
+
<div class="form-group">
|
|
136
|
+
<label>Title:</label>
|
|
137
|
+
<input type="text" id="title" placeholder="Tool call title">
|
|
138
|
+
</div>
|
|
139
|
+
<div class="form-group">
|
|
140
|
+
<label>Kind:</label>
|
|
141
|
+
<select id="kind">
|
|
142
|
+
<option value="other">Other</option>
|
|
143
|
+
<option value="read">Read</option>
|
|
144
|
+
<option value="edit">Edit</option>
|
|
145
|
+
<option value="execute">Execute</option>
|
|
146
|
+
</select>
|
|
147
|
+
</div>
|
|
148
|
+
`;
|
|
149
|
+
break;
|
|
150
|
+
case "tool_call_progress":
|
|
151
|
+
form.innerHTML = `
|
|
152
|
+
<div class="form-group">
|
|
153
|
+
<label>Tool Call ID:</label>
|
|
154
|
+
<input type="text" id="toolCallId" placeholder="tool-call-123">
|
|
155
|
+
</div>
|
|
156
|
+
<div class="form-group">
|
|
157
|
+
<label>Status:</label>
|
|
158
|
+
<select id="status">
|
|
159
|
+
<option value="in_progress">In Progress</option>
|
|
160
|
+
<option value="completed">Completed</option>
|
|
161
|
+
<option value="failed">Failed</option>
|
|
162
|
+
</select>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="form-group">
|
|
165
|
+
<label>Output:</label>
|
|
166
|
+
<textarea id="output" rows="3" placeholder="Tool output"></textarea>
|
|
167
|
+
</div>
|
|
168
|
+
`;
|
|
169
|
+
break;
|
|
170
|
+
default:
|
|
171
|
+
form.innerHTML = "";
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
async function sendNotification() {
|
|
176
|
+
const sessionId = document.getElementById("sessionId").value;
|
|
177
|
+
const type = document.getElementById("notificationType").value;
|
|
178
|
+
|
|
179
|
+
if (!sessionId) {
|
|
180
|
+
alert("Please enter a session ID");
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
let data = {};
|
|
185
|
+
|
|
186
|
+
// Collect form data based on type
|
|
187
|
+
switch (type) {
|
|
188
|
+
case "agent_message":
|
|
189
|
+
case "user_message":
|
|
190
|
+
case "agent_thought":
|
|
191
|
+
data.text = document.getElementById("text").value;
|
|
192
|
+
break;
|
|
193
|
+
case "tool_call_start":
|
|
194
|
+
data.tool_call_id = document.getElementById("toolCallId").value;
|
|
195
|
+
data.title = document.getElementById("title").value;
|
|
196
|
+
data.kind = document.getElementById("kind").value;
|
|
197
|
+
break;
|
|
198
|
+
case "tool_call_progress":
|
|
199
|
+
data.tool_call_id = document.getElementById("toolCallId").value;
|
|
200
|
+
data.status = document.getElementById("status").value;
|
|
201
|
+
data.output = document.getElementById("output").value;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
const response = await fetch("/send-notification", {
|
|
207
|
+
method: "POST",
|
|
208
|
+
headers: { "Content-Type": "application/json" },
|
|
209
|
+
body: JSON.stringify({
|
|
210
|
+
session_id: sessionId,
|
|
211
|
+
notification_type: type,
|
|
212
|
+
data: data,
|
|
213
|
+
}),
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
const result = await response.text();
|
|
217
|
+
document.getElementById("response").style.display = "block";
|
|
218
|
+
document.getElementById("response").innerHTML = response.ok
|
|
219
|
+
? "✅ Notification sent successfully!"
|
|
220
|
+
: "❌ Error: " + result;
|
|
221
|
+
} catch (e) {
|
|
222
|
+
document.getElementById("response").style.display = "block";
|
|
223
|
+
document.getElementById("response").innerHTML =
|
|
224
|
+
"❌ Error: " + e.message;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Initialize
|
|
229
|
+
updateForm();
|
|
230
|
+
refreshStatus();
|
|
231
|
+
setInterval(refreshStatus, 5000); // Auto-refresh every 5 seconds
|
|
232
|
+
</script>
|
|
233
|
+
</body>
|
|
234
|
+
</html>
|