agent-engine-runner-shared 0.11.8__tar.gz → 0.11.10__tar.gz
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.
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/CHANGELOG.md +6 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/Dockerfile +1 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/PKG-INFO +5 -5
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/docs/api.md +121 -34
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/pyproject.toml +7 -5
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/__init__.py +2 -0
- agent_engine_runner_shared-0.11.10/src/agent_engine_runner_shared/caller_trace.py +138 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/README.md +30 -6
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/bundle.py +5 -3
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/definitions.py +22 -5
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/executor.py +42 -7
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/authoring.py +3 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/security.py +1 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/runtime.py +7 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/custom_events.py +5 -2
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/error_reporting.py +1 -1
- agent_engine_runner_shared-0.11.10/src/agent_engine_runner_shared/generated/workflow/v1/activity_pb2.py +61 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/v1/activity_pb2.pyi +13 -2
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/v1/state_pb2.py +4 -4
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/v1/state_pb2.pyi +4 -2
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/launcher.py +103 -3
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/mcp_oauth_secret.py +27 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/mcp_tools.py +32 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/models.py +8 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/node_logger.py +5 -3
- agent_engine_runner_shared-0.11.10/src/agent_engine_runner_shared/owner_callback.py +139 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/progress.py +9 -85
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/secure_llm_proxy.py +36 -6
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/secure_wrapper.py +524 -126
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/aer.py +597 -252
- agent_engine_runner_shared-0.11.10/src/agent_engine_runner_shared/server/atlas_dns.py +88 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/base.py +54 -3
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/callback_delivery.py +18 -3
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/drain.py +20 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/http_retry.py +29 -2
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/tool.py +110 -15
- agent_engine_runner_shared-0.11.10/src/agent_engine_runner_shared/startup_state.py +19 -0
- agent_engine_runner_shared-0.11.10/src/agent_engine_runner_shared/tls_client.py +579 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/tool_api_error.py +44 -5
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/utils.py +7 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/__init__.py +16 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/activity.py +76 -6
- agent_engine_runner_shared-0.11.10/src/agent_engine_runner_shared/workflow/cancelled_history.py +268 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/client.py +33 -4
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/context.py +198 -11
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/settlement.py +14 -1
- agent_engine_runner_shared-0.11.10/tests/conftest.py +33 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/connectors/test_bundle.py +19 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/connectors/test_core.py +239 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/connectors/test_generate.py +25 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/connectors/test_materialize.py +12 -0
- agent_engine_runner_shared-0.11.10/tests/unit/test_aer_cancelled_turn.py +374 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_chunk_delivery_reliability.py +48 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_durable_attempt.py +446 -20
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_session_finish.py +30 -9
- agent_engine_runner_shared-0.11.10/tests/unit/test_atlas_dns.py +129 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_drain.py +14 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_durable_guardrail_review.py +59 -4
- agent_engine_runner_shared-0.11.10/tests/unit/test_durable_oauth.py +300 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_durable_proxies.py +5 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_emit_custom_event.py +33 -13
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_emit_progress.py +37 -40
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_function_mode.py +12 -6
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_hitl_interrupt.py +56 -4
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_http_retry.py +100 -5
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_launcher.py +30 -3
- agent_engine_runner_shared-0.11.10/tests/unit/test_launcher_reports.py +390 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_mcp_tools.py +146 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_node_logger.py +28 -53
- agent_engine_runner_shared-0.11.10/tests/unit/test_owner_callback.py +234 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_query_routes.py +1 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_secure_wrapper.py +384 -94
- agent_engine_runner_shared-0.11.10/tests/unit/test_server_startup_failures.py +194 -0
- agent_engine_runner_shared-0.11.10/tests/unit/test_shared_client.py +510 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tls_client.py +15 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tls_client_integration.py +2 -2
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool.py +14 -10
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool_api_error.py +56 -5
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool_server_startup.py +90 -1
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool_trace_context.py +250 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_activity.py +108 -0
- agent_engine_runner_shared-0.11.10/tests/unit/workflow/test_cancelled_history.py +347 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_context.py +147 -0
- agent_engine_runner_shared-0.11.8/src/agent_engine_runner_shared/generated/workflow/v1/activity_pb2.py +0 -59
- agent_engine_runner_shared-0.11.8/src/agent_engine_runner_shared/owner_callback.py +0 -60
- agent_engine_runner_shared-0.11.8/src/agent_engine_runner_shared/tls_client.py +0 -314
- agent_engine_runner_shared-0.11.8/tests/conftest.py +0 -18
- agent_engine_runner_shared-0.11.8/tests/unit/test_owner_callback.py +0 -109
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/LICENSE +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/Makefile +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/README.md +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/pydoc-markdown.yml +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/pyrightconfig.json +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/scripts/agentic-vendored-wheel-check.sh +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/__main__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/a2a.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/a2a_auth.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/agent_config.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/async_utils.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/checkpoint_workspace.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/create_tool.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/README.md +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/catalog.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/modes.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/naming.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/parameters.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/generate/spec.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/connectors/materialize.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/context.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/db_config.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/db_naming.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/execution.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/v1/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/v1/common_pb2.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/v1/common_pb2.pyi +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/v1/runtime_pb2.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/generated/workflow/v1/runtime_pb2.pyi +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/guardrails_evaluator/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/guardrails_evaluator/core.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/guardrails_evaluator/regex.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/hooks.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/http_path.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/mcp_oauth.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/mcp_oauth_cache_lock.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/mcp_oauth_cache_name.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/mcp_oauth_cli.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/memory.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/memory_appbound.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/metrics.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/py.typed +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/runtime.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/auth.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/call_interrupt.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/chunk_types.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/cors.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/function.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/graph_warm.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/metadata.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/oe_url.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/owner_url.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/server/query.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/span_kinds.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/span_names.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/structured_logging.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/tool_memory_ownership.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/toolpod_handlers.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/tracing/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/tracing/exporters.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/tracing/setup.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/types.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/attempt.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/heartbeat.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/memory.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/src/agent_engine_runner_shared/workflow/protojson.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/corpus/.gitignore +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/corpus/README.md +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/corpus/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/corpus/fetch_corpus.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/corpus/manifest.json +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/corpus/test_api_corpus.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/integration/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/integration/mock_embedder.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/integration/test_a2a_trace_propagation.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/integration/test_runtime.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/integration/test_secure_async.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/integration/test_secure_sync.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/integration/test_tracing_otlp_wire_format.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/pact/conftest.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/pact/test_oe_provider_verification.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/connectors/__init__.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/connectors/fixtures/jira.tool_defs.yaml +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/connectors/test_create_tool.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_a2a.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_a2a_auth.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_a2a_registration.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_build_agent_span.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_capability_advertise.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_chunk_emission.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_llm_invocation_signal.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_metadata_payload.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_policy_denied.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_timeout_signal.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_trace_context.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_aer_workspace_scope.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_agent_config.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_async_utils.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_call_interrupt.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_call_interrupt_contract.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_checkpoint_workspace.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_cors.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_create_memory_client_headers.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_custom_headers_context.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_custom_headers_models.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_db_naming.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_debug_hook.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_drain_contract.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_error_reporting.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_execution.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_extract_turn_messages.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_format_llm_error.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_graph_warm.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_guardrails_protocol.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_hooks.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_http_path.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_listen_host.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_llm_credential_classification.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_llm_routing.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_mcp_oauth.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_mcp_oauth_cli.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_mcp_oauth_secret.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_memory_appbound.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_memory_search_metadata.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_memory_writer_context.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_metadata.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_metrics.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_models.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_no_lc_imports.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_oe_url.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_owner_url.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_payload_context.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_request_id_context.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_resume_payload.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_runtime_build_context_from_sources.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_runtime_checkpoint_workspace.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_runtime_custom_memory.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_runtime_memory_context.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_runtime_models.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_runtime_register_tool.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_secure_llm_proxy.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_server_auth.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_server_health.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_server_shutdown.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_session_filesystem_isolation.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_session_finish_context.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_structured_logging.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_thinking_tokens.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_token_capture.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool_authorization.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool_cancellation_boundary.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool_deserialization.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool_log_redaction.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tool_memory_ownership.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_toolpod_handlers.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tracing_exporter.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/test_tracing_retry.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_attempt.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_client.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_heartbeat.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_memory.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_protojson.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_protojson_helpers.py +0 -0
- {agent_engine_runner_shared-0.11.8 → agent_engine_runner_shared-0.11.10}/tests/unit/workflow/test_settlement.py +0 -0
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Changed
|
|
11
|
+
- Reuse a process-wide keep-alive mTLS client for OE callbacks (tool
|
|
12
|
+
execute/result, node events, progress and custom events) and drain callback
|
|
13
|
+
response bodies so connections return to the pool; removes a full TLS
|
|
14
|
+
handshake per callback.
|
|
15
|
+
|
|
10
16
|
### Fixed
|
|
11
17
|
- Uncaught exceptions in agent code now emit one filterable `level=ERROR`
|
|
12
18
|
record instead of only `WARNING`. Ordinary stderr writes with no
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# Usage: docker buildx build -t runner:latest -f packages/python/packages/agent-engine-runner-shared/Dockerfile .
|
|
6
6
|
|
|
7
7
|
ARG BASE_TARGETPLATFORM=linux/amd64
|
|
8
|
-
ARG RUNNER_BASE_IMAGE=664315256653.dkr.ecr.us-east-1.amazonaws.com/base/amazonlinux2023-python:v3.11-
|
|
8
|
+
ARG RUNNER_BASE_IMAGE=664315256653.dkr.ecr.us-east-1.amazonaws.com/base/amazonlinux2023-python:v3.11-202610191636-2ff39c3@sha256:30ecac067fceafe43a5f0f5e80d1725b60708204dcd2fe3f176363417e2a2402
|
|
9
9
|
|
|
10
10
|
FROM --platform=${BASE_TARGETPLATFORM} ghcr.io/astral-sh/uv@sha256:ff07b86af50d4d9391d9daf4ff89ce427bc544f9aae87057e69a1cc0aa369946 AS uv
|
|
11
11
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: agent-engine-runner-shared
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.10
|
|
4
4
|
Summary: Runner SDK - Framework-agnostic agent runtime
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Requires-Python: >=3.11
|
|
8
|
-
Requires-Dist: agent-engine-sdk-memory==0.11.
|
|
9
|
-
Requires-Dist: agent-engine-sdk==0.11.
|
|
8
|
+
Requires-Dist: agent-engine-sdk-memory==0.11.10
|
|
9
|
+
Requires-Dist: agent-engine-sdk==0.11.10
|
|
10
10
|
Requires-Dist: fastapi>=0.141.1
|
|
11
11
|
Requires-Dist: filelock>=3.0.0
|
|
12
12
|
Requires-Dist: httpx-sse>=0.4.0
|
|
@@ -20,8 +20,8 @@ Requires-Dist: python-dotenv>=1.0.0
|
|
|
20
20
|
Requires-Dist: pyyaml>=6.0
|
|
21
21
|
Requires-Dist: regex>=2026.4.4
|
|
22
22
|
Requires-Dist: sentry-sdk>=2.27.0
|
|
23
|
-
Requires-Dist: starlette>=1.
|
|
24
|
-
Requires-Dist: uvicorn>=0.
|
|
23
|
+
Requires-Dist: starlette>=1.7.0
|
|
24
|
+
Requires-Dist: uvicorn>=0.50.0
|
|
25
25
|
Provides-Extra: debug
|
|
26
26
|
Requires-Dist: debugpy>=1.8.0; extra == 'debug'
|
|
27
27
|
Provides-Extra: dev
|
|
@@ -166,6 +166,7 @@
|
|
|
166
166
|
* [register\_guardrail\_policy\_engine](#agent_engine_runner_shared.guardrails_evaluator.core.register_guardrail_policy_engine)
|
|
167
167
|
* [evaluate\_guardrail\_check](#agent_engine_runner_shared.guardrails_evaluator.core.evaluate_guardrail_check)
|
|
168
168
|
* [agent\_engine\_runner\_shared.secure\_llm\_proxy](#agent_engine_runner_shared.secure_llm_proxy)
|
|
169
|
+
* [GuardrailReviewPending](#agent_engine_runner_shared.secure_llm_proxy.GuardrailReviewPending)
|
|
169
170
|
* [guardrail\_review\_wait\_id](#agent_engine_runner_shared.secure_llm_proxy.guardrail_review_wait_id)
|
|
170
171
|
* [SecureLLMProxy](#agent_engine_runner_shared.secure_llm_proxy.SecureLLMProxy)
|
|
171
172
|
* [step\_counter](#agent_engine_runner_shared.secure_llm_proxy.SecureLLMProxy.step_counter)
|
|
@@ -173,14 +174,19 @@
|
|
|
173
174
|
* [response\_from\_stream\_chunks](#agent_engine_runner_shared.secure_llm_proxy.SecureLLMProxy.response_from_stream_chunks)
|
|
174
175
|
* [stream](#agent_engine_runner_shared.secure_llm_proxy.SecureLLMProxy.stream)
|
|
175
176
|
* [agent\_engine\_runner\_shared.secure\_wrapper](#agent_engine_runner_shared.secure_wrapper)
|
|
177
|
+
* [\_OAuthAuthorizationRequired](#agent_engine_runner_shared.secure_wrapper._OAuthAuthorizationRequired)
|
|
178
|
+
* [\_\_init\_\_](#agent_engine_runner_shared.secure_wrapper._OAuthAuthorizationRequired.__init__)
|
|
179
|
+
* [oauth\_authorization\_wait\_id](#agent_engine_runner_shared.secure_wrapper.oauth_authorization_wait_id)
|
|
176
180
|
* [extract\_usage](#agent_engine_runner_shared.secure_wrapper.extract_usage)
|
|
177
181
|
* [PolicyDeniedException](#agent_engine_runner_shared.secure_wrapper.PolicyDeniedException)
|
|
178
182
|
* [OERetryAfterError](#agent_engine_runner_shared.secure_wrapper.OERetryAfterError)
|
|
179
183
|
* [ToolExecutionError](#agent_engine_runner_shared.secure_wrapper.ToolExecutionError)
|
|
184
|
+
* [ToolPlatformError](#agent_engine_runner_shared.secure_wrapper.ToolPlatformError)
|
|
180
185
|
* [TerminalExecutionError](#agent_engine_runner_shared.secure_wrapper.TerminalExecutionError)
|
|
181
186
|
* [raise\_for\_oe\_rejection](#agent_engine_runner_shared.secure_wrapper.raise_for_oe_rejection)
|
|
182
187
|
* [ToolCallTimeoutError](#agent_engine_runner_shared.secure_wrapper.ToolCallTimeoutError)
|
|
183
188
|
* [OperationalStepAllocator](#agent_engine_runner_shared.secure_wrapper.OperationalStepAllocator)
|
|
189
|
+
* [allocation\_count](#agent_engine_runner_shared.secure_wrapper.OperationalStepAllocator.allocation_count)
|
|
184
190
|
* [ExternalAPICallError](#agent_engine_runner_shared.secure_wrapper.ExternalAPICallError)
|
|
185
191
|
* [LLMInvocationError](#agent_engine_runner_shared.secure_wrapper.LLMInvocationError)
|
|
186
192
|
* [request\_oe\_approval](#agent_engine_runner_shared.secure_wrapper.request_oe_approval)
|
|
@@ -2623,6 +2629,16 @@ The proxy packages intercepted invoke_llm requests for the Orchestration Engine
|
|
|
2623
2629
|
and unwraps the streamed OE relay back into sdk-core models. The OE owns
|
|
2624
2630
|
approval, routing, live SSE relay, and final audit/result recording.
|
|
2625
2631
|
|
|
2632
|
+
<a id="agent_engine_runner_shared.secure_llm_proxy.GuardrailReviewPending"></a>
|
|
2633
|
+
|
|
2634
|
+
## GuardrailReviewPending
|
|
2635
|
+
|
|
2636
|
+
```python
|
|
2637
|
+
class GuardrailReviewPending(Exception)
|
|
2638
|
+
```
|
|
2639
|
+
|
|
2640
|
+
A recorded halt whose adapter emits its native wait after the LLM call.
|
|
2641
|
+
|
|
2626
2642
|
<a id="agent_engine_runner_shared.secure_llm_proxy.guardrail_review_wait_id"></a>
|
|
2627
2643
|
|
|
2628
2644
|
#### guardrail\_review\_wait\_id
|
|
@@ -2691,11 +2707,14 @@ Collect streamed sdk-core chunks into a final sdk-core LLMResponse.
|
|
|
2691
2707
|
#### stream
|
|
2692
2708
|
|
|
2693
2709
|
```python
|
|
2694
|
-
def stream(
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2710
|
+
def stream(
|
|
2711
|
+
messages: list[Message],
|
|
2712
|
+
step: int | None = None,
|
|
2713
|
+
stop: list[str] | None = None,
|
|
2714
|
+
options: LLMInvocationOptions | None = None,
|
|
2715
|
+
activity_key: str | None = None,
|
|
2716
|
+
pending_review: GuardrailReviewPending | None = None
|
|
2717
|
+
) -> Iterator[LLMStreamChunk]
|
|
2699
2718
|
```
|
|
2700
2719
|
|
|
2701
2720
|
Stream invoke_llm chunks through OE approval and OE-owned SSE relay.
|
|
@@ -2718,6 +2737,36 @@ This module provides:
|
|
|
2718
2737
|
|
|
2719
2738
|
HITL is handled via LangGraph's native interrupt() / Command(resume=...) API.
|
|
2720
2739
|
|
|
2740
|
+
<a id="agent_engine_runner_shared.secure_wrapper._OAuthAuthorizationRequired"></a>
|
|
2741
|
+
|
|
2742
|
+
## \_OAuthAuthorizationRequired
|
|
2743
|
+
|
|
2744
|
+
```python
|
|
2745
|
+
class _OAuthAuthorizationRequired(Exception)
|
|
2746
|
+
```
|
|
2747
|
+
|
|
2748
|
+
Leave durable dispatch with typed consent control instead of interrupting its activity.
|
|
2749
|
+
|
|
2750
|
+
<a id="agent_engine_runner_shared.secure_wrapper._OAuthAuthorizationRequired.__init__"></a>
|
|
2751
|
+
|
|
2752
|
+
#### \_\_init\_\_
|
|
2753
|
+
|
|
2754
|
+
```python
|
|
2755
|
+
def __init__(elicitation: ElicitationInfo, step: int) -> None
|
|
2756
|
+
```
|
|
2757
|
+
|
|
2758
|
+
Carry the OE response to its activity boundary without exposing it in errors.
|
|
2759
|
+
|
|
2760
|
+
<a id="agent_engine_runner_shared.secure_wrapper.oauth_authorization_wait_id"></a>
|
|
2761
|
+
|
|
2762
|
+
#### oauth\_authorization\_wait\_id
|
|
2763
|
+
|
|
2764
|
+
```python
|
|
2765
|
+
def oauth_authorization_wait_id(value: Any) -> str | None
|
|
2766
|
+
```
|
|
2767
|
+
|
|
2768
|
+
Identify a consent wait only when this attempt recorded the platform's challenge.
|
|
2769
|
+
|
|
2721
2770
|
<a id="agent_engine_runner_shared.secure_wrapper.extract_usage"></a>
|
|
2722
2771
|
|
|
2723
2772
|
#### extract\_usage
|
|
@@ -2768,12 +2817,26 @@ class ToolExecutionError(Exception)
|
|
|
2768
2817
|
|
|
2769
2818
|
Raised when tool execution fails.
|
|
2770
2819
|
|
|
2820
|
+
<a id="agent_engine_runner_shared.secure_wrapper.ToolPlatformError"></a>
|
|
2821
|
+
|
|
2822
|
+
## ToolPlatformError
|
|
2823
|
+
|
|
2824
|
+
```python
|
|
2825
|
+
class ToolPlatformError(ToolExecutionError)
|
|
2826
|
+
```
|
|
2827
|
+
|
|
2828
|
+
Raised when the platform, not the tool, failed a tool call.
|
|
2829
|
+
|
|
2830
|
+
The tool may already have run, for example when OE rejects or never
|
|
2831
|
+
acknowledges its result, so an adapter must not report this to the model as
|
|
2832
|
+
a failed tool it could call again.
|
|
2833
|
+
|
|
2771
2834
|
<a id="agent_engine_runner_shared.secure_wrapper.TerminalExecutionError"></a>
|
|
2772
2835
|
|
|
2773
2836
|
## TerminalExecutionError
|
|
2774
2837
|
|
|
2775
2838
|
```python
|
|
2776
|
-
class TerminalExecutionError(
|
|
2839
|
+
class TerminalExecutionError(ToolPlatformError)
|
|
2777
2840
|
```
|
|
2778
2841
|
|
|
2779
2842
|
Raised when OE rejects a tool call because the execution already ended.
|
|
@@ -2818,6 +2881,16 @@ Process-local operational step_number mint for one AER execution.
|
|
|
2818
2881
|
Shared by SecureToolWrapper and SecureLLMProxy so parallel tools and LLM
|
|
2819
2882
|
calls cannot collide under a single AER. Not a multi-OE authority.
|
|
2820
2883
|
|
|
2884
|
+
<a id="agent_engine_runner_shared.secure_wrapper.OperationalStepAllocator.allocation_count"></a>
|
|
2885
|
+
|
|
2886
|
+
#### allocation\_count
|
|
2887
|
+
|
|
2888
|
+
```python
|
|
2889
|
+
def allocation_count() -> int
|
|
2890
|
+
```
|
|
2891
|
+
|
|
2892
|
+
Count minted request slots independently of replayed step watermarks.
|
|
2893
|
+
|
|
2821
2894
|
<a id="agent_engine_runner_shared.secure_wrapper.ExternalAPICallError"></a>
|
|
2822
2895
|
|
|
2823
2896
|
## ExternalAPICallError
|
|
@@ -3052,24 +3125,30 @@ Clean up resources owned by this execution's wrapper.
|
|
|
3052
3125
|
#### execute\_tool
|
|
3053
3126
|
|
|
3054
3127
|
```python
|
|
3055
|
-
def execute_tool(
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3128
|
+
def execute_tool(
|
|
3129
|
+
tool_name: str,
|
|
3130
|
+
arguments: Dict[str, Any],
|
|
3131
|
+
*,
|
|
3132
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
3133
|
+
provider_type: Optional[str] = None,
|
|
3134
|
+
scopes: Optional[list[str]] = None,
|
|
3135
|
+
tool_call_id: Optional[str] = None,
|
|
3136
|
+
raw_on_interrupt: bool = False,
|
|
3137
|
+
redact_fields: Optional[list[str]] = None,
|
|
3138
|
+
is_local: bool = True,
|
|
3139
|
+
local_executor: Optional[Callable[[], Any]] = None,
|
|
3140
|
+
is_framework_control_flow: Optional[Callable[[BaseException],
|
|
3141
|
+
bool]] = None,
|
|
3142
|
+
call_channel_expected: bool = False,
|
|
3143
|
+
on_unknown_outcome: Optional[UnknownOutcomePolicy] = None) -> Any
|
|
3069
3144
|
```
|
|
3070
3145
|
|
|
3071
3146
|
Execute a tool call through OE.
|
|
3072
3147
|
|
|
3148
|
+
Durable OAuth records a typed challenge before a separate framework
|
|
3149
|
+
wait, then records the actual resource call after reauthorization.
|
|
3150
|
+
Its consent answer never becomes a tool result or Memory content.
|
|
3151
|
+
|
|
3073
3152
|
**Arguments**:
|
|
3074
3153
|
|
|
3075
3154
|
- `tool_name` - Name of the tool
|
|
@@ -3086,6 +3165,9 @@ Execute a tool call through OE.
|
|
|
3086
3165
|
- `is_local` - Whether OE should return the approved call to this AER.
|
|
3087
3166
|
- `local_executor` - Callback that invokes the registered tool on the
|
|
3088
3167
|
current framework stack. Required for local tools.
|
|
3168
|
+
- `on_unknown_outcome` - What a retry does when the runner was lost while
|
|
3169
|
+
this tool was in flight in a durable workflow: ``"rerun"`` runs it
|
|
3170
|
+
again, ``"fail"`` refuses the retry.
|
|
3089
3171
|
|
|
3090
3172
|
|
|
3091
3173
|
**Returns**:
|
|
@@ -3107,20 +3189,22 @@ Execute a tool call through OE.
|
|
|
3107
3189
|
|
|
3108
3190
|
```python
|
|
3109
3191
|
def create_secure_tool_function(
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3192
|
+
original_tool: Any,
|
|
3193
|
+
tool_name: str,
|
|
3194
|
+
*,
|
|
3195
|
+
allow_direct: bool = False,
|
|
3196
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
3197
|
+
is_local: bool = True,
|
|
3198
|
+
provider_type: Optional[str] = None,
|
|
3199
|
+
scopes: Optional[list[str]] = None,
|
|
3200
|
+
response_format: Literal["content",
|
|
3201
|
+
"content_and_artifact"] = "content",
|
|
3202
|
+
tool_declared_format: Optional[Literal["content",
|
|
3203
|
+
"content_and_artifact"]] = None,
|
|
3204
|
+
redact_fields: Optional[list[str]] = None,
|
|
3205
|
+
is_framework_control_flow: Optional[Callable[[BaseException],
|
|
3206
|
+
bool]] = None,
|
|
3207
|
+
on_unknown_outcome: Optional[UnknownOutcomePolicy] = None) -> Callable
|
|
3124
3208
|
```
|
|
3125
3209
|
|
|
3126
3210
|
Create a wrapped tool function that routes through SecureToolWrapper.
|
|
@@ -3140,6 +3224,9 @@ to be built before execution context exists.
|
|
|
3140
3224
|
- `tool_declared_format` - The tool author's own original format, used only
|
|
3141
3225
|
to decide whether a normal result gets shape-matched into a tuple.
|
|
3142
3226
|
Defaults to ``response_format``.
|
|
3227
|
+
- `on_unknown_outcome` - What a retry does when the runner was lost while
|
|
3228
|
+
this tool was in flight in a durable workflow: ``"rerun"`` runs it
|
|
3229
|
+
again, ``"fail"`` refuses the retry.
|
|
3143
3230
|
|
|
3144
3231
|
|
|
3145
3232
|
**Returns**:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agent-engine-runner-shared"
|
|
3
|
-
version = "0.11.
|
|
3
|
+
version = "0.11.10"
|
|
4
4
|
description = "Runner SDK - Framework-agnostic agent runtime"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = {text = "Apache-2.0"}
|
|
@@ -11,8 +11,10 @@ dependencies = [
|
|
|
11
11
|
# floor: older starlette rebuilds url.path from the Host header with no
|
|
12
12
|
# validation, which can disagree with scope["path"]. The
|
|
13
13
|
# Host-validating _HOST_RE landed in starlette 1.4.1.
|
|
14
|
-
"starlette>=1.
|
|
15
|
-
|
|
14
|
+
"starlette>=1.7.0",
|
|
15
|
+
# The launcher relies on uvicorn's STARTUP_FAILURE (exit 3) contract for
|
|
16
|
+
# lifespan startup and bind failures, added in 0.50.0.
|
|
17
|
+
"uvicorn>=0.50.0",
|
|
16
18
|
"pydantic>=2.0.0",
|
|
17
19
|
"protobuf>=6.33.6,<7",
|
|
18
20
|
"httpx>=0.27.0",
|
|
@@ -23,9 +25,9 @@ dependencies = [
|
|
|
23
25
|
"jsonschema>=4.26.0",
|
|
24
26
|
"sentry-sdk>=2.27.0",
|
|
25
27
|
# BaseAgent protocol and AgentInput/AgentEvent models
|
|
26
|
-
"agent-engine-sdk==0.11.
|
|
28
|
+
"agent-engine-sdk==0.11.10",
|
|
27
29
|
# Memory models and the MemoryClient HTTP client
|
|
28
|
-
"agent-engine-sdk-memory==0.11.
|
|
30
|
+
"agent-engine-sdk-memory==0.11.10",
|
|
29
31
|
# Required for checkpoint message decoding (query/sessions endpoints)
|
|
30
32
|
"msgpack>=1.0.0",
|
|
31
33
|
# Required by guardrails_evaluator/regex.py for advanced regex matching
|
|
@@ -96,6 +96,7 @@ from agent_engine_runner_shared.secure_wrapper import (
|
|
|
96
96
|
TerminalExecutionError,
|
|
97
97
|
ToolCallTimeoutError,
|
|
98
98
|
ToolExecutionError,
|
|
99
|
+
ToolPlatformError,
|
|
99
100
|
extract_usage,
|
|
100
101
|
)
|
|
101
102
|
from agent_engine_runner_shared.structured_logging import (
|
|
@@ -190,6 +191,7 @@ __all__ = [
|
|
|
190
191
|
"TerminalExecutionError",
|
|
191
192
|
"ToolCallTimeoutError",
|
|
192
193
|
"ToolExecutionError",
|
|
194
|
+
"ToolPlatformError",
|
|
193
195
|
"ExternalAPICallError",
|
|
194
196
|
# Utilities
|
|
195
197
|
"extract_usage",
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"""Distinguish an inbound caller trace from a root this runner created.
|
|
2
|
+
|
|
3
|
+
AER always starts ``aer.execute``. With no inbound traceparent that span is a
|
|
4
|
+
root, and ``tls_client`` injects it on the call to the OE. The OE forwards
|
|
5
|
+
that header, so the tool process sees a remote parent even though no caller
|
|
6
|
+
trace was bound. W3C traceparent cannot say who created the root, so the
|
|
7
|
+
outgoing tracestate carries ``agentengine=root`` for a runner-created trace.
|
|
8
|
+
Guardrail content is recorded only when that marker is absent.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from contextlib import contextmanager
|
|
14
|
+
from typing import Any, Iterator
|
|
15
|
+
|
|
16
|
+
# Simple W3C tracestate member. A value of "root" means a runner process
|
|
17
|
+
# created this trace; an inbound caller does not set it.
|
|
18
|
+
RUNNER_ROOT_TRACESTATE_KEY = "agentengine"
|
|
19
|
+
RUNNER_ROOT_TRACESTATE_VALUE = "root"
|
|
20
|
+
|
|
21
|
+
_RUNNER_ROOTED_KEY: Any = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _runner_rooted_key() -> Any:
|
|
25
|
+
global _RUNNER_ROOTED_KEY
|
|
26
|
+
if _RUNNER_ROOTED_KEY is None:
|
|
27
|
+
from opentelemetry import context
|
|
28
|
+
|
|
29
|
+
_RUNNER_ROOTED_KEY = context.create_key("agentengine.runner_rooted_trace")
|
|
30
|
+
return _RUNNER_ROOTED_KEY
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def trace_state_marks_runner_root(trace_state: Any) -> bool:
|
|
34
|
+
"""True when tracestate says a runner created this trace's root."""
|
|
35
|
+
if trace_state is None:
|
|
36
|
+
return False
|
|
37
|
+
try:
|
|
38
|
+
marked = RUNNER_ROOT_TRACESTATE_KEY in trace_state
|
|
39
|
+
except TypeError:
|
|
40
|
+
return False
|
|
41
|
+
if not marked:
|
|
42
|
+
return False
|
|
43
|
+
return trace_state[RUNNER_ROOT_TRACESTATE_KEY] == RUNNER_ROOT_TRACESTATE_VALUE
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def merge_runner_root_trace_state(existing: str | None) -> str:
|
|
47
|
+
"""Return tracestate with the runner-root member first, without duplicates."""
|
|
48
|
+
kept: list[str] = []
|
|
49
|
+
prefix = f"{RUNNER_ROOT_TRACESTATE_KEY}="
|
|
50
|
+
for part in (existing or "").split(","):
|
|
51
|
+
item = part.strip()
|
|
52
|
+
if not item or item.startswith(prefix):
|
|
53
|
+
continue
|
|
54
|
+
kept.append(item)
|
|
55
|
+
member = f"{RUNNER_ROOT_TRACESTATE_KEY}={RUNNER_ROOT_TRACESTATE_VALUE}"
|
|
56
|
+
return ",".join([member, *kept])
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def parent_context_is_runner_rooted(parent_context: Any) -> bool:
|
|
60
|
+
"""True when ``parent_context`` is not an inbound caller trace.
|
|
61
|
+
|
|
62
|
+
An invalid extract means this process is about to create the root. A
|
|
63
|
+
remote parent without the runner-root marker was already bound by a caller.
|
|
64
|
+
"""
|
|
65
|
+
from opentelemetry import trace
|
|
66
|
+
|
|
67
|
+
span_context = trace.get_current_span(parent_context).get_span_context()
|
|
68
|
+
if span_context is None or not span_context.is_valid:
|
|
69
|
+
return True
|
|
70
|
+
if trace_state_marks_runner_root(getattr(span_context, "trace_state", None)):
|
|
71
|
+
return True
|
|
72
|
+
if getattr(span_context, "is_remote", False):
|
|
73
|
+
return False
|
|
74
|
+
return True
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def bind_runner_rooted_trace(ctx: Any, rooted: bool) -> Any:
|
|
78
|
+
"""Return ``ctx`` with the runner-rooted flag set for descendant spans."""
|
|
79
|
+
from opentelemetry import context
|
|
80
|
+
|
|
81
|
+
return context.set_value(_runner_rooted_key(), rooted, ctx)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def runner_rooted_trace_active() -> bool:
|
|
85
|
+
"""True when the active span's trace was created by a runner, not a caller.
|
|
86
|
+
|
|
87
|
+
The flag set at span entry wins. Without it, a remote parent that carries
|
|
88
|
+
the marker — or any local root — is treated as runner-created so guardrail
|
|
89
|
+
content stays off unless a caller trace was already bound.
|
|
90
|
+
"""
|
|
91
|
+
try:
|
|
92
|
+
from opentelemetry import context, trace
|
|
93
|
+
except ImportError:
|
|
94
|
+
return False
|
|
95
|
+
|
|
96
|
+
explicit = context.get_value(_runner_rooted_key())
|
|
97
|
+
if explicit is True:
|
|
98
|
+
return True
|
|
99
|
+
if explicit is False:
|
|
100
|
+
return False
|
|
101
|
+
|
|
102
|
+
span = trace.get_current_span()
|
|
103
|
+
span_context = span.get_span_context()
|
|
104
|
+
if trace_state_marks_runner_root(getattr(span_context, "trace_state", None)):
|
|
105
|
+
return True
|
|
106
|
+
parent = getattr(span, "parent", None)
|
|
107
|
+
if parent is not None and getattr(parent, "is_valid", False):
|
|
108
|
+
if trace_state_marks_runner_root(getattr(parent, "trace_state", None)):
|
|
109
|
+
return True
|
|
110
|
+
if getattr(parent, "is_remote", False):
|
|
111
|
+
return False
|
|
112
|
+
# Parent was created in this process and nobody bound a caller trace.
|
|
113
|
+
return True
|
|
114
|
+
if span_context is not None and span_context.is_valid:
|
|
115
|
+
if getattr(span_context, "is_remote", False):
|
|
116
|
+
return trace_state_marks_runner_root(getattr(span_context, "trace_state", None))
|
|
117
|
+
return True
|
|
118
|
+
return False
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@contextmanager
|
|
122
|
+
def runner_trace_scope(parent_context: Any) -> Iterator[None]:
|
|
123
|
+
"""Attach the runner-rooted flag for the span about to be started.
|
|
124
|
+
|
|
125
|
+
``start_as_current_span`` copies the ambient context, so the flag has to
|
|
126
|
+
be attached before the span or nested ``tls_client`` calls will not see it.
|
|
127
|
+
"""
|
|
128
|
+
try:
|
|
129
|
+
from opentelemetry import context as otel_context
|
|
130
|
+
except ImportError:
|
|
131
|
+
yield
|
|
132
|
+
return
|
|
133
|
+
rooted = parent_context_is_runner_rooted(parent_context)
|
|
134
|
+
token = otel_context.attach(bind_runner_rooted_trace(otel_context.get_current(), rooted))
|
|
135
|
+
try:
|
|
136
|
+
yield
|
|
137
|
+
finally:
|
|
138
|
+
otel_context.detach(token)
|
|
@@ -42,6 +42,25 @@ auth:
|
|
|
42
42
|
env: JIRA_TOKEN
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
For delegated OAuth, replace that auth block with an explicit provider binding:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
auth:
|
|
49
|
+
type: oauth
|
|
50
|
+
provider_type: github
|
|
51
|
+
scopes: [repo]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`provider_type` is the key of a provider configured for the project, independent
|
|
55
|
+
of the resource API's base URL. The scopes apply to every exposed operation in
|
|
56
|
+
this connector. Registration carries this policy outside the model's argument
|
|
57
|
+
schema. The Orchestration Engine resolves a credential for the saved application
|
|
58
|
+
user and passes it to the Tool Pod for that invocation. A missing or invalid token
|
|
59
|
+
stops the HTTP call; OAuth never falls back to a tenant environment secret.
|
|
60
|
+
Existing static auth modes continue to use their configured environment bindings.
|
|
61
|
+
Catalog regeneration preserves the authored OAuth binding and records only
|
|
62
|
+
secret-free Bearer presentation in the catalog.
|
|
63
|
+
|
|
45
64
|
The pre-materialized index paths are relative to the index and must remain inside its
|
|
46
65
|
directory. AER loads the schemas as ordinary remote tools. Tool Pod startup loads the
|
|
47
66
|
same materialized view and owns one `ConnectorExecutor` per connector.
|
|
@@ -52,7 +71,9 @@ same materialized view and owns one `ConnectorExecutor` per connector.
|
|
|
52
71
|
|
|
53
72
|
Own one `ConnectorExecutor(definitions)` per connector in a Tool Pod process. Call
|
|
54
73
|
`execute(tool_name, arguments, env=tenant_secrets)` after authorization; the environment
|
|
55
|
-
mapping is request-local and defaults to the tenant-owned process environment
|
|
74
|
+
mapping is request-local and defaults to the tenant-owned process environment for
|
|
75
|
+
static auth. OAuth additionally requires `authorization=ToolAuthorization(...)`;
|
|
76
|
+
the Tool Pod supplies it from request context and the executor never retains it. Close
|
|
56
77
|
the executor at shutdown after in-flight calls finish, or use it as a context manager.
|
|
57
78
|
|
|
58
79
|
The compiled format is the stable `source`, `auth`, `tools`, `params` and
|
|
@@ -86,14 +107,17 @@ Only GET, HEAD and OPTIONS retry 429/503, at most three times; `Retry-After` is
|
|
|
86
107
|
at 30 seconds. Each invocation carries a 30-second budget between requests, redirects,
|
|
87
108
|
response chunks and retry waits. Every request
|
|
88
109
|
uses its remaining budget for HTTPX's standard connect, read, write and pool timeouts;
|
|
89
|
-
the read timeout bounds each blocking read, as defined by HTTPX.
|
|
110
|
+
the read timeout bounds each blocking read, as defined by HTTPX. Requests carry
|
|
111
|
+
`User-Agent: agent-engine-connector` unless the connector sets its own in
|
|
112
|
+
`auth.headers`, matched case-insensitively.
|
|
90
113
|
|
|
91
114
|
HTTP failures, including rejected provider redirects, use `httpx.HTTPStatusError`,
|
|
92
115
|
and transport failures use the existing
|
|
93
116
|
timeout/connection exception types recognized by `classify_tool_api_error`. An HTTP
|
|
94
117
|
error may retain a bounded provider error body (at most 4 KB) so the shared classifier
|
|
95
|
-
can surface the provider's own explanation
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
118
|
+
can surface the provider's own explanation: a recognized JSON error field, or a
|
|
119
|
+
plain-text body that is not HTML markup, up to its first link. The retained body is
|
|
120
|
+
never logged; the classifier applies rudimentary hygiene to the extracted explanation
|
|
121
|
+
— control characters dropped, URL-shaped text rejected, exact credential values
|
|
122
|
+
redacted, result bounded. This is best-effort, not a guarantee. Oversized bodies, redirect locations,
|
|
99
123
|
and credential-bearing request objects are never retained.
|
|
@@ -95,14 +95,16 @@ class BundledTool:
|
|
|
95
95
|
|
|
96
96
|
@property
|
|
97
97
|
def registration_metadata(self) -> dict[str, Any]:
|
|
98
|
-
"""Return
|
|
98
|
+
"""Return detached AER/Tool Pod policy, with delegated binding outside the schema."""
|
|
99
99
|
operation = self.operation
|
|
100
|
+
auth = self.connector.definitions.auth
|
|
101
|
+
delegated = auth if auth is not None and auth.type == "oauth" else None
|
|
100
102
|
return {
|
|
101
103
|
"name": operation.name,
|
|
102
104
|
"description": operation.description.strip() or f"REST connector tool {operation.name}",
|
|
103
105
|
"is_local": False,
|
|
104
|
-
"provider_type": None,
|
|
105
|
-
"scopes": [],
|
|
106
|
+
"provider_type": delegated.provider_type if delegated else None,
|
|
107
|
+
"scopes": list(delegated.scopes) if delegated else [],
|
|
106
108
|
"network": self.network,
|
|
107
109
|
"timeout_seconds": DEFAULT_EXECUTION_TIMEOUT_SECONDS,
|
|
108
110
|
"redact_fields": [],
|
|
@@ -162,8 +162,14 @@ class Credential(_Model):
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
class Auth(_Model):
|
|
165
|
-
type: Literal["none", "bearer", "api_key", "basic", "api_keys"] = Field(
|
|
166
|
-
default="none", description="Static auth presentation"
|
|
165
|
+
type: Literal["none", "bearer", "api_key", "basic", "api_keys", "oauth"] = Field(
|
|
166
|
+
default="none", description="Static auth presentation or request-local delegated OAuth"
|
|
167
|
+
)
|
|
168
|
+
provider_type: str | None = Field(
|
|
169
|
+
default=None, description="Project-scoped Broker provider key"
|
|
170
|
+
)
|
|
171
|
+
scopes: list[str] = Field(
|
|
172
|
+
default_factory=list, description="Connector-wide delegated permissions"
|
|
167
173
|
)
|
|
168
174
|
env: str | None = Field(default=None, description="Tenant secret environment reference")
|
|
169
175
|
header: str | None = Field(default=None, description="API key header name")
|
|
@@ -189,12 +195,23 @@ class Auth(_Model):
|
|
|
189
195
|
"api_key": {"type", "env", "header", "location", "name", "prefix", "headers"},
|
|
190
196
|
"basic": {"type", "username_env", "password_env", "headers"},
|
|
191
197
|
"api_keys": {"type", "credentials", "headers"},
|
|
198
|
+
"oauth": {"type", "provider_type", "scopes", "headers"},
|
|
192
199
|
}[self.type]
|
|
193
200
|
if configured - allowed:
|
|
194
201
|
raise ValueError(f"{self.type} auth contains fields for another auth type")
|
|
195
202
|
|
|
196
203
|
credential_headers: set[str] = set()
|
|
197
|
-
if self.type == "
|
|
204
|
+
if self.type == "oauth":
|
|
205
|
+
if not self.provider_type or any(
|
|
206
|
+
ord(character) <= 32 or ord(character) >= 127 for character in self.provider_type
|
|
207
|
+
):
|
|
208
|
+
raise ValueError("OAuth auth requires an explicit provider key without whitespace")
|
|
209
|
+
if len(set(self.scopes)) != len(self.scopes) or any(
|
|
210
|
+
re.fullmatch(r"[!\x23-\x5B\x5D-\x7E]+", scope) is None for scope in self.scopes
|
|
211
|
+
):
|
|
212
|
+
raise ValueError("OAuth scopes must be unique OAuth scope tokens")
|
|
213
|
+
credential_headers.add("authorization")
|
|
214
|
+
elif self.type == "bearer":
|
|
198
215
|
if not _validate_secret_env(self.env):
|
|
199
216
|
raise ValueError("bearer auth requires one tenant secret env")
|
|
200
217
|
credential_headers.add("authorization")
|
|
@@ -235,7 +252,7 @@ class Auth(_Model):
|
|
|
235
252
|
|
|
236
253
|
def header_name(self) -> str | None:
|
|
237
254
|
"""Return the single generated auth header, when this auth shape has one."""
|
|
238
|
-
if self.type
|
|
255
|
+
if self.type in ("bearer", "oauth"):
|
|
239
256
|
return "Authorization"
|
|
240
257
|
if self.type == "api_key":
|
|
241
258
|
if (self.location or "header") == "header":
|
|
@@ -244,7 +261,7 @@ class Auth(_Model):
|
|
|
244
261
|
|
|
245
262
|
def header_names(self) -> set[str]:
|
|
246
263
|
"""List auth-controlled headers so model parameters cannot collide with them."""
|
|
247
|
-
if self.type in ("bearer", "basic"):
|
|
264
|
+
if self.type in ("bearer", "basic", "oauth"):
|
|
248
265
|
names = {"authorization"}
|
|
249
266
|
elif self.type == "api_key" and (header_name := self.header_name()):
|
|
250
267
|
names = {header_name.lower()}
|