@google/adk 2.3.0 → 2.5.0
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.
- package/dist/cjs/a2a/a2a_remote_agent.js +17 -2
- package/dist/cjs/a2a/a2a_remote_agent_utils.js +8 -4
- package/dist/cjs/a2a/agent_card.js +5 -81
- package/dist/cjs/a2a/agent_to_a2a.js +7 -0
- package/dist/cjs/a2a/event_converter_utils.js +10 -3
- package/dist/cjs/agents/agent_engine_client.js +399 -0
- package/dist/cjs/agents/base_agent.js +127 -68
- package/dist/cjs/agents/functions.js +64 -59
- package/dist/cjs/agents/instructions.js +8 -6
- package/dist/cjs/agents/invocation_context.js +2 -2
- package/dist/cjs/agents/llm_agent.js +124 -101
- package/dist/cjs/agents/processors/basic_llm_request_processor.js +1 -1
- package/dist/cjs/agents/processors/code_execution_request_processor.js +8 -0
- package/dist/cjs/agents/processors/content_processor_utils.js +72 -17
- package/dist/cjs/agents/processors/content_request_processor.js +51 -2
- package/dist/cjs/agents/processors/context_compactor_request_processor.js +5 -1
- package/dist/cjs/agents/processors/instructions_llm_request_processor.js +1 -1
- package/dist/cjs/agents/processors/nl_planning_processor.js +13 -3
- package/dist/cjs/artifacts/file_artifact_service.js +1 -1
- package/dist/cjs/cli/cli_eval.js +884 -17
- package/dist/cjs/cli/utils/cleanup.js +84 -0
- package/dist/cjs/cli/utils/envs.js +33 -2
- package/dist/cjs/cli/utils/evals.js +75 -8
- package/dist/cjs/cli/utils/logs.js +134 -15
- package/dist/cjs/cli/utils/path_validation.js +83 -0
- package/dist/cjs/code_executors/container_code_executor.js +171 -38
- package/dist/cjs/code_executors/unsafe_local_code_executor.js +6 -1
- package/dist/cjs/common.js +59 -32
- package/dist/cjs/context/compaction_utils.js +19 -0
- package/dist/cjs/errors/input_validation_error.js +3 -2
- package/dist/cjs/events/event.js +7 -3
- package/dist/cjs/features/feature_registry.js +5 -0
- package/dist/cjs/index.js +34 -12
- package/dist/cjs/models/google_llm.js +33 -2
- package/dist/cjs/models/interactions_utils.js +3 -0
- package/dist/cjs/plugins/base_plugin.js +54 -40
- package/dist/cjs/plugins/plugin_manager.js +27 -0
- package/dist/cjs/runner/runner.js +306 -189
- package/dist/cjs/sessions/base_session_service.js +15 -12
- package/dist/cjs/sessions/database_session_service.js +232 -38
- package/dist/cjs/sessions/db/operations.js +70 -1
- package/dist/cjs/sessions/db/schema.js +4 -0
- package/dist/cjs/sessions/in_memory_session_service.js +2 -2
- package/dist/cjs/sessions/stale_session_error.js +59 -0
- package/dist/cjs/sessions/vertex_ai_session_service.js +11 -3
- package/dist/cjs/skills/loader.js +76 -41
- package/dist/cjs/telemetry/api/instrumentation.js +632 -0
- package/dist/cjs/telemetry/api/internal/common/accumulators.js +169 -0
- package/dist/cjs/telemetry/api/internal/common/attributes.js +131 -0
- package/dist/cjs/telemetry/api/internal/common/config.js +159 -0
- package/dist/cjs/telemetry/api/internal/common/error.js +98 -0
- package/dist/cjs/telemetry/api/internal/common/finish_reason.js +63 -0
- package/dist/cjs/telemetry/api/internal/common/genai_messages.js +217 -0
- package/dist/cjs/telemetry/api/internal/common/http_exchange.js +169 -0
- package/dist/cjs/telemetry/api/internal/common/provider_name.js +87 -0
- package/dist/cjs/telemetry/api/internal/common/redaction.js +148 -0
- package/dist/cjs/telemetry/api/internal/common/serialization.js +58 -0
- package/dist/cjs/telemetry/api/internal/common/token_usage.js +118 -0
- package/dist/cjs/telemetry/api/internal/logs/inference.js +50 -0
- package/dist/cjs/telemetry/api/internal/logs/logger.js +46 -0
- package/dist/cjs/telemetry/api/internal/logs/mcp.js +141 -0
- package/dist/cjs/telemetry/api/internal/metrics/agent.js +128 -0
- package/dist/cjs/telemetry/api/internal/metrics/inference_start_hook.js +56 -0
- package/dist/cjs/telemetry/api/internal/metrics/meters.js +189 -0
- package/dist/cjs/telemetry/api/internal/metrics/tool.js +147 -0
- package/dist/cjs/telemetry/api/internal/metrics/workflow.js +132 -0
- package/dist/cjs/telemetry/api/internal/trace/agent.js +52 -0
- package/dist/cjs/telemetry/api/internal/trace/compaction.js +78 -0
- package/dist/cjs/telemetry/api/internal/trace/inference.js +132 -0
- package/dist/cjs/telemetry/api/internal/trace/live.js +52 -0
- package/dist/cjs/telemetry/api/internal/trace/node.js +73 -0
- package/dist/cjs/telemetry/api/internal/trace/propagation.js +67 -0
- package/dist/cjs/telemetry/api/internal/trace/tool.js +122 -0
- package/dist/cjs/telemetry/api/internal/trace/tracer.js +77 -0
- package/dist/cjs/telemetry/api/internal/trace/workflow.js +77 -0
- package/dist/cjs/telemetry/export/agent_engine.js +90 -0
- package/dist/cjs/telemetry/export/agent_runtime.js +73 -0
- package/dist/cjs/telemetry/export/google_cloud.js +763 -0
- package/dist/cjs/telemetry/export/request_driven_metric_reader.js +303 -0
- package/dist/cjs/telemetry/{setup.js → export/setup.js} +72 -6
- package/dist/cjs/tools/agent_tool.js +9 -1
- package/dist/cjs/tools/apihub_tool/apihub_toolset.js +18 -23
- package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +109 -43
- package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +222 -114
- package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +34 -14
- package/dist/cjs/tools/application_integration_tool/integration_connector_tool.js +175 -0
- package/dist/cjs/tools/base_toolset.js +1 -1
- package/dist/cjs/tools/computer_use/base_computer.js +125 -0
- package/dist/cjs/tools/computer_use/computer_use_actions.js +502 -0
- package/dist/cjs/tools/computer_use/computer_use_tool.js +244 -0
- package/dist/cjs/tools/computer_use/computer_use_toolset.js +360 -0
- package/dist/cjs/tools/function_tool.js +15 -5
- package/dist/cjs/tools/google_api_tool/google_api_tool.js +4 -1
- package/dist/cjs/tools/google_api_tool/google_api_toolset.js +174 -0
- package/dist/cjs/tools/google_api_tool/google_api_toolsets.js +124 -0
- package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +5 -3
- package/dist/cjs/tools/google_api_tool/index.js +20 -23
- package/dist/cjs/tools/load_artifacts_tool.js +27 -11
- package/dist/cjs/tools/load_memory_tool.js +14 -15
- package/dist/cjs/tools/mcp/mcp_session_manager.js +23 -3
- package/dist/cjs/tools/mcp/mcp_tool.js +7 -3
- package/dist/cjs/tools/mcp/mcp_toolset.js +19 -20
- package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +30 -29
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +4 -4
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
- package/dist/cjs/tools/openapi_tool/openapi_toolset.js +7 -13
- package/dist/cjs/tools/openapi_tool/rest_api_tool.js +57 -10
- package/dist/cjs/tools/skill/load_skill_resource_tool.js +7 -0
- package/dist/cjs/tools/skill/load_skill_tool.js +3 -0
- package/dist/cjs/tools/skill/run_skill_script_tool.js +12 -2
- package/dist/cjs/tools/toolbox_toolset.js +193 -0
- package/dist/cjs/tools/webmcp/webmcp_toolset.js +1 -14
- package/dist/cjs/utils/async_queue.js +37 -3
- package/dist/cjs/utils/client_labels.js +17 -2
- package/dist/cjs/utils/env_aware_utils.js +13 -7
- package/dist/cjs/utils/error_utils.js +40 -2
- package/dist/cjs/utils/failover_utils.js +11 -10
- package/dist/cjs/utils/gemini_schema_util.js +145 -14
- package/dist/cjs/utils/id_provider.js +63 -0
- package/dist/cjs/utils/logger_node.js +4 -0
- package/dist/cjs/utils/model_name.js +15 -0
- package/dist/cjs/utils/output_schema_utils.js +5 -2
- package/dist/cjs/utils/simple_zod_to_json.js +13 -31
- package/dist/cjs/utils/ssrf_guard.js +46 -16
- package/dist/cjs/utils/task.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/workflow/index.js +2 -0
- package/dist/cjs/workflow/node_runner.js +24 -80
- package/dist/cjs/workflow/nodes/parallel_worker.js +18 -7
- package/dist/cjs/workflow/run_llm_agent_as_node.js +19 -14
- package/dist/cjs/workflow/utils/retry_utils.js +2 -2
- package/dist/cjs/workflow/workflow.js +12 -12
- package/dist/esm/a2a/a2a_remote_agent.js +23 -3
- package/dist/esm/a2a/a2a_remote_agent_utils.js +8 -4
- package/dist/esm/a2a/agent_card.js +5 -83
- package/dist/esm/a2a/agent_to_a2a.js +7 -0
- package/dist/esm/a2a/event_converter_utils.js +10 -3
- package/dist/esm/agents/agent_engine_client.js +382 -0
- package/dist/esm/agents/base_agent.js +127 -72
- package/dist/esm/agents/functions.js +69 -63
- package/dist/esm/agents/instructions.js +8 -6
- package/dist/esm/agents/invocation_context.js +2 -2
- package/dist/esm/agents/llm_agent.js +130 -106
- package/dist/esm/agents/processors/basic_llm_request_processor.js +1 -1
- package/dist/esm/agents/processors/code_execution_request_processor.js +8 -0
- package/dist/esm/agents/processors/content_processor_utils.js +72 -17
- package/dist/esm/agents/processors/content_request_processor.js +51 -2
- package/dist/esm/agents/processors/context_compactor_request_processor.js +5 -1
- package/dist/esm/agents/processors/instructions_llm_request_processor.js +1 -1
- package/dist/esm/agents/processors/nl_planning_processor.js +13 -3
- package/dist/esm/artifacts/file_artifact_service.js +1 -1
- package/dist/esm/cli/cli_eval.js +880 -17
- package/dist/esm/cli/utils/cleanup.js +56 -0
- package/dist/esm/cli/utils/envs.js +33 -2
- package/dist/esm/cli/utils/evals.js +74 -8
- package/dist/esm/cli/utils/logs.js +132 -13
- package/dist/esm/cli/utils/path_validation.js +45 -0
- package/dist/esm/code_executors/container_code_executor.js +171 -38
- package/dist/esm/code_executors/unsafe_local_code_executor.js +6 -1
- package/dist/esm/common.js +59 -19
- package/dist/esm/context/compaction_utils.js +19 -0
- package/dist/esm/errors/input_validation_error.js +3 -2
- package/dist/esm/events/event.js +7 -3
- package/dist/esm/features/feature_registry.js +5 -0
- package/dist/esm/index.js +36 -10
- package/dist/esm/models/google_llm.js +33 -2
- package/dist/esm/models/interactions_utils.js +3 -0
- package/dist/esm/plugins/base_plugin.js +54 -40
- package/dist/esm/plugins/plugin_manager.js +27 -0
- package/dist/esm/runner/runner.js +310 -192
- package/dist/esm/sessions/base_session_service.js +13 -11
- package/dist/esm/sessions/database_session_service.js +231 -38
- package/dist/esm/sessions/db/operations.js +70 -1
- package/dist/esm/sessions/db/schema.js +4 -0
- package/dist/esm/sessions/in_memory_session_service.js +2 -2
- package/dist/esm/sessions/stale_session_error.js +31 -0
- package/dist/esm/sessions/vertex_ai_session_service.js +11 -3
- package/dist/esm/skills/loader.js +76 -41
- package/dist/esm/telemetry/api/instrumentation.js +655 -0
- package/dist/esm/telemetry/api/internal/common/accumulators.js +139 -0
- package/dist/esm/telemetry/api/internal/common/attributes.js +94 -0
- package/dist/esm/telemetry/api/internal/common/config.js +128 -0
- package/dist/esm/telemetry/api/internal/common/error.js +69 -0
- package/dist/esm/telemetry/api/internal/common/finish_reason.js +35 -0
- package/dist/esm/telemetry/api/internal/common/genai_messages.js +188 -0
- package/dist/esm/telemetry/api/internal/common/http_exchange.js +142 -0
- package/dist/esm/telemetry/api/internal/common/provider_name.js +59 -0
- package/dist/esm/telemetry/api/internal/common/redaction.js +121 -0
- package/dist/esm/telemetry/api/internal/common/serialization.js +30 -0
- package/dist/esm/telemetry/api/internal/common/token_usage.js +85 -0
- package/dist/esm/telemetry/api/internal/logs/inference.js +23 -0
- package/dist/esm/telemetry/api/internal/logs/logger.js +19 -0
- package/dist/esm/telemetry/api/internal/logs/mcp.js +113 -0
- package/dist/esm/telemetry/api/internal/metrics/agent.js +107 -0
- package/dist/esm/telemetry/api/internal/metrics/inference_start_hook.js +29 -0
- package/dist/esm/telemetry/api/internal/metrics/meters.js +165 -0
- package/dist/esm/telemetry/api/internal/metrics/tool.js +119 -0
- package/dist/esm/telemetry/api/internal/metrics/workflow.js +112 -0
- package/dist/esm/telemetry/api/internal/trace/agent.js +25 -0
- package/dist/esm/telemetry/api/internal/trace/compaction.js +50 -0
- package/dist/esm/telemetry/api/internal/trace/inference.js +107 -0
- package/dist/esm/telemetry/api/internal/trace/live.js +28 -0
- package/dist/esm/telemetry/api/internal/trace/node.js +44 -0
- package/dist/esm/telemetry/api/internal/trace/propagation.js +39 -0
- package/dist/esm/telemetry/api/internal/trace/tool.js +96 -0
- package/dist/esm/telemetry/api/internal/trace/tracer.js +52 -0
- package/dist/esm/telemetry/api/internal/trace/workflow.js +54 -0
- package/dist/esm/telemetry/export/agent_engine.js +67 -0
- package/dist/esm/telemetry/export/agent_runtime.js +46 -0
- package/dist/esm/telemetry/export/google_cloud.js +733 -0
- package/dist/esm/telemetry/export/request_driven_metric_reader.js +276 -0
- package/dist/esm/telemetry/export/setup.js +160 -0
- package/dist/esm/tools/agent_tool.js +9 -1
- package/dist/esm/tools/apihub_tool/apihub_toolset.js +17 -22
- package/dist/esm/tools/application_integration_tool/application_integration_toolset.js +114 -44
- package/dist/esm/tools/application_integration_tool/clients/connections_client.js +226 -115
- package/dist/esm/tools/application_integration_tool/clients/integration_client.js +34 -14
- package/dist/esm/tools/application_integration_tool/integration_connector_tool.js +149 -0
- package/dist/esm/tools/base_toolset.js +1 -1
- package/dist/esm/tools/computer_use/base_computer.js +99 -0
- package/dist/esm/tools/computer_use/computer_use_actions.js +477 -0
- package/dist/esm/tools/computer_use/computer_use_tool.js +217 -0
- package/dist/esm/tools/computer_use/computer_use_toolset.js +344 -0
- package/dist/esm/tools/function_tool.js +15 -5
- package/dist/esm/tools/google_api_tool/google_api_tool.js +4 -1
- package/dist/esm/tools/google_api_tool/google_api_toolset.js +147 -0
- package/dist/esm/tools/google_api_tool/google_api_toolsets.js +94 -0
- package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +5 -3
- package/dist/esm/tools/google_api_tool/index.js +18 -20
- package/dist/esm/tools/load_artifacts_tool.js +25 -10
- package/dist/esm/tools/load_memory_tool.js +14 -15
- package/dist/esm/tools/mcp/mcp_session_manager.js +23 -3
- package/dist/esm/tools/mcp/mcp_tool.js +7 -3
- package/dist/esm/tools/mcp/mcp_toolset.js +19 -20
- package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +27 -26
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +4 -4
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
- package/dist/esm/tools/openapi_tool/openapi_toolset.js +6 -12
- package/dist/esm/tools/openapi_tool/rest_api_tool.js +57 -10
- package/dist/esm/tools/skill/load_skill_resource_tool.js +7 -0
- package/dist/esm/tools/skill/load_skill_tool.js +3 -0
- package/dist/esm/tools/skill/run_skill_script_tool.js +12 -2
- package/dist/esm/tools/toolbox_toolset.js +167 -0
- package/dist/esm/tools/webmcp/webmcp_toolset.js +1 -14
- package/dist/esm/utils/async_queue.js +37 -3
- package/dist/esm/utils/client_labels.js +17 -2
- package/dist/esm/utils/env_aware_utils.js +12 -7
- package/dist/esm/utils/error_utils.js +37 -1
- package/dist/esm/utils/failover_utils.js +11 -10
- package/dist/esm/utils/gemini_schema_util.js +144 -14
- package/dist/esm/utils/id_provider.js +33 -0
- package/dist/esm/utils/logger_node.js +4 -0
- package/dist/esm/utils/model_name.js +14 -0
- package/dist/esm/utils/output_schema_utils.js +5 -2
- package/dist/esm/utils/simple_zod_to_json.js +13 -31
- package/dist/esm/utils/ssrf_guard.js +55 -15
- package/dist/esm/utils/task.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/workflow/index.js +2 -1
- package/dist/esm/workflow/node_runner.js +26 -80
- package/dist/esm/workflow/nodes/parallel_worker.js +16 -6
- package/dist/esm/workflow/run_llm_agent_as_node.js +19 -14
- package/dist/esm/workflow/utils/retry_utils.js +2 -2
- package/dist/esm/workflow/workflow.js +12 -12
- package/dist/types/a2a/a2a_remote_agent.d.ts +6 -0
- package/dist/types/a2a/a2a_remote_agent_utils.d.ts +3 -2
- package/dist/types/agents/agent_engine_client.d.ts +155 -0
- package/dist/types/agents/base_agent.d.ts +14 -0
- package/dist/types/agents/llm_agent.d.ts +5 -1
- package/dist/types/agents/processors/content_processor_utils.d.ts +12 -10
- package/dist/types/agents/processors/nl_planning_processor.d.ts +2 -1
- package/dist/types/agents/run_config.d.ts +14 -0
- package/dist/types/cli/cli_eval.d.ts +172 -9
- package/dist/types/cli/utils/cleanup.d.ts +18 -0
- package/dist/types/cli/utils/envs.d.ts +13 -3
- package/dist/types/cli/utils/evals.d.ts +64 -1
- package/dist/types/cli/utils/logs.d.ts +20 -3
- package/dist/types/cli/utils/path_validation.d.ts +30 -0
- package/dist/types/code_executors/container_code_executor.d.ts +62 -9
- package/dist/types/common.d.ts +21 -18
- package/dist/types/context/compaction_utils.d.ts +13 -1
- package/dist/types/errors/input_validation_error.d.ts +2 -1
- package/dist/types/events/event.d.ts +3 -0
- package/dist/types/features/feature_registry.d.ts +1 -0
- package/dist/types/index.d.ts +11 -6
- package/dist/types/plugins/base_plugin.d.ts +50 -31
- package/dist/types/plugins/plugin_manager.d.ts +13 -0
- package/dist/types/runner/runner.d.ts +11 -0
- package/dist/types/sessions/base_session_service.d.ts +5 -2
- package/dist/types/sessions/database_session_service.d.ts +17 -1
- package/dist/types/sessions/db/operations.d.ts +2 -1
- package/dist/types/sessions/db/schema.d.ts +5 -3
- package/dist/types/sessions/stale_session_error.d.ts +21 -0
- package/dist/types/skills/loader.d.ts +3 -2
- package/dist/types/telemetry/api/instrumentation.d.ts +259 -0
- package/dist/types/telemetry/api/internal/common/accumulators.d.ts +91 -0
- package/dist/types/telemetry/api/internal/common/attributes.d.ts +90 -0
- package/dist/types/telemetry/api/internal/common/config.d.ts +61 -0
- package/dist/types/telemetry/api/internal/common/error.d.ts +29 -0
- package/dist/types/telemetry/api/internal/common/finish_reason.d.ts +18 -0
- package/dist/types/telemetry/api/internal/common/genai_messages.d.ts +26 -0
- package/dist/types/telemetry/api/internal/common/http_exchange.d.ts +50 -0
- package/dist/types/telemetry/api/internal/common/provider_name.d.ts +16 -0
- package/dist/types/telemetry/api/internal/common/redaction.d.ts +14 -0
- package/dist/types/telemetry/api/internal/common/serialization.d.ts +18 -0
- package/dist/types/telemetry/api/internal/common/token_usage.d.ts +47 -0
- package/dist/types/telemetry/api/internal/logs/inference.d.ts +15 -0
- package/dist/types/telemetry/api/internal/logs/logger.d.ts +13 -0
- package/dist/types/telemetry/api/internal/logs/mcp.d.ts +31 -0
- package/dist/types/telemetry/api/internal/metrics/agent.d.ts +28 -0
- package/dist/types/telemetry/api/internal/metrics/inference_start_hook.d.ts +12 -0
- package/dist/types/telemetry/api/internal/metrics/meters.d.ts +57 -0
- package/dist/types/telemetry/api/internal/metrics/tool.d.ts +44 -0
- package/dist/types/telemetry/api/internal/metrics/workflow.d.ts +32 -0
- package/dist/types/telemetry/api/internal/trace/agent.d.ts +14 -0
- package/dist/types/telemetry/api/internal/trace/compaction.d.ts +20 -0
- package/dist/types/telemetry/api/internal/trace/inference.d.ts +31 -0
- package/dist/types/telemetry/api/internal/trace/live.d.ts +21 -0
- package/dist/types/telemetry/api/internal/trace/node.d.ts +22 -0
- package/dist/types/telemetry/api/internal/trace/propagation.d.ts +22 -0
- package/dist/types/telemetry/api/internal/trace/tool.d.ts +57 -0
- package/dist/types/telemetry/api/internal/trace/tracer.d.ts +31 -0
- package/dist/types/telemetry/api/internal/trace/workflow.d.ts +21 -0
- package/dist/types/telemetry/export/agent_engine.d.ts +23 -0
- package/dist/types/telemetry/export/agent_runtime.d.ts +40 -0
- package/dist/types/telemetry/export/google_cloud.d.ts +189 -0
- package/dist/types/telemetry/export/request_driven_metric_reader.d.ts +144 -0
- package/dist/types/telemetry/{setup.d.ts → export/setup.d.ts} +3 -0
- package/dist/types/tools/agent_tool.d.ts +1 -1
- package/dist/types/tools/apihub_tool/apihub_toolset.d.ts +14 -21
- package/dist/types/tools/application_integration_tool/application_integration_toolset.d.ts +32 -9
- package/dist/types/tools/application_integration_tool/clients/connections_client.d.ts +35 -12
- package/dist/types/tools/application_integration_tool/clients/integration_client.d.ts +3 -3
- package/dist/types/tools/application_integration_tool/integration_connector_tool.d.ts +70 -0
- package/dist/types/tools/base_toolset.d.ts +7 -6
- package/dist/types/tools/computer_use/base_computer.d.ts +281 -0
- package/dist/types/tools/computer_use/computer_use_actions.d.ts +53 -0
- package/dist/types/tools/computer_use/computer_use_tool.d.ts +108 -0
- package/dist/types/tools/computer_use/computer_use_toolset.d.ts +132 -0
- package/dist/types/tools/google_api_tool/google_api_tool.d.ts +10 -3
- package/dist/types/tools/google_api_tool/google_api_toolset.d.ts +57 -0
- package/dist/types/tools/google_api_tool/google_api_toolsets.d.ts +48 -0
- package/dist/types/tools/google_api_tool/googleapi_to_openapi_converter.d.ts +5 -4
- package/dist/types/tools/google_api_tool/index.d.ts +4 -5
- package/dist/types/tools/load_artifacts_tool.d.ts +18 -1
- package/dist/types/tools/load_memory_tool.d.ts +32 -4
- package/dist/types/tools/mcp/mcp_session_manager.d.ts +16 -0
- package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +8 -8
- package/dist/types/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.d.ts +12 -0
- package/dist/types/tools/openapi_tool/openapi_spec_parser/operation_parser.d.ts +15 -3
- package/dist/types/tools/openapi_tool/openapi_toolset.d.ts +5 -0
- package/dist/types/tools/openapi_tool/rest_api_tool.d.ts +10 -0
- package/dist/types/tools/toolbox_toolset.d.ts +154 -0
- package/dist/types/utils/async_queue.d.ts +14 -0
- package/dist/types/utils/client_labels.d.ts +2 -1
- package/dist/types/utils/env_aware_utils.d.ts +11 -0
- package/dist/types/utils/error_utils.d.ts +4 -0
- package/dist/types/utils/gemini_schema_util.d.ts +29 -0
- package/dist/types/utils/id_provider.d.ts +43 -0
- package/dist/types/utils/model_name.d.ts +8 -0
- package/dist/types/utils/output_schema_utils.d.ts +3 -2
- package/dist/types/utils/simple_zod_to_json.d.ts +1 -2
- package/dist/types/utils/ssrf_guard.d.ts +2 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/workflow/index.d.ts +1 -1
- package/dist/types/workflow/nodes/parallel_worker.d.ts +8 -1
- package/dist/web/index_web.js +94 -88
- package/dist/web/index_web.js.map +4 -4
- package/package.json +43 -38
- package/dist/cjs/agents/remote_agent.js +0 -187
- package/dist/cjs/telemetry/google_cloud.js +0 -116
- package/dist/cjs/telemetry/tracing.js +0 -350
- package/dist/cjs/tools/crewai_tool.js +0 -132
- package/dist/cjs/tools/google_api_tool/google_api_tool_set.js +0 -226
- package/dist/cjs/tools/google_api_tool/google_api_tool_sets.js +0 -58
- package/dist/cjs/tools/langchain_tool.js +0 -172
- package/dist/cjs/tools/toolbox_tool.js +0 -108
- package/dist/esm/agents/remote_agent.js +0 -164
- package/dist/esm/telemetry/google_cloud.js +0 -99
- package/dist/esm/telemetry/setup.js +0 -89
- package/dist/esm/telemetry/tracing.js +0 -315
- package/dist/esm/tools/crewai_tool.js +0 -107
- package/dist/esm/tools/google_api_tool/google_api_tool_set.js +0 -188
- package/dist/esm/tools/google_api_tool/google_api_tool_sets.js +0 -24
- package/dist/esm/tools/langchain_tool.js +0 -148
- package/dist/esm/tools/toolbox_tool.js +0 -80
- package/dist/types/agents/remote_agent.d.ts +0 -68
- package/dist/types/telemetry/google_cloud.d.ts +0 -9
- package/dist/types/telemetry/tracing.d.ts +0 -129
- package/dist/types/tools/crewai_tool.d.ts +0 -85
- package/dist/types/tools/google_api_tool/google_api_tool_set.d.ts +0 -78
- package/dist/types/tools/google_api_tool/google_api_tool_sets.d.ts +0 -33
- package/dist/types/tools/langchain_tool.d.ts +0 -103
- package/dist/types/tools/toolbox_tool.d.ts +0 -73
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Resource } from '@opentelemetry/resources';
|
|
7
|
+
import { BatchLogRecordProcessor, BatchLogRecordProcessorOptions, LogRecordExporter, ReadWriteLogRecord } from '@opentelemetry/sdk-logs';
|
|
8
|
+
import { AggregationTemporality, InstrumentType, PushMetricExporter, ResourceMetrics } from '@opentelemetry/sdk-metrics';
|
|
9
|
+
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
10
|
+
import { GoogleAuth } from 'google-auth-library';
|
|
11
|
+
import { agentRuntimeRequestHooks, type AgentRuntimeRequestHooks } from './agent_runtime.js';
|
|
12
|
+
import { OtelExportersConfig, OTelHooks } from './setup.js';
|
|
13
|
+
export { agentRuntimeRequestHooks, type AgentRuntimeRequestHooks };
|
|
14
|
+
/**
|
|
15
|
+
* Resolved project identifiers from the Cloud Resource Manager API.
|
|
16
|
+
*/
|
|
17
|
+
export interface ProjectInfo {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly number: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Clears the cached project identifiers.
|
|
23
|
+
*/
|
|
24
|
+
export declare function clearProjectCache(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Selects standard or mTLS endpoint based on environment settings.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getTelemetryEndpoint(defaultEndpoint: string, mtlsEndpoint: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the Vertex Agent Engine User-Agent header when telemetry is enabled.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getAgentEngineUserAgentHeader(): Record<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Authenticated OTLP trace exporter wrapper sending spans to Google Cloud.
|
|
35
|
+
*/
|
|
36
|
+
export declare class AuthenticatedTraceExporter implements SpanExporter {
|
|
37
|
+
private readonly auth;
|
|
38
|
+
private readonly endpoint;
|
|
39
|
+
private readonly userAgentHeaders;
|
|
40
|
+
private readonly delegate;
|
|
41
|
+
private currentHeaders;
|
|
42
|
+
private warnedAuthFailure;
|
|
43
|
+
constructor(auth: GoogleAuth, endpoint: string, userAgentHeaders?: Record<string, string>);
|
|
44
|
+
/**
|
|
45
|
+
* Exports spans to Google Cloud.
|
|
46
|
+
*
|
|
47
|
+
* @param spans Spans to export.
|
|
48
|
+
* @param resultCallback Callback called with the export result.
|
|
49
|
+
*/
|
|
50
|
+
export(spans: ReadableSpan[], resultCallback: (result: {
|
|
51
|
+
code: number;
|
|
52
|
+
error?: Error;
|
|
53
|
+
}) => void): void;
|
|
54
|
+
private exportAsync;
|
|
55
|
+
/**
|
|
56
|
+
* Shuts down the trace exporter.
|
|
57
|
+
*/
|
|
58
|
+
shutdown(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Flushes pending traces.
|
|
61
|
+
*/
|
|
62
|
+
forceFlush(): Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Authenticated OTLP metric exporter wrapper sending metrics to Google Cloud.
|
|
66
|
+
*/
|
|
67
|
+
export declare class AuthenticatedMetricExporter implements PushMetricExporter {
|
|
68
|
+
private readonly auth;
|
|
69
|
+
private readonly endpoint;
|
|
70
|
+
private readonly userAgentHeaders;
|
|
71
|
+
private readonly delegate;
|
|
72
|
+
private currentHeaders;
|
|
73
|
+
private warnedAuthFailure;
|
|
74
|
+
constructor(auth: GoogleAuth, endpoint: string, userAgentHeaders?: Record<string, string>);
|
|
75
|
+
/**
|
|
76
|
+
* Exports metrics to Google Cloud.
|
|
77
|
+
*
|
|
78
|
+
* @param metrics Metrics to export.
|
|
79
|
+
* @param resultCallback Callback called with the export result.
|
|
80
|
+
*/
|
|
81
|
+
export(metrics: ResourceMetrics, resultCallback: (result: {
|
|
82
|
+
code: number;
|
|
83
|
+
error?: Error;
|
|
84
|
+
}) => void): void;
|
|
85
|
+
private exportAsync;
|
|
86
|
+
/**
|
|
87
|
+
* Shuts down the metric exporter.
|
|
88
|
+
*/
|
|
89
|
+
shutdown(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Flushes pending metrics.
|
|
92
|
+
*/
|
|
93
|
+
forceFlush(): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Selects aggregation temporality for instrument type.
|
|
96
|
+
*
|
|
97
|
+
* @param instrumentType Instrument type.
|
|
98
|
+
*/
|
|
99
|
+
selectAggregationTemporality(instrumentType: InstrumentType): AggregationTemporality;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Authenticated OTLP log exporter wrapper sending logs to Google Cloud.
|
|
103
|
+
*/
|
|
104
|
+
export declare class AuthenticatedLogExporter implements LogRecordExporter {
|
|
105
|
+
private readonly auth;
|
|
106
|
+
private readonly endpoint;
|
|
107
|
+
private readonly userAgentHeaders;
|
|
108
|
+
private readonly delegate;
|
|
109
|
+
private currentHeaders;
|
|
110
|
+
private warnedAuthFailure;
|
|
111
|
+
constructor(auth: GoogleAuth, endpoint: string, userAgentHeaders?: Record<string, string>);
|
|
112
|
+
/**
|
|
113
|
+
* Exports log records to Google Cloud.
|
|
114
|
+
*
|
|
115
|
+
* @param logs Log records to export.
|
|
116
|
+
* @param resultCallback Callback called with the export result.
|
|
117
|
+
*/
|
|
118
|
+
export(logs: ReadWriteLogRecord[], resultCallback: (result: {
|
|
119
|
+
code: number;
|
|
120
|
+
error?: Error;
|
|
121
|
+
}) => void): void;
|
|
122
|
+
private exportAsync;
|
|
123
|
+
/**
|
|
124
|
+
* Shuts down the log exporter.
|
|
125
|
+
*/
|
|
126
|
+
shutdown(): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Flushes pending log records.
|
|
129
|
+
*/
|
|
130
|
+
forceFlush(): Promise<void>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Options for configuring {@link GCPBatchLogRecordProcessor}.
|
|
134
|
+
*/
|
|
135
|
+
export interface GCPBatchLogRecordProcessorOptions extends Partial<BatchLogRecordProcessorOptions> {
|
|
136
|
+
readonly exporter: LogRecordExporter;
|
|
137
|
+
readonly projectId?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Batching log processor keeping Cloud Logging log names and labels stable.
|
|
141
|
+
*/
|
|
142
|
+
export declare class GCPBatchLogRecordProcessor extends BatchLogRecordProcessor {
|
|
143
|
+
private readonly defaultLogName;
|
|
144
|
+
private readonly logResource;
|
|
145
|
+
constructor(exporterOrOptions: LogRecordExporter | GCPBatchLogRecordProcessorOptions, projectId?: string);
|
|
146
|
+
onEmit(logRecord: ReadWriteLogRecord): void;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Looks up project number and ID via Cloud Resource Manager API with in-memory caching.
|
|
150
|
+
*
|
|
151
|
+
* Successful lookups require the `resourcemanager.projects.get` permission.
|
|
152
|
+
*
|
|
153
|
+
* @param project The project ID or number to query.
|
|
154
|
+
* @param auth Optional GoogleAuth instance to use.
|
|
155
|
+
* @returns Resolved project identifiers, or empty strings if resolution fails.
|
|
156
|
+
*/
|
|
157
|
+
export declare function fetchProject(project?: string, auth?: GoogleAuth): Promise<ProjectInfo>;
|
|
158
|
+
/**
|
|
159
|
+
* Resolves the GCP project ID from parameter, environment, or Application Default Credentials.
|
|
160
|
+
*
|
|
161
|
+
* @param auth Optional GoogleAuth instance to use for resolution.
|
|
162
|
+
* @returns The resolved project ID, or undefined if it cannot be determined.
|
|
163
|
+
*/
|
|
164
|
+
export declare function getGcpProjectId(auth?: GoogleAuth): Promise<string | undefined>;
|
|
165
|
+
/**
|
|
166
|
+
* Builds the OTel resource describing a Google Cloud deployment.
|
|
167
|
+
*
|
|
168
|
+
* Applies layered precedence: common resource, Agent Runtime resource,
|
|
169
|
+
* OTel environment detector, GCP detector, and Agent Registry URN enrichment.
|
|
170
|
+
*
|
|
171
|
+
* @param projectId Optional project ID. Falls back to GOOGLE_CLOUD_PROJECT or ADC.
|
|
172
|
+
* @returns Detected Resource object.
|
|
173
|
+
*/
|
|
174
|
+
export declare function getGcpResource(projectId?: string): Promise<Resource>;
|
|
175
|
+
/**
|
|
176
|
+
* Returns OTel processors and readers configured for export to Google Cloud.
|
|
177
|
+
*
|
|
178
|
+
* Sends traces, metrics, and logs via OTLP over HTTP to telemetry.googleapis.com.
|
|
179
|
+
* On Agent Runtime (`GOOGLE_CLOUD_AGENT_ENGINE_ID` set) the metric reader is
|
|
180
|
+
* request-driven and starts no background timer. Custom servers calling
|
|
181
|
+
* `getGcpExporters` with {@link maybeSetOtelProviders} on Agent Runtime must
|
|
182
|
+
* wrap each request with {@link agentRuntimeRequestHooks} to drive the metric
|
|
183
|
+
* reader and flush the span and log processors; without those hooks, the reader
|
|
184
|
+
* never collects except on `forceFlush()` or `shutdown()`.
|
|
185
|
+
*
|
|
186
|
+
* @param config Configuration options for enabled signals and project.
|
|
187
|
+
* @returns OTelHooks containing configured processors and readers.
|
|
188
|
+
*/
|
|
189
|
+
export declare function getGcpExporters(config?: OtelExportersConfig): Promise<OTelHooks>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { MetricReader, type PushMetricExporter } from '@opentelemetry/sdk-metrics';
|
|
7
|
+
/**
|
|
8
|
+
* The minimum spacing, in milliseconds, between two metric exports to
|
|
9
|
+
* telemetry.googleapis.com.
|
|
10
|
+
*
|
|
11
|
+
* Every ADK metric reader that exports there stays at or above it: it is the
|
|
12
|
+
* default floor of {@link RequestDrivenMetricReader} and the export interval of
|
|
13
|
+
* the periodic reader. The backend tolerates slightly faster points to absorb
|
|
14
|
+
* drift, but that is not a supported rate.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MIN_EXPORT_INTERVAL_MS = 5000;
|
|
17
|
+
declare const REQUEST_DRIVEN_METRIC_READER_SIGNATURE_SYMBOL: unique symbol;
|
|
18
|
+
/** Options for {@link RequestDrivenMetricReader}. */
|
|
19
|
+
export interface RequestDrivenMetricReaderOptions {
|
|
20
|
+
/** The exporter each collect is sent to. */
|
|
21
|
+
readonly exporter: PushMetricExporter;
|
|
22
|
+
/**
|
|
23
|
+
* The spacing of the guidepost grid, in milliseconds. Defaults to
|
|
24
|
+
* `OTEL_METRIC_EXPORT_INTERVAL`, or 60000.
|
|
25
|
+
*/
|
|
26
|
+
readonly exportIntervalMillis?: number;
|
|
27
|
+
/**
|
|
28
|
+
* The timeout of one collect and one export, in milliseconds. Defaults to
|
|
29
|
+
* `OTEL_METRIC_EXPORT_TIMEOUT`, or 30000.
|
|
30
|
+
*/
|
|
31
|
+
readonly exportTimeoutMillis?: number;
|
|
32
|
+
/**
|
|
33
|
+
* The minimum spacing between two collects, in milliseconds. Defaults to
|
|
34
|
+
* `GOOGLE_CLOUD_AGENT_ENGINE_METRICS_COLLECTION_INTERVAL_FLOOR_MS`, or
|
|
35
|
+
* `MIN_EXPORT_INTERVAL_MS`.
|
|
36
|
+
*/
|
|
37
|
+
readonly floorMillis?: number;
|
|
38
|
+
/** A monotonic millisecond clock. Defaults to `performance.now`. */
|
|
39
|
+
readonly now?: () => number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns whether `obj` is a {@link RequestDrivenMetricReader}, including one
|
|
43
|
+
* from another copy of this package.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isRequestDrivenMetricReader(obj: unknown): obj is RequestDrivenMetricReader;
|
|
46
|
+
/**
|
|
47
|
+
* A metric reader that collects and exports only from the request path, with
|
|
48
|
+
* no background timer.
|
|
49
|
+
*
|
|
50
|
+
* On a runtime that bills per request, such as Agent Runtime, the CPU is
|
|
51
|
+
* throttled as soon as a request ends. A periodic reader's timer gets no CPU
|
|
52
|
+
* between requests, so its exports are delayed or dropped. This reader keeps
|
|
53
|
+
* three invariants instead:
|
|
54
|
+
*
|
|
55
|
+
* - I1, export only while serving: every collect runs while a request is in
|
|
56
|
+
* flight, the only time the CPU is guaranteed.
|
|
57
|
+
* - I2, a floor: two collects are never closer than `floorMillis`.
|
|
58
|
+
* - I3, a guidepost: the export period is a grid of hint times, not a
|
|
59
|
+
* schedule. Under sustained load a passed guidepost forces a collect, so
|
|
60
|
+
* points cannot pile up.
|
|
61
|
+
*
|
|
62
|
+
* Collects are triggered by:
|
|
63
|
+
*
|
|
64
|
+
* - {@link onRequestEnd}, when the last request in flight ends and the floor
|
|
65
|
+
* allows it (the drain).
|
|
66
|
+
* - {@link onRequestStart}, when the request overlaps another one and a
|
|
67
|
+
* guidepost has passed. A guidepost that lands within the floor of the last
|
|
68
|
+
* collect is muted, and the grid moves one period on.
|
|
69
|
+
* - The start of a model call, when 1.5 periods have passed since the later
|
|
70
|
+
* of the start of the busy period and the last collect. The model-call
|
|
71
|
+
* instrumentation calls this through a hook the reader installs when a
|
|
72
|
+
* `MeterProvider` registers it. Because that hook uses a single
|
|
73
|
+
* process-global slot where the last registered reader wins, only a single
|
|
74
|
+
* active reader is supported.
|
|
75
|
+
*
|
|
76
|
+
* Residual loss case: a request shorter than the floor that ends right after
|
|
77
|
+
* a collect has its drain muted by the floor. If it is the last request
|
|
78
|
+
* before the process goes idle, no later collect comes and its points are
|
|
79
|
+
* lost.
|
|
80
|
+
*
|
|
81
|
+
* The defaults come from `OTEL_METRIC_EXPORT_INTERVAL` (60000),
|
|
82
|
+
* `OTEL_METRIC_EXPORT_TIMEOUT` (30000) and
|
|
83
|
+
* `GOOGLE_CLOUD_AGENT_ENGINE_METRICS_COLLECTION_INTERVAL_FLOOR_MS` (5000). An
|
|
84
|
+
* explicit option wins over its variable. A value that is not a valid number
|
|
85
|
+
* logs a warning and uses the default.
|
|
86
|
+
*
|
|
87
|
+
* None of the request methods throws or rejects.
|
|
88
|
+
*/
|
|
89
|
+
export declare class RequestDrivenMetricReader extends MetricReader {
|
|
90
|
+
readonly [REQUEST_DRIVEN_METRIC_READER_SIGNATURE_SYMBOL] = true;
|
|
91
|
+
private readonly exporter;
|
|
92
|
+
private readonly now;
|
|
93
|
+
private readonly periodMillis;
|
|
94
|
+
private readonly exportTimeoutMillis;
|
|
95
|
+
private readonly floorMillis;
|
|
96
|
+
private readonly inferenceStartHook;
|
|
97
|
+
private inFlight;
|
|
98
|
+
private lastCollect?;
|
|
99
|
+
/** When in-flight last went from zero to one. */
|
|
100
|
+
private busyStart?;
|
|
101
|
+
private nextDue;
|
|
102
|
+
/** The collect now running; set while one runs, so collects never overlap. */
|
|
103
|
+
private runningCollect?;
|
|
104
|
+
private isShutdown;
|
|
105
|
+
private warnedNoRequest;
|
|
106
|
+
constructor({ exporter, exportIntervalMillis, exportTimeoutMillis, floorMillis, now, }: RequestDrivenMetricReaderOptions);
|
|
107
|
+
/** Marks a request as started, and collects if a guidepost has passed. */
|
|
108
|
+
onRequestStart(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Marks a request as ended. Collects when no request is left in flight and
|
|
111
|
+
* the floor allows it, and resolves once any running collect has exported.
|
|
112
|
+
*/
|
|
113
|
+
onRequestEnd(): Promise<void>;
|
|
114
|
+
/** Collects at a model-call start if the busy period is overdue. */
|
|
115
|
+
onInferenceStart(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Registers the model-call start hook when a provider initializes this
|
|
118
|
+
* reader.
|
|
119
|
+
*
|
|
120
|
+
* Because the hook uses a single process-global slot where the last
|
|
121
|
+
* registered reader wins, only a single active reader is supported.
|
|
122
|
+
*/
|
|
123
|
+
protected onInitialized(): void;
|
|
124
|
+
/** Shuts down the reader, exports remaining metrics, and cleans up hooks. */
|
|
125
|
+
protected onShutdown(): Promise<void>;
|
|
126
|
+
/** Flushes any in-flight and pending metric exports. */
|
|
127
|
+
protected onForceFlush(): Promise<void>;
|
|
128
|
+
private canCollect;
|
|
129
|
+
private floorAllows;
|
|
130
|
+
/**
|
|
131
|
+
* Returns whether the current busy period has gone 1.5 periods without a
|
|
132
|
+
* collect. A collect from an earlier busy period does not count, so a short
|
|
133
|
+
* request after an idle gap is never overdue: collecting at its model call
|
|
134
|
+
* would set the floor and mute the drain that carries its points.
|
|
135
|
+
*/
|
|
136
|
+
private isOverdue;
|
|
137
|
+
/** Starts a collect, and moves the guidepost grid past `now`. */
|
|
138
|
+
private startCollect;
|
|
139
|
+
/** Runs one collect and export as the running collect. Never rejects. */
|
|
140
|
+
private runExclusive;
|
|
141
|
+
private collectAndExport;
|
|
142
|
+
private export;
|
|
143
|
+
}
|
|
144
|
+
export {};
|
|
@@ -7,10 +7,13 @@ import { Resource } from '@opentelemetry/resources';
|
|
|
7
7
|
import { LogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
8
8
|
import { MetricReader } from '@opentelemetry/sdk-metrics';
|
|
9
9
|
import { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
10
|
+
import type { GoogleAuth } from 'google-auth-library';
|
|
10
11
|
export interface OtelExportersConfig {
|
|
11
12
|
enableTracing?: boolean;
|
|
12
13
|
enableMetrics?: boolean;
|
|
13
14
|
enableLogging?: boolean;
|
|
15
|
+
projectId?: string;
|
|
16
|
+
auth?: GoogleAuth;
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Configuration hooks for OpenTelemetry setup.
|
|
@@ -37,7 +37,7 @@ export declare function isAgentTool(obj: unknown): obj is AgentTool;
|
|
|
37
37
|
* application. The agent's input schema is used to define the tool's input
|
|
38
38
|
* parameters, and the agent's output is returned as the tool's result.
|
|
39
39
|
*
|
|
40
|
-
*
|
|
40
|
+
* @param config The configuration of the agent tool.
|
|
41
41
|
*/
|
|
42
42
|
export declare class AgentTool extends BaseTool {
|
|
43
43
|
/** A unique symbol to identify ADK agent tool class. */
|
|
@@ -7,8 +7,7 @@ import { OpenAPIV3 } from 'openapi-types';
|
|
|
7
7
|
import { ReadonlyContext } from '../../agents/readonly_context.js';
|
|
8
8
|
import { AuthCredential } from '../../auth/auth_credential.js';
|
|
9
9
|
import { BaseTool } from '../base_tool.js';
|
|
10
|
-
import { BaseToolset } from '../base_toolset.js';
|
|
11
|
-
import { RestApiTool } from '../openapi_tool/rest_api_tool.js';
|
|
10
|
+
import { BaseToolset, ToolPredicate } from '../base_toolset.js';
|
|
12
11
|
import { BaseAPIHubClient } from './clients/apihub_client.js';
|
|
13
12
|
/** Options for {@link APIHubToolset}. */
|
|
14
13
|
export interface APIHubToolsetOptions {
|
|
@@ -44,8 +43,8 @@ export interface APIHubToolsetOptions {
|
|
|
44
43
|
*/
|
|
45
44
|
description?: string;
|
|
46
45
|
/**
|
|
47
|
-
* When true, the spec is fetched on the first call to `getTools`
|
|
48
|
-
*
|
|
46
|
+
* When true, the spec is fetched on the first call to `getTools`
|
|
47
|
+
* instead of when the toolset is constructed.
|
|
49
48
|
*/
|
|
50
49
|
lazyLoadSpec?: boolean;
|
|
51
50
|
/** Auth scheme applied to every tool the spec produces. */
|
|
@@ -57,13 +56,18 @@ export interface APIHubToolsetOptions {
|
|
|
57
56
|
* built from `accessToken` and `serviceAccountJson`.
|
|
58
57
|
*/
|
|
59
58
|
apihubClient?: BaseAPIHubClient;
|
|
59
|
+
/**
|
|
60
|
+
* Filter selecting which tools from the spec are exposed by `getTools`.
|
|
61
|
+
* Accepts a list of tool names or a {@link ToolPredicate} function.
|
|
62
|
+
*/
|
|
63
|
+
toolFilter?: ToolPredicate | string[];
|
|
60
64
|
}
|
|
61
65
|
/**
|
|
62
66
|
* Builds one tool per operation of an API registered in API Hub.
|
|
63
67
|
*
|
|
64
68
|
* The toolset fetches an OpenAPI spec from API Hub, parses it as YAML or JSON,
|
|
65
69
|
* and hands it to an {@link OpenAPIToolset}, which produces a
|
|
66
|
-
*
|
|
70
|
+
* `RestApiTool` for each operation.
|
|
67
71
|
*
|
|
68
72
|
* ```ts
|
|
69
73
|
* const toolset = new APIHubToolset({
|
|
@@ -79,11 +83,11 @@ export interface APIHubToolsetOptions {
|
|
|
79
83
|
*
|
|
80
84
|
* By default the spec is fetched when the toolset is constructed. A
|
|
81
85
|
* constructor cannot wait for the request, so a failure is reported by the
|
|
82
|
-
* first call to `getTools
|
|
86
|
+
* first call to `getTools`, and every later call reports the same
|
|
83
87
|
* failure.
|
|
84
88
|
*
|
|
85
|
-
* With `lazyLoadSpec`, the spec is fetched on the first call to `getTools
|
|
86
|
-
*
|
|
89
|
+
* With `lazyLoadSpec`, the spec is fetched on the first call to `getTools`.
|
|
90
|
+
* A successful result is kept, including a spec that produced no
|
|
87
91
|
* tools. A failed fetch is not kept, so the next call fetches again.
|
|
88
92
|
*/
|
|
89
93
|
export declare class APIHubToolset extends BaseToolset {
|
|
@@ -91,8 +95,8 @@ export declare class APIHubToolset extends BaseToolset {
|
|
|
91
95
|
name: string;
|
|
92
96
|
/** The toolset description, filled in from the spec when empty. */
|
|
93
97
|
description: string;
|
|
94
|
-
readonly apihubResourceName
|
|
95
|
-
readonly lazyLoadSpec
|
|
98
|
+
private readonly apihubResourceName;
|
|
99
|
+
private readonly lazyLoadSpec;
|
|
96
100
|
private readonly apihubClient;
|
|
97
101
|
private readonly authScheme?;
|
|
98
102
|
private readonly authCredential?;
|
|
@@ -105,17 +109,6 @@ export declare class APIHubToolset extends BaseToolset {
|
|
|
105
109
|
* @throws When the spec cannot be fetched or is not valid YAML or JSON.
|
|
106
110
|
*/
|
|
107
111
|
getTools(context?: ReadonlyContext): Promise<BaseTool[]>;
|
|
108
|
-
/**
|
|
109
|
-
* Returns the tool with the given name, or `undefined` when the spec
|
|
110
|
-
* produced no such tool.
|
|
111
|
-
*
|
|
112
|
-
* Unlike `OpenAPIToolset.getTool`, the result is a Promise, because the spec
|
|
113
|
-
* may still be loading.
|
|
114
|
-
*
|
|
115
|
-
* @param name The tool name, which is the operation ID in snake_case.
|
|
116
|
-
* @throws When the spec cannot be fetched or is not valid YAML or JSON.
|
|
117
|
-
*/
|
|
118
|
-
getTool(name: string): Promise<RestApiTool | undefined>;
|
|
119
112
|
close(): Promise<void>;
|
|
120
113
|
private loadToolset;
|
|
121
114
|
private prepareTools;
|
|
@@ -3,18 +3,26 @@
|
|
|
3
3
|
* Copyright 2026 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { ReadonlyContext } from '../../agents/readonly_context.js';
|
|
7
|
+
import { AuthCredential } from '../../auth/auth_credential.js';
|
|
8
|
+
import { AuthScheme } from '../../auth/auth_schemes.js';
|
|
6
9
|
import { BaseTool } from '../base_tool.js';
|
|
7
|
-
import { BaseToolset } from '../base_toolset.js';
|
|
10
|
+
import { BaseToolset, ToolPredicate } from '../base_toolset.js';
|
|
11
|
+
import { IntegrationConnectorTool, type IntegrationConnectorToolOptions } from './integration_connector_tool.js';
|
|
12
|
+
export { IntegrationConnectorTool, type IntegrationConnectorToolOptions };
|
|
8
13
|
/** Options of {@link ApplicationIntegrationToolset}. */
|
|
9
14
|
export interface ApplicationIntegrationToolsetOptions {
|
|
10
15
|
/** The Google Cloud project ID. */
|
|
11
16
|
project: string;
|
|
12
17
|
/** The Google Cloud location, such as `us-central1`. */
|
|
13
18
|
location: string;
|
|
14
|
-
/** The integration name. Set it together with `
|
|
19
|
+
/** The integration name. Set it together with `triggers` or alone for all triggers. */
|
|
15
20
|
integration?: string;
|
|
16
|
-
/**
|
|
17
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The API trigger IDs of the integration, such as
|
|
23
|
+
* `['api_trigger/my_trigger']`.
|
|
24
|
+
*/
|
|
25
|
+
triggers?: string[];
|
|
18
26
|
/**
|
|
19
27
|
* The Integration Connectors connection name. Set it together with
|
|
20
28
|
* `entityOperations`, `actions`, or both.
|
|
@@ -29,7 +37,7 @@ export interface ApplicationIntegrationToolsetOptions {
|
|
|
29
37
|
/** Connection actions to expose, such as `['ExecuteCustomQuery']`. */
|
|
30
38
|
actions?: string[];
|
|
31
39
|
/** Prefix of every generated tool name. Defaults to `''`. */
|
|
32
|
-
|
|
40
|
+
toolNamePrefix?: string;
|
|
33
41
|
/** Text appended to every generated tool description. Defaults to `''`. */
|
|
34
42
|
toolInstructions?: string;
|
|
35
43
|
/**
|
|
@@ -38,6 +46,20 @@ export interface ApplicationIntegrationToolsetOptions {
|
|
|
38
46
|
* Default Credentials.
|
|
39
47
|
*/
|
|
40
48
|
serviceAccountJson?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Authentication scheme for dynamic end-user credentials on connection tools,
|
|
51
|
+
* when `authOverrideEnabled` is enabled on the connection.
|
|
52
|
+
*/
|
|
53
|
+
authScheme?: AuthScheme;
|
|
54
|
+
/**
|
|
55
|
+
* Authentication credential for dynamic end-user credentials on connection
|
|
56
|
+
* tools, when `authOverrideEnabled` is enabled on the connection.
|
|
57
|
+
*/
|
|
58
|
+
authCredential?: AuthCredential;
|
|
59
|
+
/**
|
|
60
|
+
* Filter used to select which generated tools are exposed by `getTools`.
|
|
61
|
+
*/
|
|
62
|
+
toolFilter?: ToolPredicate | string[];
|
|
41
63
|
}
|
|
42
64
|
/**
|
|
43
65
|
* A toolset generated from a Google Cloud Application Integration API trigger,
|
|
@@ -53,7 +75,7 @@ export interface ApplicationIntegrationToolsetOptions {
|
|
|
53
75
|
* project: 'my-project',
|
|
54
76
|
* location: 'us-central1',
|
|
55
77
|
* integration: 'my-integration',
|
|
56
|
-
*
|
|
78
|
+
* triggers: ['api_trigger/my_trigger'],
|
|
57
79
|
* });
|
|
58
80
|
*
|
|
59
81
|
* @example
|
|
@@ -69,9 +91,10 @@ export interface ApplicationIntegrationToolsetOptions {
|
|
|
69
91
|
export declare class ApplicationIntegrationToolset extends BaseToolset {
|
|
70
92
|
private readonly options;
|
|
71
93
|
private toolsPromise?;
|
|
94
|
+
private openApiToolsets;
|
|
72
95
|
/**
|
|
73
|
-
* @throws Error Unless the options name either an integration
|
|
74
|
-
*
|
|
96
|
+
* @throws Error Unless the options name either an integration, or a
|
|
97
|
+
* connection with at least one entity operation or action.
|
|
75
98
|
*/
|
|
76
99
|
constructor(options: ApplicationIntegrationToolsetOptions);
|
|
77
100
|
/**
|
|
@@ -80,7 +103,7 @@ export declare class ApplicationIntegrationToolset extends BaseToolset {
|
|
|
80
103
|
* The first call fetches the spec and builds the tools. Concurrent calls
|
|
81
104
|
* share that load. When it fails, the next call tries again.
|
|
82
105
|
*/
|
|
83
|
-
getTools(): Promise<BaseTool[]>;
|
|
106
|
+
getTools(context?: ReadonlyContext): Promise<BaseTool[]>;
|
|
84
107
|
close(): Promise<void>;
|
|
85
108
|
private loadTools;
|
|
86
109
|
}
|
|
@@ -21,6 +21,8 @@ export interface ConnectionsClientOptions {
|
|
|
21
21
|
}
|
|
22
22
|
/** Service details of an Integration Connectors connection. */
|
|
23
23
|
export interface ConnectionDetails {
|
|
24
|
+
/** The resource name of the connection, or `''` when not reported. */
|
|
25
|
+
name?: string;
|
|
24
26
|
/**
|
|
25
27
|
* The Service Directory name of the connection. For a connection with a
|
|
26
28
|
* `host`, the TLS Service Directory name.
|
|
@@ -159,21 +161,35 @@ export declare function updateOperation(options: EntityOperationOptions): JsonOb
|
|
|
159
161
|
*/
|
|
160
162
|
export declare function deleteOperation(options: EntityOperationOptions): JsonObject;
|
|
161
163
|
/** Builds the request schema of the create operation of an entity. */
|
|
162
|
-
export declare function createOperationRequest(entity: string
|
|
164
|
+
export declare function createOperationRequest(entity: string, options?: {
|
|
165
|
+
includeDynamicAuthConfig?: boolean;
|
|
166
|
+
}): JsonObject;
|
|
163
167
|
/** Builds the request schema of the update operation of an entity. */
|
|
164
|
-
export declare function updateOperationRequest(entity: string
|
|
168
|
+
export declare function updateOperationRequest(entity: string, options?: {
|
|
169
|
+
includeDynamicAuthConfig?: boolean;
|
|
170
|
+
}): JsonObject;
|
|
165
171
|
/** Builds the request schema of the get operation. */
|
|
166
|
-
export declare function getOperationRequest(
|
|
172
|
+
export declare function getOperationRequest(options?: {
|
|
173
|
+
includeDynamicAuthConfig?: boolean;
|
|
174
|
+
}): JsonObject;
|
|
167
175
|
/** Builds the request schema of the delete operation. */
|
|
168
|
-
export declare function deleteOperationRequest(
|
|
176
|
+
export declare function deleteOperationRequest(options?: {
|
|
177
|
+
includeDynamicAuthConfig?: boolean;
|
|
178
|
+
}): JsonObject;
|
|
169
179
|
/** Builds the request schema of the list operation. */
|
|
170
|
-
export declare function listOperationRequest(
|
|
180
|
+
export declare function listOperationRequest(options?: {
|
|
181
|
+
includeDynamicAuthConfig?: boolean;
|
|
182
|
+
}): JsonObject;
|
|
171
183
|
/** Builds the request schema of an action. */
|
|
172
|
-
export declare function actionRequest(action: string
|
|
184
|
+
export declare function actionRequest(action: string, options?: {
|
|
185
|
+
includeDynamicAuthConfig?: boolean;
|
|
186
|
+
}): JsonObject;
|
|
173
187
|
/** Builds the response schema of an action. */
|
|
174
188
|
export declare function actionResponse(action: string): JsonObject;
|
|
175
189
|
/** Builds the request schema of the `ExecuteCustomQuery` action. */
|
|
176
|
-
export declare function executeCustomQueryRequest(
|
|
190
|
+
export declare function executeCustomQueryRequest(options?: {
|
|
191
|
+
includeDynamicAuthConfig?: boolean;
|
|
192
|
+
}): JsonObject;
|
|
177
193
|
/**
|
|
178
194
|
* A client for the Integration Connectors API.
|
|
179
195
|
*
|
|
@@ -186,22 +202,24 @@ export declare class ConnectionsClient {
|
|
|
186
202
|
private readonly tokenSource;
|
|
187
203
|
constructor(options: ConnectionsClientOptions);
|
|
188
204
|
/**
|
|
189
|
-
* Reads the service name and host of the connection, and
|
|
190
|
-
* an authentication override.
|
|
205
|
+
* Reads the resource name, service name and host of the connection, and
|
|
206
|
+
* whether it allows an authentication override.
|
|
191
207
|
*/
|
|
192
208
|
getConnectionDetails(): Promise<ConnectionDetails>;
|
|
193
209
|
/**
|
|
194
210
|
* Reads the JSON schema of an entity and the operations it supports.
|
|
195
211
|
*
|
|
196
212
|
* @param entity The entity name.
|
|
197
|
-
* @throws Error When the API starts no operation for the entity
|
|
213
|
+
* @throws Error When the API starts no operation for the entity, or the
|
|
214
|
+
* operation fails or times out.
|
|
198
215
|
*/
|
|
199
216
|
getEntitySchemaAndOperations(entity: string): Promise<EntitySchemaAndOperations>;
|
|
200
217
|
/**
|
|
201
218
|
* Reads the input and output JSON schemas of an action.
|
|
202
219
|
*
|
|
203
220
|
* @param action The action name.
|
|
204
|
-
* @throws Error When the API starts no operation for the action
|
|
221
|
+
* @throws Error When the API starts no operation for the action, or the
|
|
222
|
+
* operation fails or times out.
|
|
205
223
|
*/
|
|
206
224
|
getActionSchema(action: string): Promise<ActionSchema>;
|
|
207
225
|
/**
|
|
@@ -210,6 +228,11 @@ export declare class ConnectionsClient {
|
|
|
210
228
|
*/
|
|
211
229
|
connectorPayload(jsonSchema: JsonObject): JsonObject;
|
|
212
230
|
private executeApiCall;
|
|
213
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* Polls a long-running operation until it reports `done`.
|
|
233
|
+
*
|
|
234
|
+
* @throws Error When the operation reports an `error` or does not finish
|
|
235
|
+
* within `MAX_OPERATION_POLL_ATTEMPTS` polls.
|
|
236
|
+
*/
|
|
214
237
|
private pollOperation;
|
|
215
238
|
}
|
|
@@ -13,8 +13,8 @@ export interface IntegrationClientOptions {
|
|
|
13
13
|
location: string;
|
|
14
14
|
/** The integration name. */
|
|
15
15
|
integration?: string;
|
|
16
|
-
/** The API trigger
|
|
17
|
-
|
|
16
|
+
/** The API trigger IDs of the integration. */
|
|
17
|
+
triggers?: string[];
|
|
18
18
|
/** The connection name. */
|
|
19
19
|
connection?: string;
|
|
20
20
|
/**
|
|
@@ -41,7 +41,7 @@ export declare class IntegrationClient {
|
|
|
41
41
|
private readonly project;
|
|
42
42
|
private readonly location;
|
|
43
43
|
private readonly integration?;
|
|
44
|
-
private readonly
|
|
44
|
+
private readonly triggers?;
|
|
45
45
|
private readonly connection?;
|
|
46
46
|
private readonly entityOperations;
|
|
47
47
|
private readonly actions;
|