solace-agent-mesh 1.6.1__py3-none-any.whl → 1.13.2__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 solace-agent-mesh might be problematic. Click here for more details.
- solace_agent_mesh/agent/adk/alembic/README +74 -0
- solace_agent_mesh/agent/adk/alembic/env.py +77 -0
- solace_agent_mesh/agent/adk/alembic/script.py.mako +28 -0
- solace_agent_mesh/agent/adk/alembic/versions/e2902798564d_adk_session_db_upgrade.py +52 -0
- solace_agent_mesh/agent/adk/alembic.ini +112 -0
- solace_agent_mesh/agent/adk/app_llm_agent.py +26 -0
- solace_agent_mesh/agent/adk/artifacts/filesystem_artifact_service.py +165 -1
- solace_agent_mesh/agent/adk/artifacts/s3_artifact_service.py +163 -0
- solace_agent_mesh/agent/adk/callbacks.py +852 -109
- solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +234 -36
- solace_agent_mesh/agent/adk/intelligent_mcp_callbacks.py +52 -5
- solace_agent_mesh/agent/adk/mcp_content_processor.py +1 -1
- solace_agent_mesh/agent/adk/models/lite_llm.py +77 -21
- solace_agent_mesh/agent/adk/models/oauth2_token_manager.py +24 -137
- solace_agent_mesh/agent/adk/runner.py +85 -20
- solace_agent_mesh/agent/adk/schema_migration.py +88 -0
- solace_agent_mesh/agent/adk/services.py +94 -18
- solace_agent_mesh/agent/adk/setup.py +281 -65
- solace_agent_mesh/agent/adk/stream_parser.py +231 -37
- solace_agent_mesh/agent/adk/tool_wrapper.py +3 -0
- solace_agent_mesh/agent/protocol/event_handlers.py +472 -137
- solace_agent_mesh/agent/proxies/a2a/app.py +3 -2
- solace_agent_mesh/agent/proxies/a2a/component.py +572 -75
- solace_agent_mesh/agent/proxies/a2a/config.py +80 -4
- solace_agent_mesh/agent/proxies/base/app.py +3 -2
- solace_agent_mesh/agent/proxies/base/component.py +188 -22
- solace_agent_mesh/agent/proxies/base/proxy_task_context.py +3 -1
- solace_agent_mesh/agent/sac/app.py +91 -3
- solace_agent_mesh/agent/sac/component.py +591 -157
- solace_agent_mesh/agent/sac/patch_adk.py +8 -16
- solace_agent_mesh/agent/sac/task_execution_context.py +146 -4
- solace_agent_mesh/agent/tools/__init__.py +3 -0
- solace_agent_mesh/agent/tools/audio_tools.py +3 -3
- solace_agent_mesh/agent/tools/builtin_artifact_tools.py +710 -171
- solace_agent_mesh/agent/tools/deep_research_tools.py +2161 -0
- solace_agent_mesh/agent/tools/dynamic_tool.py +2 -0
- solace_agent_mesh/agent/tools/peer_agent_tool.py +82 -15
- solace_agent_mesh/agent/tools/time_tools.py +126 -0
- solace_agent_mesh/agent/tools/tool_config_types.py +57 -2
- solace_agent_mesh/agent/tools/web_search_tools.py +279 -0
- solace_agent_mesh/agent/tools/web_tools.py +125 -17
- solace_agent_mesh/agent/utils/artifact_helpers.py +248 -6
- solace_agent_mesh/agent/utils/context_helpers.py +17 -0
- solace_agent_mesh/assets/docs/404.html +6 -6
- solace_agent_mesh/assets/docs/assets/css/{styles.906a1503.css → styles.8162edfb.css} +1 -1
- solace_agent_mesh/assets/docs/assets/js/05749d90.19ac4f35.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/15ba94aa.e186750d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/15e40e79.434bb30f.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/17896441.e612dfb4.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/2279.550aa580.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/{17896441.a5e82f9b.js.LICENSE.txt → 2279.550aa580.js.LICENSE.txt} +6 -0
- solace_agent_mesh/assets/docs/assets/js/240a0364.83e37aa8.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/2987107d.a80604f9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/2e32b5e0.2f0db237.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3a6c6137.7e61915d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3ac1795d.7f7ab1c1.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/3ff0015d.e53c9b78.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/41adc471.0e95b87c.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/4667dc50.bf2ad456.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/49eed117.493d6f99.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{509e993c.4c7a1a6d.js → 509e993c.a1fbf45a.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/547e15cc.8e6da617.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/55b7b518.29d6e75d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/5b8d9c11.d4eb37b8.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/5c2bd65f.1ee87753.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/60702c0e.a8bdd79b.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/631738c7.fa471607.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/64195356.09dbd087.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/66d4869e.30340bd3.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6a520c9d.b6e3f2ce.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6aaedf65.7253541d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6ad8f0bd.a5b36a60.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6d84eae0.fd23ba4a.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/71da7b71.374b9d54.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/729898df.7249e9fd.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/7e294c01.7c5f6906.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8024126c.e3467286.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/81a99df0.7ed65d45.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/82fbfb93.161823a5.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/8b032486.91a91afc.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/924ffdeb.975e428a.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/94e8668d.16083b3f.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/9bb13469.4523ae20.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/a7d42657.a956689d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/a94703ab.3e5fbcb3.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ab9708a8.3e563275.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ad87452a.9d73dad6.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/c93cbaa0.0e0d8baf.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/cab03b5b.6a073091.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/cbe2e9ea.07e170dd.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/da0b5bad.b62f7b08.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/dd817ffc.c37a755e.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/dd81e2b8.b682e9c2.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/de915948.44a432bc.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/e04b235d.06d23db6.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/e1b6eeb4.deb2b62e.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/e3d9abda.1476f570.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/e6f9706b.acc800d3.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/e92d0134.c147a429.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ee0c2fe7.94d0a351.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f284c35a.cc97854c.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ff4d71f2.74710fc1.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/main.d634009f.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/runtime~main.27bb82a7.js +1 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/agents/index.html +68 -68
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/artifact-management/index.html +50 -50
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/audio-tools/index.html +42 -42
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/data-analysis-tools/index.html +55 -55
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/embeds/index.html +82 -68
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/image-tools/index.html +81 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/index.html +67 -50
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/research-tools/index.html +136 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/cli/index.html +178 -144
- solace_agent_mesh/assets/docs/docs/documentation/components/gateways/index.html +43 -42
- solace_agent_mesh/assets/docs/docs/documentation/components/index.html +20 -18
- solace_agent_mesh/assets/docs/docs/documentation/components/orchestrator/index.html +23 -23
- solace_agent_mesh/assets/docs/docs/documentation/components/platform-service/index.html +33 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/plugins/index.html +45 -45
- solace_agent_mesh/assets/docs/docs/documentation/components/projects/index.html +182 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/prompts/index.html +147 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/proxies/index.html +208 -125
- solace_agent_mesh/assets/docs/docs/documentation/components/speech/index.html +52 -0
- solace_agent_mesh/assets/docs/docs/documentation/deploying/debugging/index.html +28 -49
- solace_agent_mesh/assets/docs/docs/documentation/deploying/deployment-options/index.html +29 -30
- solace_agent_mesh/assets/docs/docs/documentation/deploying/index.html +14 -14
- solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes/index.html +47 -0
- solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes/kubernetes-deployment-guide/index.html +197 -0
- solace_agent_mesh/assets/docs/docs/documentation/deploying/logging/index.html +90 -0
- solace_agent_mesh/assets/docs/docs/documentation/deploying/observability/index.html +17 -16
- solace_agent_mesh/assets/docs/docs/documentation/deploying/proxy_configuration/index.html +49 -0
- solace_agent_mesh/assets/docs/docs/documentation/developing/create-agents/index.html +38 -38
- solace_agent_mesh/assets/docs/docs/documentation/developing/create-gateways/index.html +162 -171
- solace_agent_mesh/assets/docs/docs/documentation/developing/creating-python-tools/index.html +67 -49
- solace_agent_mesh/assets/docs/docs/documentation/developing/creating-service-providers/index.html +17 -17
- solace_agent_mesh/assets/docs/docs/documentation/developing/evaluations/index.html +51 -51
- solace_agent_mesh/assets/docs/docs/documentation/developing/index.html +22 -22
- solace_agent_mesh/assets/docs/docs/documentation/developing/structure/index.html +27 -27
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/bedrock-agents/index.html +135 -135
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/custom-agent/index.html +66 -66
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/event-mesh-gateway/index.html +51 -51
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mcp-integration/index.html +50 -38
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mongodb-integration/index.html +86 -86
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rag-integration/index.html +51 -51
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rest-gateway/index.html +24 -24
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/slack-integration/index.html +30 -30
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/sql-database/index.html +44 -44
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/teams-integration/index.html +115 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/agent-builder/index.html +86 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/connectors/index.html +67 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/index.html +23 -19
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/installation/index.html +40 -37
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/openapi-tools/index.html +324 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/rbac-setup-guide/index.html +112 -87
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/secure-user-delegated-access/index.html +440 -0
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/single-sign-on/index.html +87 -64
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/wheel-installation/index.html +62 -0
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/architecture/index.html +44 -44
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/index.html +39 -37
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +30 -30
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/try-agent-mesh/index.html +18 -18
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/vibe_coding/index.html +62 -0
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/artifact-storage/index.html +311 -0
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/configurations/index.html +39 -42
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/index.html +14 -14
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/installation/index.html +27 -25
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/large_language_models/index.html +69 -69
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/run-project/index.html +72 -72
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/session-storage/index.html +251 -0
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/user-feedback/index.html +88 -0
- solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-gateway-upgrade-to-0.3.0/index.html +42 -42
- solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-technical-migration-map/index.html +20 -20
- solace_agent_mesh/assets/docs/docs/documentation/migrations/platform-service-split/index.html +85 -0
- solace_agent_mesh/assets/docs/lunr-index-1768329217460.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -1
- solace_agent_mesh/assets/docs/search-doc-1768329217460.json +1 -0
- solace_agent_mesh/assets/docs/search-doc.json +1 -1
- solace_agent_mesh/assets/docs/sitemap.xml +1 -1
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/cli/commands/add_cmd/__init__.py +3 -1
- solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +6 -1
- solace_agent_mesh/cli/commands/add_cmd/proxy_cmd.py +100 -0
- solace_agent_mesh/cli/commands/docs_cmd.py +4 -1
- solace_agent_mesh/cli/commands/eval_cmd.py +1 -1
- solace_agent_mesh/cli/commands/init_cmd/__init__.py +15 -0
- solace_agent_mesh/cli/commands/init_cmd/directory_step.py +1 -1
- solace_agent_mesh/cli/commands/init_cmd/env_step.py +30 -3
- solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +3 -4
- solace_agent_mesh/cli/commands/init_cmd/platform_service_step.py +85 -0
- solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +16 -3
- solace_agent_mesh/cli/commands/plugin_cmd/add_cmd.py +2 -1
- solace_agent_mesh/cli/commands/plugin_cmd/catalog_cmd.py +1 -0
- solace_agent_mesh/cli/commands/plugin_cmd/create_cmd.py +3 -3
- solace_agent_mesh/cli/commands/run_cmd.py +64 -49
- solace_agent_mesh/cli/commands/tools_cmd.py +315 -0
- solace_agent_mesh/cli/main.py +15 -0
- solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-BTf6dqwp.js → authCallback-KnKMP_vb.js} +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/client-DpBL2stg.js +25 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-Cd498TV2.js +435 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-rSf8Vu29.css +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/vendor-CGk8Suyh.js +565 -0
- solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
- solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
- solace_agent_mesh/client/webui/frontend/static/mockServiceWorker.js +336 -0
- solace_agent_mesh/client/webui/frontend/static/ui-version.json +6 -0
- solace_agent_mesh/common/a2a/events.py +2 -1
- solace_agent_mesh/common/a2a/protocol.py +5 -0
- solace_agent_mesh/common/a2a/types.py +2 -1
- solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json +23 -6
- solace_agent_mesh/common/a2a_spec/schemas/feedback_event.json +51 -0
- solace_agent_mesh/common/agent_registry.py +38 -11
- solace_agent_mesh/common/data_parts.py +144 -4
- solace_agent_mesh/common/error_handlers.py +83 -0
- solace_agent_mesh/common/exceptions.py +24 -0
- solace_agent_mesh/common/oauth/__init__.py +17 -0
- solace_agent_mesh/common/oauth/oauth_client.py +408 -0
- solace_agent_mesh/common/oauth/utils.py +50 -0
- solace_agent_mesh/common/rag_dto.py +156 -0
- solace_agent_mesh/common/sac/sam_component_base.py +97 -19
- solace_agent_mesh/common/sam_events/event_service.py +2 -2
- solace_agent_mesh/common/services/employee_service.py +1 -1
- solace_agent_mesh/common/utils/embeds/constants.py +1 -0
- solace_agent_mesh/common/utils/embeds/converter.py +1 -8
- solace_agent_mesh/common/utils/embeds/modifiers.py +4 -28
- solace_agent_mesh/common/utils/embeds/resolver.py +152 -31
- solace_agent_mesh/common/utils/embeds/types.py +9 -0
- solace_agent_mesh/common/utils/log_formatters.py +20 -0
- solace_agent_mesh/common/utils/mime_helpers.py +12 -5
- solace_agent_mesh/common/utils/pydantic_utils.py +90 -3
- solace_agent_mesh/common/utils/rbac_utils.py +69 -0
- solace_agent_mesh/common/utils/templates/__init__.py +8 -0
- solace_agent_mesh/common/utils/templates/liquid_renderer.py +210 -0
- solace_agent_mesh/common/utils/templates/template_resolver.py +161 -0
- solace_agent_mesh/config_portal/backend/common.py +12 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-CljP4_mv.js +103 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/{components-Rk0n-9cK.js → components-CaC6hG8d.js} +22 -22
- solace_agent_mesh/config_portal/frontend/static/client/assets/{entry.client-mvZjNKiz.js → entry.client-H_TM0YBt.js} +3 -3
- solace_agent_mesh/config_portal/frontend/static/client/assets/{index-DzNKzXrc.js → index-CnFykb2v.js} +16 -16
- solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-f8439d40.js +1 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/root-BIMqslJB.css +1 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/root-mJmTIdIk.js +10 -0
- solace_agent_mesh/config_portal/frontend/static/client/index.html +3 -3
- solace_agent_mesh/core_a2a/service.py +3 -2
- solace_agent_mesh/gateway/adapter/__init__.py +1 -0
- solace_agent_mesh/gateway/adapter/base.py +170 -0
- solace_agent_mesh/gateway/adapter/types.py +230 -0
- solace_agent_mesh/gateway/base/app.py +39 -2
- solace_agent_mesh/gateway/base/auth_interface.py +103 -0
- solace_agent_mesh/gateway/base/component.py +1027 -151
- solace_agent_mesh/gateway/generic/__init__.py +1 -0
- solace_agent_mesh/gateway/generic/app.py +50 -0
- solace_agent_mesh/gateway/generic/component.py +894 -0
- solace_agent_mesh/gateway/http_sse/alembic/env.py +0 -7
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_project_users_table.py +72 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_soft_delete_and_search.py +109 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251024_add_default_agent_to_projects.py +26 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251024_add_projects_table.py +135 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251108_create_prompt_tables_with_sharing.py +154 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251115_add_parent_task_id.py +32 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251126_add_background_task_fields.py +47 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251202_add_versioned_fields_to_prompts.py +52 -0
- solace_agent_mesh/gateway/http_sse/alembic.ini +0 -36
- solace_agent_mesh/gateway/http_sse/app.py +40 -11
- solace_agent_mesh/gateway/http_sse/component.py +285 -160
- solace_agent_mesh/gateway/http_sse/dependencies.py +149 -114
- solace_agent_mesh/gateway/http_sse/main.py +68 -450
- solace_agent_mesh/gateway/http_sse/repository/__init__.py +19 -1
- solace_agent_mesh/gateway/http_sse/repository/chat_task_repository.py +2 -2
- solace_agent_mesh/gateway/http_sse/repository/entities/project.py +81 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/project_user.py +47 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/session.py +26 -3
- solace_agent_mesh/gateway/http_sse/repository/entities/task.py +7 -0
- solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +47 -0
- solace_agent_mesh/gateway/http_sse/repository/interfaces.py +114 -6
- solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +13 -0
- solace_agent_mesh/gateway/http_sse/repository/models/project_model.py +51 -0
- solace_agent_mesh/gateway/http_sse/repository/models/project_user_model.py +75 -0
- solace_agent_mesh/gateway/http_sse/repository/models/prompt_model.py +159 -0
- solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +8 -2
- solace_agent_mesh/gateway/http_sse/repository/models/task_model.py +8 -1
- solace_agent_mesh/gateway/http_sse/repository/project_repository.py +172 -0
- solace_agent_mesh/gateway/http_sse/repository/project_user_repository.py +186 -0
- solace_agent_mesh/gateway/http_sse/repository/session_repository.py +177 -11
- solace_agent_mesh/gateway/http_sse/repository/task_repository.py +86 -2
- solace_agent_mesh/gateway/http_sse/routers/agent_cards.py +38 -7
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +256 -58
- solace_agent_mesh/gateway/http_sse/routers/auth.py +168 -134
- solace_agent_mesh/gateway/http_sse/routers/config.py +302 -8
- solace_agent_mesh/gateway/http_sse/routers/dto/project_dto.py +69 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/prompt_dto.py +255 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/project_requests.py +48 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +14 -1
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/base_responses.py +1 -1
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/project_responses.py +31 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +5 -2
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/version_responses.py +31 -0
- solace_agent_mesh/gateway/http_sse/routers/feedback.py +133 -2
- solace_agent_mesh/gateway/http_sse/routers/people.py +2 -2
- solace_agent_mesh/gateway/http_sse/routers/projects.py +768 -0
- solace_agent_mesh/gateway/http_sse/routers/prompts.py +1416 -0
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +167 -7
- solace_agent_mesh/gateway/http_sse/routers/speech.py +355 -0
- solace_agent_mesh/gateway/http_sse/routers/sse.py +131 -8
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +670 -18
- solace_agent_mesh/gateway/http_sse/routers/users.py +1 -1
- solace_agent_mesh/gateway/http_sse/routers/version.py +343 -0
- solace_agent_mesh/gateway/http_sse/routers/visualization.py +92 -9
- solace_agent_mesh/gateway/http_sse/services/audio_service.py +1227 -0
- solace_agent_mesh/gateway/http_sse/services/background_task_monitor.py +186 -0
- solace_agent_mesh/gateway/http_sse/services/data_retention_service.py +1 -1
- solace_agent_mesh/gateway/http_sse/services/feedback_service.py +1 -1
- solace_agent_mesh/gateway/http_sse/services/project_service.py +930 -0
- solace_agent_mesh/gateway/http_sse/services/prompt_builder_assistant.py +303 -0
- solace_agent_mesh/gateway/http_sse/services/session_service.py +361 -12
- solace_agent_mesh/gateway/http_sse/services/task_logger_service.py +354 -4
- solace_agent_mesh/gateway/http_sse/session_manager.py +15 -15
- solace_agent_mesh/gateway/http_sse/sse_manager.py +286 -166
- solace_agent_mesh/gateway/http_sse/utils/artifact_copy_utils.py +370 -0
- solace_agent_mesh/gateway/http_sse/utils/stim_utils.py +41 -1
- solace_agent_mesh/services/__init__.py +0 -0
- solace_agent_mesh/services/platform/__init__.py +29 -0
- solace_agent_mesh/services/platform/alembic/env.py +85 -0
- solace_agent_mesh/services/platform/alembic/script.py.mako +28 -0
- solace_agent_mesh/services/platform/alembic.ini +109 -0
- solace_agent_mesh/services/platform/api/__init__.py +3 -0
- solace_agent_mesh/services/platform/api/dependencies.py +154 -0
- solace_agent_mesh/services/platform/api/main.py +314 -0
- solace_agent_mesh/services/platform/api/middleware.py +51 -0
- solace_agent_mesh/services/platform/api/routers/__init__.py +33 -0
- solace_agent_mesh/services/platform/api/routers/health_router.py +31 -0
- solace_agent_mesh/services/platform/app.py +215 -0
- solace_agent_mesh/services/platform/component.py +777 -0
- solace_agent_mesh/shared/__init__.py +14 -0
- solace_agent_mesh/shared/api/__init__.py +42 -0
- solace_agent_mesh/shared/auth/__init__.py +26 -0
- solace_agent_mesh/shared/auth/dependencies.py +204 -0
- solace_agent_mesh/shared/auth/middleware.py +347 -0
- solace_agent_mesh/shared/database/__init__.py +20 -0
- solace_agent_mesh/{gateway/http_sse/shared → shared/database}/base_repository.py +1 -1
- solace_agent_mesh/{gateway/http_sse/shared → shared/database}/database_exceptions.py +1 -1
- solace_agent_mesh/{gateway/http_sse/shared → shared/database}/database_helpers.py +1 -1
- solace_agent_mesh/shared/exceptions/__init__.py +36 -0
- solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/exception_handlers.py +19 -5
- solace_agent_mesh/shared/utils/__init__.py +21 -0
- solace_agent_mesh/templates/logging_config_template.yaml +48 -0
- solace_agent_mesh/templates/main_orchestrator.yaml +12 -1
- solace_agent_mesh/templates/platform.yaml +49 -0
- solace_agent_mesh/templates/plugin_readme_template.md +3 -25
- solace_agent_mesh/templates/plugin_tool_config_template.yaml +109 -0
- solace_agent_mesh/templates/proxy_template.yaml +62 -0
- solace_agent_mesh/templates/webui.yaml +148 -6
- solace_agent_mesh/tools/web_search/__init__.py +18 -0
- solace_agent_mesh/tools/web_search/base.py +84 -0
- solace_agent_mesh/tools/web_search/google_search.py +247 -0
- solace_agent_mesh/tools/web_search/models.py +99 -0
- {solace_agent_mesh-1.6.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/METADATA +31 -12
- solace_agent_mesh-1.13.2.dist-info/RECORD +591 -0
- {solace_agent_mesh-1.6.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/WHEEL +1 -1
- solace_agent_mesh/agent/adk/adk_llm.txt +0 -232
- solace_agent_mesh/agent/adk/adk_llm_detail.txt +0 -566
- solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +0 -171
- solace_agent_mesh/agent/adk/models/models_llm.txt +0 -142
- solace_agent_mesh/agent/agent_llm.txt +0 -378
- solace_agent_mesh/agent/agent_llm_detail.txt +0 -1702
- solace_agent_mesh/agent/protocol/protocol_llm.txt +0 -81
- solace_agent_mesh/agent/protocol/protocol_llm_detail.txt +0 -92
- solace_agent_mesh/agent/sac/sac_llm.txt +0 -189
- solace_agent_mesh/agent/sac/sac_llm_detail.txt +0 -200
- solace_agent_mesh/agent/testing/testing_llm.txt +0 -57
- solace_agent_mesh/agent/testing/testing_llm_detail.txt +0 -68
- solace_agent_mesh/agent/tools/tools_llm.txt +0 -263
- solace_agent_mesh/agent/tools/tools_llm_detail.txt +0 -274
- solace_agent_mesh/agent/utils/utils_llm.txt +0 -138
- solace_agent_mesh/agent/utils/utils_llm_detail.txt +0 -149
- solace_agent_mesh/assets/docs/assets/js/15ba94aa.932dd2db.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/17896441.a5e82f9b.js +0 -2
- solace_agent_mesh/assets/docs/assets/js/240a0364.7eac6021.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/2e32b5e0.33f5d75b.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/3a6c6137.f5940cfa.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/3ac1795d.76654dd9.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/3ff0015d.2be20244.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/547e15cc.2cbb060a.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/55b7b518.f2b1d1ba.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/5c2bd65f.eda4bcb2.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/631738c7.a8b1ef8b.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/6a520c9d.ba015d81.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/6ad8f0bd.f4b15f3b.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/6d84eae0.4a5fbf39.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/71da7b71.38583438.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/8024126c.56e59919.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/81a99df0.07034dd9.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/82fbfb93.139a1a1f.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/924ffdeb.8095e148.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/94e8668d.b5ddb7a1.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/9bb13469.dd1c9b54.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/a94703ab.0438dbc2.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/ab9708a8.3e6dd091.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/c93cbaa0.eaff365e.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/da0b5bad.d08a9466.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/dd817ffc.0aa9630a.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/dd81e2b8.d590bc9e.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/de915948.27d6b065.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/e3d9abda.6b9493d0.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/e6f9706b.e74a984d.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/e92d0134.cf6d6522.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/f284c35a.42f59cdd.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/ff4d71f2.15b02f97.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/main.b12eac43.js +0 -2
- solace_agent_mesh/assets/docs/assets/js/runtime~main.e268214e.js +0 -1
- solace_agent_mesh/assets/docs/lunr-index-1761248203150.json +0 -1
- solace_agent_mesh/assets/docs/search-doc-1761248203150.json +0 -1
- solace_agent_mesh/cli/commands/add_cmd/add_cmd_llm.txt +0 -250
- solace_agent_mesh/cli/commands/init_cmd/init_cmd_llm.txt +0 -365
- solace_agent_mesh/cli/commands/plugin_cmd/plugin_cmd_llm.txt +0 -305
- solace_agent_mesh/client/webui/frontend/static/assets/client-CaY59VuC.js +0 -25
- solace_agent_mesh/client/webui/frontend/static/assets/main-B32noGmR.js +0 -342
- solace_agent_mesh/client/webui/frontend/static/assets/main-DHJKSW1S.css +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/vendor-BEmvJSYz.js +0 -405
- solace_agent_mesh/common/a2a/a2a_llm.txt +0 -182
- solace_agent_mesh/common/a2a/a2a_llm_detail.txt +0 -193
- solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +0 -407
- solace_agent_mesh/common/a2a_spec/a2a_spec_llm_detail.txt +0 -736
- solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +0 -313
- solace_agent_mesh/common/common_llm.txt +0 -251
- solace_agent_mesh/common/common_llm_detail.txt +0 -2562
- solace_agent_mesh/common/middleware/middleware_llm.txt +0 -174
- solace_agent_mesh/common/middleware/middleware_llm_detail.txt +0 -185
- solace_agent_mesh/common/sac/sac_llm.txt +0 -71
- solace_agent_mesh/common/sac/sac_llm_detail.txt +0 -82
- solace_agent_mesh/common/sam_events/sam_events_llm.txt +0 -104
- solace_agent_mesh/common/sam_events/sam_events_llm_detail.txt +0 -115
- solace_agent_mesh/common/services/providers/providers_llm.txt +0 -80
- solace_agent_mesh/common/services/services_llm.txt +0 -363
- solace_agent_mesh/common/services/services_llm_detail.txt +0 -459
- solace_agent_mesh/common/utils/embeds/embeds_llm.txt +0 -220
- solace_agent_mesh/common/utils/utils_llm.txt +0 -336
- solace_agent_mesh/common/utils/utils_llm_detail.txt +0 -572
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-ByU1X1HD.js +0 -98
- solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-61038fc6.js +0 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/root-BWvk5-gF.js +0 -10
- solace_agent_mesh/config_portal/frontend/static/client/assets/root-DxRwaWiE.css +0 -1
- solace_agent_mesh/core_a2a/core_a2a_llm.txt +0 -90
- solace_agent_mesh/core_a2a/core_a2a_llm_detail.txt +0 -101
- solace_agent_mesh/gateway/base/base_llm.txt +0 -224
- solace_agent_mesh/gateway/base/base_llm_detail.txt +0 -235
- solace_agent_mesh/gateway/gateway_llm.txt +0 -373
- solace_agent_mesh/gateway/gateway_llm_detail.txt +0 -3885
- solace_agent_mesh/gateway/http_sse/alembic/alembic_llm.txt +0 -295
- solace_agent_mesh/gateway/http_sse/alembic/versions/versions_llm.txt +0 -155
- solace_agent_mesh/gateway/http_sse/components/components_llm.txt +0 -105
- solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +0 -299
- solace_agent_mesh/gateway/http_sse/http_sse_llm_detail.txt +0 -3278
- solace_agent_mesh/gateway/http_sse/repository/entities/entities_llm.txt +0 -263
- solace_agent_mesh/gateway/http_sse/repository/models/models_llm.txt +0 -266
- solace_agent_mesh/gateway/http_sse/repository/repository_llm.txt +0 -340
- solace_agent_mesh/gateway/http_sse/routers/dto/dto_llm.txt +0 -346
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/requests_llm.txt +0 -83
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/responses_llm.txt +0 -107
- solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +0 -314
- solace_agent_mesh/gateway/http_sse/services/services_llm.txt +0 -297
- solace_agent_mesh/gateway/http_sse/shared/__init__.py +0 -146
- solace_agent_mesh/gateway/http_sse/shared/shared_llm.txt +0 -285
- solace_agent_mesh/gateway/http_sse/utils/utils_llm.txt +0 -47
- solace_agent_mesh/llm.txt +0 -228
- solace_agent_mesh/llm_detail.txt +0 -2835
- solace_agent_mesh/solace_agent_mesh_llm.txt +0 -362
- solace_agent_mesh/solace_agent_mesh_llm_detail.txt +0 -8599
- solace_agent_mesh/templates/logging_config_template.ini +0 -45
- solace_agent_mesh/templates/templates_llm.txt +0 -147
- solace_agent_mesh-1.6.1.dist-info/RECORD +0 -525
- /solace_agent_mesh/assets/docs/assets/js/{main.b12eac43.js.LICENSE.txt → main.d634009f.js.LICENSE.txt} +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/auth_utils.py +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/pagination.py +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/response_utils.py +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/error_dto.py +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/exceptions.py +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/enums.py +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/timestamp_utils.py +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/types.py +0 -0
- /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/utils.py +0 -0
- {solace_agent_mesh-1.6.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/entry_points.txt +0 -0
- {solace_agent_mesh-1.6.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,52 +2,113 @@
|
|
|
2
2
|
Contains event handling logic for the A2A_ADK_HostComponent.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
import logging
|
|
6
|
-
import json
|
|
7
5
|
import asyncio
|
|
8
|
-
from typing import TYPE_CHECKING, Dict, Any
|
|
9
6
|
import fnmatch
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
from
|
|
13
|
-
|
|
14
|
-
from
|
|
7
|
+
import json
|
|
8
|
+
import logging
|
|
9
|
+
from typing import TYPE_CHECKING, Any, Dict
|
|
10
|
+
|
|
11
|
+
from litellm.exceptions import BadRequestError
|
|
12
|
+
|
|
15
13
|
from a2a.types import (
|
|
16
14
|
A2ARequest,
|
|
17
|
-
AgentCard,
|
|
18
15
|
AgentCapabilities,
|
|
16
|
+
AgentCard,
|
|
19
17
|
AgentExtension,
|
|
20
18
|
DataPart,
|
|
21
19
|
JSONRPCResponse,
|
|
22
20
|
Task,
|
|
23
21
|
TaskArtifactUpdateEvent,
|
|
22
|
+
TaskState,
|
|
24
23
|
TaskStatusUpdateEvent,
|
|
25
24
|
TextPart,
|
|
26
25
|
)
|
|
26
|
+
from google.adk.agents import RunConfig
|
|
27
|
+
from google.adk.agents.run_config import StreamingMode
|
|
28
|
+
from solace_ai_connector.common.event import Event, EventType
|
|
29
|
+
from solace_ai_connector.common.message import Message as SolaceMessage
|
|
30
|
+
from sqlalchemy.exc import OperationalError
|
|
31
|
+
|
|
32
|
+
from ...agent.adk.callbacks import _publish_data_part_status_update
|
|
33
|
+
from ...agent.adk.runner import TaskCancelledError, run_adk_async_task_thread_wrapper
|
|
34
|
+
from ...agent.utils.artifact_helpers import generate_artifact_metadata_summary
|
|
27
35
|
from ...common import a2a
|
|
36
|
+
from ...common.error_handlers import get_error_message
|
|
37
|
+
from ...common.utils.embeds.constants import (
|
|
38
|
+
EMBED_DELIMITER_OPEN,
|
|
39
|
+
EMBED_DELIMITER_CLOSE,
|
|
40
|
+
)
|
|
28
41
|
from ...common.a2a import (
|
|
29
42
|
get_agent_request_topic,
|
|
30
|
-
get_discovery_topic,
|
|
31
|
-
translate_a2a_to_adk_content,
|
|
32
|
-
get_client_response_topic,
|
|
33
43
|
get_agent_response_subscription_topic,
|
|
34
44
|
get_agent_status_subscription_topic,
|
|
45
|
+
get_client_response_topic,
|
|
46
|
+
get_discovery_topic,
|
|
35
47
|
get_sam_events_subscription_topic,
|
|
36
48
|
get_text_from_message,
|
|
37
49
|
topic_matches_subscription,
|
|
50
|
+
translate_a2a_to_adk_content,
|
|
38
51
|
)
|
|
39
|
-
from ...
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
from ...agent.adk.runner import run_adk_async_task_thread_wrapper
|
|
52
|
+
from ...common.a2a.types import ToolsExtensionParams
|
|
53
|
+
from ...common.data_parts import ToolResultData
|
|
43
54
|
from ..sac.task_execution_context import TaskExecutionContext
|
|
44
|
-
from google.adk.agents import RunConfig
|
|
45
55
|
|
|
46
56
|
if TYPE_CHECKING:
|
|
47
57
|
from ..sac.component import SamAgentComponent
|
|
48
|
-
from google.adk.agents.run_config import StreamingMode
|
|
49
58
|
|
|
50
59
|
log = logging.getLogger(__name__)
|
|
60
|
+
trace_logger = logging.getLogger("sam_trace")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _forward_jsonrpc_response(
|
|
64
|
+
component: "SamAgentComponent",
|
|
65
|
+
original_jsonrpc_request_id: str,
|
|
66
|
+
result_data: Any,
|
|
67
|
+
target_topic: str,
|
|
68
|
+
main_logical_task_id: str,
|
|
69
|
+
peer_agent_name: str,
|
|
70
|
+
message: SolaceMessage,
|
|
71
|
+
) -> None:
|
|
72
|
+
"""
|
|
73
|
+
Utility method to forward a JSONRPCResponse with the given result data.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
component: The SamAgentComponent instance
|
|
77
|
+
original_jsonrpc_request_id: The original JSONRPC request ID
|
|
78
|
+
result_data: The data to include in the response result
|
|
79
|
+
target_topic: The topic to publish to
|
|
80
|
+
main_logical_task_id: The main logical task ID for logging
|
|
81
|
+
peer_agent_name: The peer agent name for logging
|
|
82
|
+
message: The original message to acknowledge
|
|
83
|
+
"""
|
|
84
|
+
forwarded_rpc_response = JSONRPCResponse(
|
|
85
|
+
id=original_jsonrpc_request_id,
|
|
86
|
+
result=result_data,
|
|
87
|
+
)
|
|
88
|
+
payload_to_publish = forwarded_rpc_response.model_dump(
|
|
89
|
+
by_alias=True, exclude_none=True
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
try:
|
|
93
|
+
component.publish_a2a_message(
|
|
94
|
+
payload_to_publish,
|
|
95
|
+
target_topic,
|
|
96
|
+
)
|
|
97
|
+
log.debug(
|
|
98
|
+
"%s Forwarded DataPart signal for main task %s (from peer %s) to %s.",
|
|
99
|
+
component.log_identifier,
|
|
100
|
+
main_logical_task_id,
|
|
101
|
+
peer_agent_name,
|
|
102
|
+
target_topic,
|
|
103
|
+
)
|
|
104
|
+
except Exception as pub_err:
|
|
105
|
+
log.exception(
|
|
106
|
+
"%s Failed to publish forwarded status signal for main task %s: %s",
|
|
107
|
+
component.log_identifier,
|
|
108
|
+
main_logical_task_id,
|
|
109
|
+
pub_err,
|
|
110
|
+
)
|
|
111
|
+
message.call_acknowledgements()
|
|
51
112
|
|
|
52
113
|
|
|
53
114
|
def _register_peer_artifacts_in_parent_context(
|
|
@@ -196,7 +257,7 @@ async def process_event(component, event: Event):
|
|
|
196
257
|
|
|
197
258
|
async def _publish_peer_tool_result_notification(
|
|
198
259
|
component: "SamAgentComponent",
|
|
199
|
-
correlation_data:
|
|
260
|
+
correlation_data: dict[str, Any],
|
|
200
261
|
payload_to_queue: Any,
|
|
201
262
|
log_identifier: str,
|
|
202
263
|
):
|
|
@@ -436,6 +497,34 @@ async def handle_a2a_request(component, message: SolaceMessage):
|
|
|
436
497
|
logical_task_id,
|
|
437
498
|
sub_task_info,
|
|
438
499
|
)
|
|
500
|
+
else:
|
|
501
|
+
# No peer sub-tasks - check if task is paused and needs immediate finalization
|
|
502
|
+
if task_context.get_is_paused():
|
|
503
|
+
log.info(
|
|
504
|
+
"%s Task %s is paused with no peer sub-tasks. Scheduling immediate finalization.",
|
|
505
|
+
component.log_identifier,
|
|
506
|
+
logical_task_id,
|
|
507
|
+
)
|
|
508
|
+
loop = component.get_async_loop()
|
|
509
|
+
if loop and loop.is_running():
|
|
510
|
+
task_context.set_paused(False)
|
|
511
|
+
|
|
512
|
+
asyncio.run_coroutine_threadsafe(
|
|
513
|
+
component.finalize_task_with_cleanup(
|
|
514
|
+
task_context.a2a_context,
|
|
515
|
+
is_paused=False,
|
|
516
|
+
exception=TaskCancelledError(
|
|
517
|
+
f"Task {logical_task_id} cancelled while paused."
|
|
518
|
+
)
|
|
519
|
+
),
|
|
520
|
+
loop,
|
|
521
|
+
)
|
|
522
|
+
else:
|
|
523
|
+
log.error(
|
|
524
|
+
"%s Cannot finalize cancelled paused task %s - event loop not available.",
|
|
525
|
+
component.log_identifier,
|
|
526
|
+
logical_task_id,
|
|
527
|
+
)
|
|
439
528
|
else:
|
|
440
529
|
log.info(
|
|
441
530
|
"%s No active task found for cancellation (ID: %s) or task already completed. Ignoring signal.",
|
|
@@ -465,6 +554,35 @@ async def handle_a2a_request(component, message: SolaceMessage):
|
|
|
465
554
|
# The gateway/client is the source of truth for the task ID.
|
|
466
555
|
# The agent adopts the ID from the JSON-RPC request envelope.
|
|
467
556
|
logical_task_id = str(a2a.get_request_id(a2a_request))
|
|
557
|
+
|
|
558
|
+
try:
|
|
559
|
+
from solace_agent_mesh_enterprise.auth.input_required import (
|
|
560
|
+
a2a_auth_message_handler,
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
try:
|
|
564
|
+
message_handled = await a2a_auth_message_handler(
|
|
565
|
+
component, a2a_message, logical_task_id
|
|
566
|
+
)
|
|
567
|
+
if message_handled:
|
|
568
|
+
message.call_acknowledgements()
|
|
569
|
+
log.debug(
|
|
570
|
+
"%s ACKed message handled by input-required auth handler.",
|
|
571
|
+
component.log_identifier,
|
|
572
|
+
)
|
|
573
|
+
return None
|
|
574
|
+
except Exception as auth_import_err:
|
|
575
|
+
log.error(
|
|
576
|
+
"%s Error in input-required auth handler: %s",
|
|
577
|
+
component.log_identifier,
|
|
578
|
+
auth_import_err,
|
|
579
|
+
)
|
|
580
|
+
message.call_acknowledgements()
|
|
581
|
+
return None
|
|
582
|
+
|
|
583
|
+
except ImportError:
|
|
584
|
+
pass
|
|
585
|
+
|
|
468
586
|
# The session id is now contextId on the message
|
|
469
587
|
original_session_id = a2a_message.context_id
|
|
470
588
|
message_id = a2a_message.message_id
|
|
@@ -490,7 +608,7 @@ async def handle_a2a_request(component, message: SolaceMessage):
|
|
|
490
608
|
)
|
|
491
609
|
else:
|
|
492
610
|
session_behavior = component.default_session_behavior
|
|
493
|
-
log.
|
|
611
|
+
log.debug(
|
|
494
612
|
"%s No 'sessionBehavior' in task metadata. Using component default: '%s'.",
|
|
495
613
|
component.log_identifier,
|
|
496
614
|
session_behavior,
|
|
@@ -632,7 +750,6 @@ async def handle_a2a_request(component, message: SolaceMessage):
|
|
|
632
750
|
"is_streaming": is_streaming_request,
|
|
633
751
|
"statusTopic": status_topic_from_peer,
|
|
634
752
|
"replyToTopic": reply_topic_from_peer,
|
|
635
|
-
"original_solace_message": message,
|
|
636
753
|
"a2a_user_config": a2a_user_config,
|
|
637
754
|
"effective_session_id": effective_session_id,
|
|
638
755
|
"is_run_based_session": is_run_based_session,
|
|
@@ -644,6 +761,7 @@ async def handle_a2a_request(component, message: SolaceMessage):
|
|
|
644
761
|
"system_purpose": system_purpose,
|
|
645
762
|
"response_format": response_format,
|
|
646
763
|
"host_agent_name": agent_name,
|
|
764
|
+
"original_message_metadata": task_metadata, # Store original message metadata for tools
|
|
647
765
|
}
|
|
648
766
|
|
|
649
767
|
# Store verified user identity claims in a2a_context (not the raw token)
|
|
@@ -654,17 +772,28 @@ async def handle_a2a_request(component, message: SolaceMessage):
|
|
|
654
772
|
component.log_identifier,
|
|
655
773
|
logical_task_id,
|
|
656
774
|
)
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
775
|
+
if trace_logger.isEnabledFor(logging.DEBUG):
|
|
776
|
+
trace_logger.debug(
|
|
777
|
+
"%s A2A Context (shared service model): %s",
|
|
778
|
+
component.log_identifier,
|
|
779
|
+
a2a_context,
|
|
780
|
+
)
|
|
781
|
+
else:
|
|
782
|
+
log.debug(
|
|
783
|
+
"%s A2A Context prepared for task %s",
|
|
784
|
+
component.log_identifier,
|
|
785
|
+
a2a_context.get("logical_task_id", "unknown"),
|
|
786
|
+
)
|
|
662
787
|
|
|
663
788
|
# Create and store the execution context for this task
|
|
664
789
|
task_context = TaskExecutionContext(
|
|
665
790
|
task_id=logical_task_id, a2a_context=a2a_context
|
|
666
791
|
)
|
|
667
792
|
|
|
793
|
+
# Store the original Solace message in TaskExecutionContext instead of a2a_context
|
|
794
|
+
# This avoids serialization issues when a2a_context is stored in ADK session state
|
|
795
|
+
task_context.set_original_solace_message(message)
|
|
796
|
+
|
|
668
797
|
# Store auth token for peer delegation using generic security storage
|
|
669
798
|
if hasattr(component, "trust_manager") and component.trust_manager:
|
|
670
799
|
auth_token = message.get_user_properties().get("authToken")
|
|
@@ -760,7 +889,7 @@ async def handle_a2a_request(component, message: SolaceMessage):
|
|
|
760
889
|
streaming_mode = StreamingMode.SSE
|
|
761
890
|
|
|
762
891
|
max_llm_calls_per_task = component.get_config("max_llm_calls_per_task", 20)
|
|
763
|
-
log.
|
|
892
|
+
log.debug(
|
|
764
893
|
"%s Using max_llm_calls_per_task: %s",
|
|
765
894
|
component.log_identifier,
|
|
766
895
|
max_llm_calls_per_task,
|
|
@@ -850,6 +979,101 @@ async def handle_a2a_request(component, message: SolaceMessage):
|
|
|
850
979
|
component.handle_error(e, Event(EventType.MESSAGE, message))
|
|
851
980
|
return None
|
|
852
981
|
|
|
982
|
+
except BadRequestError as e:
|
|
983
|
+
log.error(
|
|
984
|
+
"%s Bad Request error handling A2A request: %s", component.log_identifier, e
|
|
985
|
+
)
|
|
986
|
+
|
|
987
|
+
# Use centralized error handler
|
|
988
|
+
error_message, is_context_limit = get_error_message(e)
|
|
989
|
+
|
|
990
|
+
if is_context_limit:
|
|
991
|
+
log.error(
|
|
992
|
+
"%s Context limit exceeded for task %s",
|
|
993
|
+
component.log_identifier,
|
|
994
|
+
logical_task_id,
|
|
995
|
+
)
|
|
996
|
+
|
|
997
|
+
error_response = a2a.create_invalid_request_error_response(
|
|
998
|
+
message=error_message,
|
|
999
|
+
request_id=jsonrpc_request_id,
|
|
1000
|
+
data={"taskId": logical_task_id},
|
|
1001
|
+
)
|
|
1002
|
+
target_topic = reply_topic_from_peer or (
|
|
1003
|
+
get_client_response_topic(namespace, client_id) if client_id else None
|
|
1004
|
+
)
|
|
1005
|
+
if target_topic:
|
|
1006
|
+
component.publish_a2a_message(
|
|
1007
|
+
error_response.model_dump(exclude_none=True),
|
|
1008
|
+
target_topic,
|
|
1009
|
+
)
|
|
1010
|
+
|
|
1011
|
+
try:
|
|
1012
|
+
message.call_negative_acknowledgements()
|
|
1013
|
+
log.warning(
|
|
1014
|
+
"%s NACKed original A2A request due to bad request error.",
|
|
1015
|
+
component.log_identifier,
|
|
1016
|
+
)
|
|
1017
|
+
except Exception as nack_e:
|
|
1018
|
+
log.error(
|
|
1019
|
+
"%s Failed to NACK message after bad request error: %s",
|
|
1020
|
+
component.log_identifier,
|
|
1021
|
+
nack_e,
|
|
1022
|
+
)
|
|
1023
|
+
|
|
1024
|
+
component.handle_error(e, Event(EventType.MESSAGE, message))
|
|
1025
|
+
return None
|
|
1026
|
+
|
|
1027
|
+
except OperationalError as e:
|
|
1028
|
+
log.error(
|
|
1029
|
+
"%s Database error while processing A2A request: %s",
|
|
1030
|
+
component.log_identifier,
|
|
1031
|
+
e,
|
|
1032
|
+
)
|
|
1033
|
+
|
|
1034
|
+
# Check if it's a schema error
|
|
1035
|
+
error_msg = str(e).lower()
|
|
1036
|
+
if "no such column" in error_msg or "no such table" in error_msg:
|
|
1037
|
+
user_message = (
|
|
1038
|
+
"Database schema update required. "
|
|
1039
|
+
"Please contact your administrator to run database migrations."
|
|
1040
|
+
)
|
|
1041
|
+
else:
|
|
1042
|
+
user_message = (
|
|
1043
|
+
"Database error occurred. Please try again or contact support."
|
|
1044
|
+
)
|
|
1045
|
+
|
|
1046
|
+
error_response = a2a.create_internal_error_response(
|
|
1047
|
+
message=user_message,
|
|
1048
|
+
request_id=jsonrpc_request_id,
|
|
1049
|
+
data={"taskId": logical_task_id} if logical_task_id else None,
|
|
1050
|
+
)
|
|
1051
|
+
|
|
1052
|
+
target_topic = reply_topic_from_peer or (
|
|
1053
|
+
get_client_response_topic(namespace, client_id) if client_id else None
|
|
1054
|
+
)
|
|
1055
|
+
if target_topic:
|
|
1056
|
+
component.publish_a2a_message(
|
|
1057
|
+
error_response.model_dump(exclude_none=True),
|
|
1058
|
+
target_topic,
|
|
1059
|
+
)
|
|
1060
|
+
|
|
1061
|
+
try:
|
|
1062
|
+
message.call_negative_acknowledgements()
|
|
1063
|
+
log.warning(
|
|
1064
|
+
"%s NACKed A2A request due to database error.",
|
|
1065
|
+
component.log_identifier,
|
|
1066
|
+
)
|
|
1067
|
+
except Exception as nack_e:
|
|
1068
|
+
log.error(
|
|
1069
|
+
"%s Failed to NACK message after database error: %s",
|
|
1070
|
+
component.log_identifier,
|
|
1071
|
+
nack_e,
|
|
1072
|
+
)
|
|
1073
|
+
|
|
1074
|
+
component.handle_error(e, Event(EventType.MESSAGE, message))
|
|
1075
|
+
return None
|
|
1076
|
+
|
|
853
1077
|
except Exception as e:
|
|
854
1078
|
log.exception(
|
|
855
1079
|
"%s Unexpected error handling A2A request: %s", component.log_identifier, e
|
|
@@ -926,13 +1150,13 @@ def handle_agent_card_message(component, message: SolaceMessage):
|
|
|
926
1150
|
break
|
|
927
1151
|
|
|
928
1152
|
if is_allowed:
|
|
929
|
-
|
|
1153
|
+
|
|
930
1154
|
# Also store in peer_agents for backward compatibility
|
|
931
1155
|
component.peer_agents[agent_name] = agent_card
|
|
932
1156
|
|
|
933
1157
|
# Store the agent card in the registry for health tracking
|
|
934
1158
|
is_new = component.agent_registry.add_or_update_agent(agent_card)
|
|
935
|
-
|
|
1159
|
+
|
|
936
1160
|
if is_new:
|
|
937
1161
|
log.info(
|
|
938
1162
|
"%s Registered new agent '%s' in registry.",
|
|
@@ -1053,137 +1277,219 @@ async def handle_a2a_response(component, message: SolaceMessage):
|
|
|
1053
1277
|
if isinstance(payload_data, TaskStatusUpdateEvent):
|
|
1054
1278
|
try:
|
|
1055
1279
|
status_event = payload_data
|
|
1280
|
+
|
|
1056
1281
|
data_parts = a2a.get_data_parts_from_status_update(
|
|
1057
1282
|
status_event
|
|
1058
1283
|
)
|
|
1059
1284
|
if data_parts:
|
|
1060
|
-
for data_part in data_parts:
|
|
1061
|
-
log.info(
|
|
1062
|
-
"%s Received DataPart signal from peer for sub-task %s. Forwarding...",
|
|
1063
|
-
component.log_identifier,
|
|
1064
|
-
sub_task_id,
|
|
1065
|
-
)
|
|
1066
|
-
correlation_data = await component._get_correlation_data_for_sub_task(
|
|
1067
|
-
sub_task_id
|
|
1068
|
-
)
|
|
1069
|
-
if not correlation_data:
|
|
1070
|
-
log.warning(
|
|
1071
|
-
"%s Correlation data not found for sub-task %s. Cannot forward status signal.",
|
|
1072
|
-
component.log_identifier,
|
|
1073
|
-
sub_task_id,
|
|
1074
|
-
)
|
|
1075
|
-
message.call_acknowledgements()
|
|
1076
|
-
return
|
|
1077
1285
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1286
|
+
peer_agent_name = (
|
|
1287
|
+
status_event.metadata.get(
|
|
1288
|
+
"agent_name", "UnknownPeer"
|
|
1080
1289
|
)
|
|
1081
|
-
if
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
component.log_identifier,
|
|
1085
|
-
sub_task_id,
|
|
1086
|
-
)
|
|
1087
|
-
message.call_acknowledgements()
|
|
1088
|
-
return
|
|
1290
|
+
if status_event.metadata
|
|
1291
|
+
else "UnknownPeer"
|
|
1292
|
+
)
|
|
1089
1293
|
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
original_jsonrpc_request_id = (
|
|
1094
|
-
original_task_context.get("jsonrpc_request_id")
|
|
1294
|
+
correlation_data = (
|
|
1295
|
+
await component._get_correlation_data_for_sub_task(
|
|
1296
|
+
sub_task_id
|
|
1095
1297
|
)
|
|
1096
|
-
|
|
1097
|
-
|
|
1298
|
+
)
|
|
1299
|
+
if not correlation_data:
|
|
1300
|
+
log.warning(
|
|
1301
|
+
"%s Correlation data not found for sub-task %s. Cannot forward status signal.",
|
|
1302
|
+
component.log_identifier,
|
|
1303
|
+
sub_task_id,
|
|
1098
1304
|
)
|
|
1305
|
+
message.call_acknowledgements()
|
|
1306
|
+
return
|
|
1099
1307
|
|
|
1100
|
-
|
|
1101
|
-
|
|
1308
|
+
original_task_context = correlation_data.get(
|
|
1309
|
+
"original_task_context"
|
|
1310
|
+
)
|
|
1311
|
+
if not original_task_context:
|
|
1312
|
+
log.warning(
|
|
1313
|
+
"%s original_task_context not found in correlation data for sub-task %s. Cannot forward status signal.",
|
|
1314
|
+
component.log_identifier,
|
|
1315
|
+
sub_task_id,
|
|
1102
1316
|
)
|
|
1317
|
+
message.call_acknowledgements()
|
|
1318
|
+
return
|
|
1103
1319
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
component.log_identifier,
|
|
1112
|
-
sub_task_id,
|
|
1113
|
-
original_task_context,
|
|
1114
|
-
)
|
|
1115
|
-
message.call_acknowledgements()
|
|
1116
|
-
return
|
|
1320
|
+
main_logical_task_id = original_task_context.get(
|
|
1321
|
+
"logical_task_id"
|
|
1322
|
+
)
|
|
1323
|
+
original_jsonrpc_request_id = original_task_context.get(
|
|
1324
|
+
"jsonrpc_request_id"
|
|
1325
|
+
)
|
|
1326
|
+
main_context_id = original_task_context.get("contextId")
|
|
1117
1327
|
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
)
|
|
1122
|
-
if status_event.metadata
|
|
1123
|
-
else "UnknownPeer"
|
|
1124
|
-
)
|
|
1328
|
+
target_topic_for_forward = original_task_context.get(
|
|
1329
|
+
"statusTopic"
|
|
1330
|
+
)
|
|
1125
1331
|
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
else None
|
|
1137
|
-
),
|
|
1138
|
-
"function_call_id": correlation_data.get(
|
|
1139
|
-
"adk_function_call_id", None
|
|
1140
|
-
),
|
|
1141
|
-
},
|
|
1332
|
+
if (
|
|
1333
|
+
not main_logical_task_id
|
|
1334
|
+
or not original_jsonrpc_request_id
|
|
1335
|
+
or not target_topic_for_forward
|
|
1336
|
+
):
|
|
1337
|
+
log.error(
|
|
1338
|
+
"%s Missing critical info (main_task_id, original_rpc_id, or target_status_topic) in context for sub-task %s. Cannot forward. Context: %s",
|
|
1339
|
+
component.log_identifier,
|
|
1340
|
+
sub_task_id,
|
|
1341
|
+
original_task_context,
|
|
1142
1342
|
)
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1343
|
+
message.call_acknowledgements()
|
|
1344
|
+
return
|
|
1345
|
+
|
|
1346
|
+
event_metadata = {
|
|
1347
|
+
"agent_name": component.agent_name,
|
|
1348
|
+
"forwarded_from_peer": peer_agent_name,
|
|
1349
|
+
"original_peer_event_taskId": status_event.task_id,
|
|
1350
|
+
"original_peer_event_timestamp": (
|
|
1351
|
+
status_event.status.timestamp
|
|
1352
|
+
if status_event.status
|
|
1353
|
+
and status_event.status.timestamp
|
|
1354
|
+
else None
|
|
1355
|
+
),
|
|
1356
|
+
"function_call_id": correlation_data.get(
|
|
1357
|
+
"adk_function_call_id", None
|
|
1358
|
+
),
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
if (
|
|
1362
|
+
status_event.status.state
|
|
1363
|
+
== TaskState.input_required
|
|
1364
|
+
):
|
|
1365
|
+
log.debug(
|
|
1366
|
+
"%s Received input-required status for sub-task %s. Requesting user input. Forwarding to target.",
|
|
1367
|
+
component.log_identifier,
|
|
1368
|
+
sub_task_id,
|
|
1148
1369
|
)
|
|
1370
|
+
|
|
1149
1371
|
if (
|
|
1150
|
-
status_event.
|
|
1151
|
-
and status_event.
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1372
|
+
status_event.metadata
|
|
1373
|
+
and "task_call_stack" in status_event.metadata
|
|
1374
|
+
and isinstance(
|
|
1375
|
+
status_event.metadata["task_call_stack"],
|
|
1376
|
+
list,
|
|
1155
1377
|
)
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1378
|
+
):
|
|
1379
|
+
task_call_stack = status_event.metadata[
|
|
1380
|
+
"task_call_stack"
|
|
1381
|
+
].copy()
|
|
1382
|
+
task_call_stack.insert(0, sub_task_id)
|
|
1383
|
+
event_metadata["task_call_stack"] = (
|
|
1384
|
+
task_call_stack
|
|
1163
1385
|
)
|
|
1386
|
+
else:
|
|
1387
|
+
event_metadata["task_call_stack"] = [
|
|
1388
|
+
sub_task_id
|
|
1389
|
+
]
|
|
1390
|
+
|
|
1391
|
+
status_event.metadata = event_metadata
|
|
1392
|
+
status_event.task_id = main_logical_task_id
|
|
1393
|
+
|
|
1394
|
+
_forward_jsonrpc_response(
|
|
1395
|
+
component=component,
|
|
1396
|
+
original_jsonrpc_request_id=original_jsonrpc_request_id,
|
|
1397
|
+
result_data=status_event,
|
|
1398
|
+
target_topic=target_topic_for_forward,
|
|
1399
|
+
main_logical_task_id=main_logical_task_id,
|
|
1400
|
+
peer_agent_name=peer_agent_name,
|
|
1401
|
+
message=message,
|
|
1164
1402
|
)
|
|
1403
|
+
# Reset the timeout since we received a status update
|
|
1404
|
+
await component.reset_peer_timeout(sub_task_id)
|
|
1405
|
+
return
|
|
1165
1406
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1407
|
+
# Filter out artifact creation progress from peer agents.
|
|
1408
|
+
# These are implementation details that should not leak across
|
|
1409
|
+
# agent boundaries. Artifacts are properly bubbled up in the
|
|
1410
|
+
# final Task response metadata.
|
|
1411
|
+
filtered_data_parts = []
|
|
1412
|
+
has_deep_research_report = False
|
|
1413
|
+
for data_part in data_parts:
|
|
1414
|
+
if isinstance(data_part.data, dict):
|
|
1415
|
+
data_type = data_part.data.get("type")
|
|
1416
|
+
if data_type == "artifact_creation_progress":
|
|
1417
|
+
log.debug(
|
|
1418
|
+
"%s Filtered out artifact_creation_progress DataPart from peer sub-task %s. Not forwarding to user.",
|
|
1419
|
+
component.log_identifier,
|
|
1420
|
+
sub_task_id,
|
|
1421
|
+
)
|
|
1422
|
+
continue
|
|
1423
|
+
if data_type == "deep_research_report":
|
|
1424
|
+
# Track that we've seen a deep research report
|
|
1425
|
+
# This will be used to suppress text content in the final response
|
|
1426
|
+
has_deep_research_report = True
|
|
1427
|
+
log.info(
|
|
1428
|
+
"%s Detected deep_research_report DataPart from peer sub-task %s. Will suppress text in final response.",
|
|
1429
|
+
component.log_identifier,
|
|
1430
|
+
sub_task_id,
|
|
1431
|
+
)
|
|
1432
|
+
filtered_data_parts.append(data_part)
|
|
1433
|
+
|
|
1434
|
+
# Store the deep research report flag in correlation data for later use
|
|
1435
|
+
if has_deep_research_report:
|
|
1436
|
+
main_logical_task_id_for_flag = original_task_context.get("logical_task_id")
|
|
1437
|
+
with component.active_tasks_lock:
|
|
1438
|
+
task_context_for_flag = component.active_tasks.get(main_logical_task_id_for_flag)
|
|
1439
|
+
if task_context_for_flag:
|
|
1440
|
+
# Store flag in task context to suppress text in final response
|
|
1441
|
+
task_context_for_flag.set_flag("peer_sent_deep_research_report", True)
|
|
1442
|
+
log.info(
|
|
1443
|
+
"%s Set peer_sent_deep_research_report flag for task %s",
|
|
1444
|
+
component.log_identifier,
|
|
1445
|
+
main_logical_task_id_for_flag,
|
|
1446
|
+
)
|
|
1447
|
+
|
|
1448
|
+
# Only forward if there are non-filtered data parts
|
|
1449
|
+
if filtered_data_parts:
|
|
1450
|
+
for data_part in filtered_data_parts:
|
|
1171
1451
|
log.info(
|
|
1172
|
-
"%s
|
|
1452
|
+
"%s Received DataPart signal from peer for sub-task %s. Forwarding...",
|
|
1173
1453
|
component.log_identifier,
|
|
1174
|
-
|
|
1175
|
-
peer_agent_name,
|
|
1176
|
-
target_topic_for_forward,
|
|
1454
|
+
sub_task_id,
|
|
1177
1455
|
)
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
main_logical_task_id,
|
|
1183
|
-
pub_err,
|
|
1456
|
+
|
|
1457
|
+
forwarded_message = a2a.create_agent_parts_message(
|
|
1458
|
+
parts=[data_part],
|
|
1459
|
+
metadata=event_metadata,
|
|
1184
1460
|
)
|
|
1185
|
-
|
|
1461
|
+
|
|
1462
|
+
forwarded_event = a2a.create_status_update(
|
|
1463
|
+
task_id=main_logical_task_id,
|
|
1464
|
+
context_id=main_context_id,
|
|
1465
|
+
message=forwarded_message,
|
|
1466
|
+
is_final=False,
|
|
1467
|
+
)
|
|
1468
|
+
if (
|
|
1469
|
+
status_event.status
|
|
1470
|
+
and status_event.status.timestamp
|
|
1471
|
+
):
|
|
1472
|
+
forwarded_event.status.timestamp = (
|
|
1473
|
+
status_event.status.timestamp
|
|
1474
|
+
)
|
|
1475
|
+
_forward_jsonrpc_response(
|
|
1476
|
+
component=component,
|
|
1477
|
+
original_jsonrpc_request_id=original_jsonrpc_request_id,
|
|
1478
|
+
result_data=forwarded_event,
|
|
1479
|
+
target_topic=target_topic_for_forward,
|
|
1480
|
+
main_logical_task_id=main_logical_task_id,
|
|
1481
|
+
peer_agent_name=peer_agent_name,
|
|
1482
|
+
message=message,
|
|
1483
|
+
)
|
|
1484
|
+
# Reset the timeout since we received a status update
|
|
1485
|
+
await component.reset_peer_timeout(sub_task_id)
|
|
1186
1486
|
return
|
|
1487
|
+
else:
|
|
1488
|
+
log.debug(
|
|
1489
|
+
"%s All DataParts from peer sub-task %s were filtered. Not forwarding.",
|
|
1490
|
+
component.log_identifier,
|
|
1491
|
+
sub_task_id,
|
|
1492
|
+
)
|
|
1187
1493
|
|
|
1188
1494
|
payload_to_queue = status_event.model_dump(
|
|
1189
1495
|
by_alias=True, exclude_none=True
|
|
@@ -1464,6 +1770,16 @@ async def handle_a2a_response(component, message: SolaceMessage):
|
|
|
1464
1770
|
header_text=header_text,
|
|
1465
1771
|
)
|
|
1466
1772
|
)
|
|
1773
|
+
|
|
1774
|
+
# Add guidance about artifact_return responsibility
|
|
1775
|
+
artifact_return_guidance = (
|
|
1776
|
+
f"\n\n**Note:** If any of these artifacts fulfill the user's request, "
|
|
1777
|
+
f"you should return them directly to the user using the "
|
|
1778
|
+
f"{EMBED_DELIMITER_OPEN}artifact_return:filename:version{EMBED_DELIMITER_CLOSE} embed. "
|
|
1779
|
+
f"This is more convenient for the user than just describing the artifacts. "
|
|
1780
|
+
f"Replace 'filename' and 'version' with the actual values from the artifact metadata above."
|
|
1781
|
+
)
|
|
1782
|
+
artifact_summary += artifact_return_guidance
|
|
1467
1783
|
else:
|
|
1468
1784
|
log.warning(
|
|
1469
1785
|
"%s Could not generate artifact summary: missing user_id or session_id in correlation data.",
|
|
@@ -1484,9 +1800,28 @@ async def handle_a2a_response(component, message: SolaceMessage):
|
|
|
1484
1800
|
else:
|
|
1485
1801
|
final_text = str(payload_to_queue)
|
|
1486
1802
|
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1803
|
+
# Check if a deep research report was sent by the peer agent
|
|
1804
|
+
# If so, suppress the verbose text but keep artifact info to use
|
|
1805
|
+
peer_sent_deep_research = task_context.get_flag("peer_sent_deep_research_report", False)
|
|
1806
|
+
if peer_sent_deep_research:
|
|
1807
|
+
# Clear the flag after using it
|
|
1808
|
+
task_context.set_flag("peer_sent_deep_research_report", False)
|
|
1809
|
+
if artifact_summary:
|
|
1810
|
+
full_response_text = (
|
|
1811
|
+
f"{artifact_summary}\n---\n\n"
|
|
1812
|
+
"SUCCESS: Deep research task completed. The report has been delivered to the user "
|
|
1813
|
+
"and is being displayed. Use artifact_return to include the artifact reference "
|
|
1814
|
+
"in your response so users can click on it."
|
|
1815
|
+
)
|
|
1816
|
+
else:
|
|
1817
|
+
full_response_text = (
|
|
1818
|
+
"SUCCESS: Deep research task completed successfully. "
|
|
1819
|
+
"The research report has been delivered to the user."
|
|
1820
|
+
)
|
|
1821
|
+
else:
|
|
1822
|
+
full_response_text = final_text
|
|
1823
|
+
if artifact_summary:
|
|
1824
|
+
full_response_text = f"{artifact_summary}\n---\n\nPeer Agent Response:\n\n{full_response_text}"
|
|
1490
1825
|
|
|
1491
1826
|
await _publish_peer_tool_result_notification(
|
|
1492
1827
|
component=component,
|