@google/adk 2.4.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 +282 -55
- package/dist/cjs/agents/base_agent.js +111 -68
- package/dist/cjs/agents/functions.js +62 -85
- package/dist/cjs/agents/instructions.js +7 -6
- package/dist/cjs/agents/invocation_context.js +2 -2
- package/dist/cjs/agents/llm_agent.js +105 -95
- package/dist/cjs/agents/processors/content_processor_utils.js +42 -15
- package/dist/cjs/agents/processors/content_request_processor.js +28 -11
- 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 +2 -1
- 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 +128 -9
- package/dist/cjs/cli/utils/path_validation.js +83 -0
- package/dist/cjs/code_executors/container_code_executor.js +158 -36
- package/dist/cjs/common.js +50 -12
- package/dist/cjs/context/compaction_utils.js +19 -0
- package/dist/cjs/events/event.js +7 -3
- package/dist/cjs/features/feature_registry.js +5 -0
- package/dist/cjs/index.js +29 -14
- 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 +45 -21
- 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 +1 -4
- package/dist/cjs/sessions/database_session_service.js +191 -19
- 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/vertex_ai_session_service.js +11 -3
- package/dist/cjs/skills/loader.js +29 -28
- 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 -5
- package/dist/cjs/tools/agent_tool.js +9 -1
- package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +22 -34
- package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +60 -20
- package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +26 -10
- package/dist/cjs/tools/application_integration_tool/integration_connector_tool.js +14 -23
- 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_toolset.js +3 -2
- package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +3 -1
- package/dist/cjs/tools/load_artifacts_tool.js +15 -5
- package/dist/cjs/tools/load_memory_tool.js +2 -5
- 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 +18 -6
- package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +30 -29
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -2
- package/dist/cjs/tools/openapi_tool/rest_api_tool.js +45 -14
- 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 +47 -28
- package/dist/cjs/utils/async_queue.js +37 -3
- package/dist/cjs/utils/client_labels.js +9 -11
- 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 +10 -9
- package/dist/cjs/utils/gemini_schema_util.js +125 -12
- package/dist/cjs/utils/id_provider.js +63 -0
- package/dist/cjs/utils/model_name.js +15 -0
- package/dist/cjs/utils/simple_zod_to_json.js +13 -31
- package/dist/cjs/utils/ssrf_guard.js +46 -16
- 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 +293 -55
- package/dist/esm/agents/base_agent.js +111 -72
- package/dist/esm/agents/functions.js +67 -89
- package/dist/esm/agents/instructions.js +7 -6
- package/dist/esm/agents/invocation_context.js +2 -2
- package/dist/esm/agents/llm_agent.js +111 -100
- package/dist/esm/agents/processors/content_processor_utils.js +42 -15
- package/dist/esm/agents/processors/content_request_processor.js +28 -11
- 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 +2 -1
- 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 +128 -9
- package/dist/esm/cli/utils/path_validation.js +45 -0
- package/dist/esm/code_executors/container_code_executor.js +158 -36
- package/dist/esm/common.js +49 -6
- package/dist/esm/context/compaction_utils.js +19 -0
- package/dist/esm/events/event.js +7 -3
- package/dist/esm/features/feature_registry.js +5 -0
- package/dist/esm/index.js +27 -15
- 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 +45 -21
- 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 +1 -4
- package/dist/esm/sessions/database_session_service.js +191 -19
- 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/vertex_ai_session_service.js +11 -3
- package/dist/esm/skills/loader.js +29 -28
- 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/application_integration_tool/application_integration_toolset.js +23 -35
- package/dist/esm/tools/application_integration_tool/clients/connections_client.js +64 -21
- package/dist/esm/tools/application_integration_tool/clients/integration_client.js +26 -10
- package/dist/esm/tools/application_integration_tool/integration_connector_tool.js +14 -23
- 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_toolset.js +3 -2
- package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +3 -1
- package/dist/esm/tools/load_artifacts_tool.js +15 -5
- package/dist/esm/tools/load_memory_tool.js +2 -5
- 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 +18 -6
- package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +27 -26
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -2
- package/dist/esm/tools/openapi_tool/rest_api_tool.js +45 -14
- 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 +47 -28
- package/dist/esm/utils/async_queue.js +37 -3
- package/dist/esm/utils/client_labels.js +9 -11
- 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 +10 -9
- package/dist/esm/utils/gemini_schema_util.js +124 -11
- package/dist/esm/utils/id_provider.js +33 -0
- package/dist/esm/utils/model_name.js +14 -0
- package/dist/esm/utils/simple_zod_to_json.js +13 -31
- package/dist/esm/utils/ssrf_guard.js +55 -15
- 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 +121 -3
- package/dist/types/agents/base_agent.d.ts +2 -0
- package/dist/types/agents/processors/content_processor_utils.d.ts +9 -9
- 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 +19 -2
- package/dist/types/cli/utils/path_validation.d.ts +30 -0
- package/dist/types/code_executors/container_code_executor.d.ts +49 -8
- package/dist/types/common.d.ts +16 -9
- package/dist/types/context/compaction_utils.d.ts +13 -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 +9 -6
- package/dist/types/plugins/base_plugin.d.ts +50 -21
- 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 +0 -2
- package/dist/types/sessions/db/operations.d.ts +2 -1
- package/dist/types/sessions/db/schema.d.ts +5 -3
- 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/application_integration_tool/clients/connections_client.d.ts +13 -4
- package/dist/types/tools/base_toolset.d.ts +1 -1
- 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_toolset.d.ts +2 -0
- package/dist/types/tools/load_artifacts_tool.d.ts +5 -1
- package/dist/types/tools/load_memory_tool.d.ts +13 -7
- 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/operation_parser.d.ts +7 -3
- package/dist/types/tools/toolbox_toolset.d.ts +15 -20
- package/dist/types/utils/async_queue.d.ts +14 -0
- 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 +27 -6
- package/dist/types/utils/id_provider.d.ts +43 -0
- package/dist/types/utils/model_name.d.ts +8 -0
- 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 +86 -88
- package/dist/web/index_web.js.map +4 -4
- package/package.json +13 -15
- package/dist/cjs/telemetry/google_cloud.js +0 -116
- package/dist/cjs/telemetry/tracing.js +0 -393
- package/dist/esm/telemetry/google_cloud.js +0 -99
- package/dist/esm/telemetry/setup.js +0 -88
- package/dist/esm/telemetry/tracing.js +0 -361
- package/dist/types/telemetry/google_cloud.d.ts +0 -9
- package/dist/types/telemetry/tracing.d.ts +0 -143
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var accumulators_exports = {};
|
|
27
|
+
__export(accumulators_exports, {
|
|
28
|
+
captureAccumulators: () => captureAccumulators,
|
|
29
|
+
claimEntrypointWorkflowFrame: () => claimEntrypointWorkflowFrame,
|
|
30
|
+
openAgentFrame: () => openAgentFrame,
|
|
31
|
+
openWorkflowFrame: () => openWorkflowFrame
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(accumulators_exports);
|
|
34
|
+
var import_api = require("@opentelemetry/api");
|
|
35
|
+
var import_token_usage = require("./token_usage.js");
|
|
36
|
+
/**
|
|
37
|
+
* @license
|
|
38
|
+
* Copyright 2026 Google LLC
|
|
39
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
40
|
+
*/
|
|
41
|
+
const AGENT_FRAME_KEY = (0, import_api.createContextKey)("adk_agent_frame");
|
|
42
|
+
const WORKFLOW_FRAME_KEY = (0, import_api.createContextKey)("adk_workflow_frame");
|
|
43
|
+
const AGENT_FRAME_SYMBOL = /* @__PURE__ */ Symbol("adk.telemetry.agentFrame");
|
|
44
|
+
const WORKFLOW_FRAME_SYMBOL = /* @__PURE__ */ Symbol("adk.telemetry.workflowFrame");
|
|
45
|
+
function isAgentFrame(value) {
|
|
46
|
+
return typeof value === "object" && value !== null && AGENT_FRAME_SYMBOL in value;
|
|
47
|
+
}
|
|
48
|
+
__name(isAgentFrame, "isAgentFrame");
|
|
49
|
+
function isWorkflowFrame(value) {
|
|
50
|
+
return typeof value === "object" && value !== null && WORKFLOW_FRAME_SYMBOL in value;
|
|
51
|
+
}
|
|
52
|
+
__name(isWorkflowFrame, "isWorkflowFrame");
|
|
53
|
+
function getAgentFrame(ctx) {
|
|
54
|
+
const value = ctx.getValue(AGENT_FRAME_KEY);
|
|
55
|
+
return isAgentFrame(value) ? value : void 0;
|
|
56
|
+
}
|
|
57
|
+
__name(getAgentFrame, "getAgentFrame");
|
|
58
|
+
function getWorkflowFrame(ctx) {
|
|
59
|
+
const value = ctx.getValue(WORKFLOW_FRAME_KEY);
|
|
60
|
+
return isWorkflowFrame(value) ? value : void 0;
|
|
61
|
+
}
|
|
62
|
+
__name(getWorkflowFrame, "getWorkflowFrame");
|
|
63
|
+
function createTotals() {
|
|
64
|
+
return {
|
|
65
|
+
tokens: void 0,
|
|
66
|
+
inferenceCalls: 0,
|
|
67
|
+
toolCalls: 0,
|
|
68
|
+
skillLoads: 0,
|
|
69
|
+
compactions: 0
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
__name(createTotals, "createTotals");
|
|
73
|
+
function openAgentFrame(parentContext = import_api.context.active()) {
|
|
74
|
+
const frame = {
|
|
75
|
+
[AGENT_FRAME_SYMBOL]: true,
|
|
76
|
+
totals: createTotals()
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
frame,
|
|
80
|
+
context: parentContext.setValue(AGENT_FRAME_KEY, frame)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
__name(openAgentFrame, "openAgentFrame");
|
|
84
|
+
function openWorkflowFrame({
|
|
85
|
+
workflowName,
|
|
86
|
+
config,
|
|
87
|
+
entrypoint,
|
|
88
|
+
parentContext = import_api.context.active()
|
|
89
|
+
}) {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
const enclosing = getWorkflowFrame(parentContext);
|
|
92
|
+
const frame = {
|
|
93
|
+
[WORKFLOW_FRAME_SYMBOL]: true,
|
|
94
|
+
totals: createTotals(),
|
|
95
|
+
parent: enclosing,
|
|
96
|
+
rootAgentName: (_a = enclosing == null ? void 0 : enclosing.rootAgentName) != null ? _a : workflowName,
|
|
97
|
+
workflowName,
|
|
98
|
+
config: (_b = enclosing == null ? void 0 : enclosing.config) != null ? _b : config,
|
|
99
|
+
entrypoint
|
|
100
|
+
};
|
|
101
|
+
return {
|
|
102
|
+
frame,
|
|
103
|
+
context: parentContext.setValue(WORKFLOW_FRAME_KEY, frame)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
__name(openWorkflowFrame, "openWorkflowFrame");
|
|
107
|
+
function claimEntrypointWorkflowFrame(workflow, ctx = import_api.context.active()) {
|
|
108
|
+
const frame = getWorkflowFrame(ctx);
|
|
109
|
+
if (frame === void 0 || frame.entrypoint !== workflow) {
|
|
110
|
+
return void 0;
|
|
111
|
+
}
|
|
112
|
+
frame.entrypoint = void 0;
|
|
113
|
+
return ctx;
|
|
114
|
+
}
|
|
115
|
+
__name(claimEntrypointWorkflowFrame, "claimEntrypointWorkflowFrame");
|
|
116
|
+
function captureAccumulators(ctx = import_api.context.active()) {
|
|
117
|
+
const agent = getAgentFrame(ctx);
|
|
118
|
+
const workflow = getWorkflowFrame(ctx);
|
|
119
|
+
const each = /* @__PURE__ */ __name((fn) => {
|
|
120
|
+
if (agent) {
|
|
121
|
+
fn(agent.totals);
|
|
122
|
+
}
|
|
123
|
+
let current = workflow;
|
|
124
|
+
while (current) {
|
|
125
|
+
fn(current.totals);
|
|
126
|
+
current = current.parent;
|
|
127
|
+
}
|
|
128
|
+
}, "each");
|
|
129
|
+
return {
|
|
130
|
+
addInferenceCall() {
|
|
131
|
+
each((t) => {
|
|
132
|
+
t.inferenceCalls += 1;
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
addToolCall() {
|
|
136
|
+
each((t) => {
|
|
137
|
+
t.toolCalls += 1;
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
addSkillLoad() {
|
|
141
|
+
each((t) => {
|
|
142
|
+
t.skillLoads += 1;
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
addCompaction() {
|
|
146
|
+
let current = workflow;
|
|
147
|
+
while (current) {
|
|
148
|
+
current.totals.compactions += 1;
|
|
149
|
+
current = current.parent;
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
addTokens(usage) {
|
|
153
|
+
each((t) => {
|
|
154
|
+
if (t.tokens === void 0) {
|
|
155
|
+
t.tokens = new import_token_usage.TokenUsage();
|
|
156
|
+
}
|
|
157
|
+
t.tokens.add(usage);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
__name(captureAccumulators, "captureAccumulators");
|
|
163
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
164
|
+
0 && (module.exports = {
|
|
165
|
+
captureAccumulators,
|
|
166
|
+
claimEntrypointWorkflowFrame,
|
|
167
|
+
openAgentFrame,
|
|
168
|
+
openWorkflowFrame
|
|
169
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var attributes_exports = {};
|
|
26
|
+
__export(attributes_exports, {
|
|
27
|
+
AdkAttr: () => AdkAttr,
|
|
28
|
+
ERROR_TYPE_ATTR: () => ERROR_TYPE_ATTR,
|
|
29
|
+
GEN_AI_SYSTEM_VALUE: () => GEN_AI_SYSTEM_VALUE,
|
|
30
|
+
GcpAttr: () => GcpAttr,
|
|
31
|
+
GenAiAttr: () => GenAiAttr,
|
|
32
|
+
HttpAttr: () => HttpAttr,
|
|
33
|
+
McpAttr: () => McpAttr,
|
|
34
|
+
SCHEMA_URL: () => SCHEMA_URL,
|
|
35
|
+
SUPPORT_ID_ATTR: () => SUPPORT_ID_ATTR,
|
|
36
|
+
USER_ID_ATTR: () => USER_ID_ATTR
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(attributes_exports);
|
|
39
|
+
/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2026 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
43
|
+
*/
|
|
44
|
+
var GenAiAttr = /* @__PURE__ */ ((GenAiAttr2) => {
|
|
45
|
+
GenAiAttr2["AGENT_DESCRIPTION"] = "gen_ai.agent.description";
|
|
46
|
+
GenAiAttr2["AGENT_NAME"] = "gen_ai.agent.name";
|
|
47
|
+
GenAiAttr2["CONVERSATION_ID"] = "gen_ai.conversation.id";
|
|
48
|
+
GenAiAttr2["OPERATION_NAME"] = "gen_ai.operation.name";
|
|
49
|
+
GenAiAttr2["PROVIDER_NAME"] = "gen_ai.provider.name";
|
|
50
|
+
GenAiAttr2["SYSTEM"] = "gen_ai.system";
|
|
51
|
+
GenAiAttr2["WORKFLOW_NAME"] = "gen_ai.workflow.name";
|
|
52
|
+
GenAiAttr2["WORKFLOW_NESTED"] = "gen_ai.workflow.nested";
|
|
53
|
+
GenAiAttr2["TOOL_CALL_ID"] = "gen_ai.tool.call.id";
|
|
54
|
+
GenAiAttr2["TOOL_CALL_ARGUMENTS"] = "gen_ai.tool.call.arguments";
|
|
55
|
+
GenAiAttr2["TOOL_CALL_RESULT"] = "gen_ai.tool.call.result";
|
|
56
|
+
GenAiAttr2["TOOL_DEFINITIONS"] = "gen_ai.tool.definitions";
|
|
57
|
+
GenAiAttr2["TOOL_DESCRIPTION"] = "gen_ai.tool.description";
|
|
58
|
+
GenAiAttr2["TOOL_NAME"] = "gen_ai.tool.name";
|
|
59
|
+
GenAiAttr2["TOOL_TYPE"] = "gen_ai.tool.type";
|
|
60
|
+
GenAiAttr2["REQUEST_MODEL"] = "gen_ai.request.model";
|
|
61
|
+
GenAiAttr2["REQUEST_TOP_P"] = "gen_ai.request.top_p";
|
|
62
|
+
GenAiAttr2["REQUEST_MAX_TOKENS"] = "gen_ai.request.max_tokens";
|
|
63
|
+
GenAiAttr2["RESPONSE_FINISH_REASONS"] = "gen_ai.response.finish_reasons";
|
|
64
|
+
GenAiAttr2["INPUT_MESSAGES"] = "gen_ai.input.messages";
|
|
65
|
+
GenAiAttr2["OUTPUT_MESSAGES"] = "gen_ai.output.messages";
|
|
66
|
+
GenAiAttr2["SYSTEM_INSTRUCTIONS"] = "gen_ai.system_instructions";
|
|
67
|
+
GenAiAttr2["USAGE_INPUT_TOKENS"] = "gen_ai.usage.input_tokens";
|
|
68
|
+
GenAiAttr2["USAGE_OUTPUT_TOKENS"] = "gen_ai.usage.output_tokens";
|
|
69
|
+
GenAiAttr2["USAGE_CACHE_READ_INPUT_TOKENS"] = "gen_ai.usage.cache_read.input_tokens";
|
|
70
|
+
GenAiAttr2["USAGE_REASONING_OUTPUT_TOKENS"] = "gen_ai.usage.reasoning.output_tokens";
|
|
71
|
+
GenAiAttr2["SKILL_NAME"] = "gen_ai.skill.name";
|
|
72
|
+
GenAiAttr2["SKILL_DESCRIPTION"] = "gen_ai.skill.description";
|
|
73
|
+
GenAiAttr2["SKILL_RESOURCE_NAME"] = "gen_ai.skill.resource.name";
|
|
74
|
+
GenAiAttr2["COMPACTION_TRIGGER"] = "gen_ai.compaction.trigger";
|
|
75
|
+
GenAiAttr2["COMPACTION_EVENT_COUNT"] = "gen_ai.compaction.event_count";
|
|
76
|
+
GenAiAttr2["COMPACTION_RESULT_EVENT_ID"] = "gen_ai.compaction.result_event_id";
|
|
77
|
+
GenAiAttr2["COMPACTION_START_TIMESTAMP"] = "gen_ai.compaction.start_timestamp";
|
|
78
|
+
GenAiAttr2["COMPACTION_END_TIMESTAMP"] = "gen_ai.compaction.end_timestamp";
|
|
79
|
+
return GenAiAttr2;
|
|
80
|
+
})(GenAiAttr || {});
|
|
81
|
+
var AdkAttr = /* @__PURE__ */ ((AdkAttr2) => {
|
|
82
|
+
AdkAttr2["SKILL_ADDITIONAL_TOOLS"] = "adk.skill.additional_tools";
|
|
83
|
+
AdkAttr2["EXPERIMENTAL_ROOT_AGENT_NAME"] = "adk.experimental.root_agent.name";
|
|
84
|
+
AdkAttr2["EXPERIMENTAL_GROUNDING_QUERY_COUNT"] = "adk.experimental.grounding.query_count";
|
|
85
|
+
AdkAttr2["EXPERIMENTAL_GROUNDING_CHUNK_COUNT"] = "adk.experimental.grounding.chunk_count";
|
|
86
|
+
AdkAttr2["EXPERIMENTAL_GROUNDING_WEB_SEARCH_QUERIES"] = "adk.experimental.grounding.web_search_queries";
|
|
87
|
+
AdkAttr2["EXPERIMENTAL_GROUNDING_SOURCE_URIS"] = "adk.experimental.grounding.source_uris";
|
|
88
|
+
return AdkAttr2;
|
|
89
|
+
})(AdkAttr || {});
|
|
90
|
+
var GcpAttr = /* @__PURE__ */ ((GcpAttr2) => {
|
|
91
|
+
GcpAttr2["INVOCATION_ID"] = "gcp.vertex.agent.invocation_id";
|
|
92
|
+
GcpAttr2["EVENT_ID"] = "gcp.vertex.agent.event_id";
|
|
93
|
+
GcpAttr2["ASSOCIATED_EVENT_IDS"] = "gcp.vertex.agent.associated_event_ids";
|
|
94
|
+
GcpAttr2["DATA"] = "gcp.vertex.agent.data";
|
|
95
|
+
return GcpAttr2;
|
|
96
|
+
})(GcpAttr || {});
|
|
97
|
+
var HttpAttr = /* @__PURE__ */ ((HttpAttr2) => {
|
|
98
|
+
HttpAttr2["REQUEST_METHOD"] = "http.request.method";
|
|
99
|
+
HttpAttr2["RESPONSE_STATUS_CODE"] = "http.response.status_code";
|
|
100
|
+
HttpAttr2["REQUEST_BODY_CONTENT"] = "http.request.body.content";
|
|
101
|
+
HttpAttr2["RESPONSE_BODY_CONTENT"] = "http.response.body.content";
|
|
102
|
+
HttpAttr2["REQUEST_HEADER_PREFIX"] = "http.request.header.";
|
|
103
|
+
HttpAttr2["RESPONSE_HEADER_PREFIX"] = "http.response.header.";
|
|
104
|
+
HttpAttr2["URL_FULL"] = "url.full";
|
|
105
|
+
HttpAttr2["SERVER_ADDRESS"] = "server.address";
|
|
106
|
+
HttpAttr2["SERVER_PORT"] = "server.port";
|
|
107
|
+
return HttpAttr2;
|
|
108
|
+
})(HttpAttr || {});
|
|
109
|
+
var McpAttr = /* @__PURE__ */ ((McpAttr2) => {
|
|
110
|
+
McpAttr2["SESSION_ID"] = "mcp.session.id";
|
|
111
|
+
McpAttr2["PROTOCOL_VERSION"] = "mcp.protocol.version";
|
|
112
|
+
return McpAttr2;
|
|
113
|
+
})(McpAttr || {});
|
|
114
|
+
const ERROR_TYPE_ATTR = "error.type";
|
|
115
|
+
const USER_ID_ATTR = "user.id";
|
|
116
|
+
const SUPPORT_ID_ATTR = "supportID";
|
|
117
|
+
const GEN_AI_SYSTEM_VALUE = "gcp.vertex.agent";
|
|
118
|
+
const SCHEMA_URL = "https://opentelemetry.io/schemas/1.44.0";
|
|
119
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
+
0 && (module.exports = {
|
|
121
|
+
AdkAttr,
|
|
122
|
+
ERROR_TYPE_ATTR,
|
|
123
|
+
GEN_AI_SYSTEM_VALUE,
|
|
124
|
+
GcpAttr,
|
|
125
|
+
GenAiAttr,
|
|
126
|
+
HttpAttr,
|
|
127
|
+
McpAttr,
|
|
128
|
+
SCHEMA_URL,
|
|
129
|
+
SUPPORT_ID_ATTR,
|
|
130
|
+
USER_ID_ATTR
|
|
131
|
+
});
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var config_exports = {};
|
|
27
|
+
__export(config_exports, {
|
|
28
|
+
isExperimentalFeatureEnabled: () => isExperimentalFeatureEnabled,
|
|
29
|
+
isTruthyEnv: () => isTruthyEnv,
|
|
30
|
+
resolveTelemetryConfig: () => resolveTelemetryConfig,
|
|
31
|
+
shouldAddContentToLogs: () => shouldAddContentToLogs,
|
|
32
|
+
shouldAddContentToSpans: () => shouldAddContentToSpans
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(config_exports);
|
|
35
|
+
var import_env_aware_utils = require("../../../../utils/env_aware_utils.js");
|
|
36
|
+
var import_logger = require("../../../../utils/logger.js");
|
|
37
|
+
/**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2026 Google LLC
|
|
40
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
41
|
+
*/
|
|
42
|
+
const CAPTURE_MESSAGE_CONTENT_ENV = "OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT";
|
|
43
|
+
const EXPERIMENTAL_TELEMETRY_ENV = "ADK_EXPERIMENTAL_TELEMETRY";
|
|
44
|
+
const EXPERIMENTAL_TELEMETRY_FEATURES_ENV = "ADK_EXPERIMENTAL_TELEMETRY_FEATURES";
|
|
45
|
+
const IGNORE_RUN_CONFIG_ENV = "ADK_TELEMETRY_IGNORE_RUN_CONFIG";
|
|
46
|
+
const TRUTHY_ENV_VALUES = /* @__PURE__ */ new Set(["1", "true"]);
|
|
47
|
+
const CONTENT_CAPTURING_MODES = /* @__PURE__ */ new Set([
|
|
48
|
+
"NO_CONTENT",
|
|
49
|
+
"EVENT_ONLY",
|
|
50
|
+
"SPAN_ONLY",
|
|
51
|
+
"SPAN_AND_EVENT"
|
|
52
|
+
]);
|
|
53
|
+
const EXPERIMENTAL_FEATURES = /* @__PURE__ */ new Set(
|
|
54
|
+
[
|
|
55
|
+
"skills",
|
|
56
|
+
"workflow",
|
|
57
|
+
"context_cache",
|
|
58
|
+
"grounding",
|
|
59
|
+
"mcp",
|
|
60
|
+
"token_usage",
|
|
61
|
+
"compaction"
|
|
62
|
+
]
|
|
63
|
+
);
|
|
64
|
+
const warnedFeatures = /* @__PURE__ */ new Set();
|
|
65
|
+
function isExperimentalFeature(value) {
|
|
66
|
+
return EXPERIMENTAL_FEATURES.has(value);
|
|
67
|
+
}
|
|
68
|
+
__name(isExperimentalFeature, "isExperimentalFeature");
|
|
69
|
+
function isContentCapturingMode(value) {
|
|
70
|
+
return CONTENT_CAPTURING_MODES.has(value);
|
|
71
|
+
}
|
|
72
|
+
__name(isContentCapturingMode, "isContentCapturingMode");
|
|
73
|
+
function readContentCapturingMode() {
|
|
74
|
+
var _a;
|
|
75
|
+
const value = ((_a = (0, import_env_aware_utils.getEnvVar)(CAPTURE_MESSAGE_CONTENT_ENV)) != null ? _a : "").trim();
|
|
76
|
+
if (TRUTHY_ENV_VALUES.has(value.toLowerCase())) {
|
|
77
|
+
return "EVENT_ONLY";
|
|
78
|
+
}
|
|
79
|
+
const mode = value.toUpperCase();
|
|
80
|
+
return isContentCapturingMode(mode) ? mode : "NO_CONTENT";
|
|
81
|
+
}
|
|
82
|
+
__name(readContentCapturingMode, "readContentCapturingMode");
|
|
83
|
+
function isTruthyEnv(name) {
|
|
84
|
+
var _a;
|
|
85
|
+
return TRUTHY_ENV_VALUES.has(((_a = (0, import_env_aware_utils.getEnvVar)(name)) != null ? _a : "").trim().toLowerCase());
|
|
86
|
+
}
|
|
87
|
+
__name(isTruthyEnv, "isTruthyEnv");
|
|
88
|
+
function normalizeExperimentalFeatures(names) {
|
|
89
|
+
const features = /* @__PURE__ */ new Set();
|
|
90
|
+
for (const name of names) {
|
|
91
|
+
const feature = name.trim().toLowerCase();
|
|
92
|
+
if (!feature) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (isExperimentalFeature(feature)) {
|
|
96
|
+
features.add(feature);
|
|
97
|
+
} else if (!warnedFeatures.has(feature)) {
|
|
98
|
+
warnedFeatures.add(feature);
|
|
99
|
+
import_logger.logger.warn(
|
|
100
|
+
`Ignoring unrecognized experimental telemetry feature: ${feature}`
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return features;
|
|
105
|
+
}
|
|
106
|
+
__name(normalizeExperimentalFeatures, "normalizeExperimentalFeatures");
|
|
107
|
+
function resolveTelemetryConfig(overrides) {
|
|
108
|
+
var _a, _b, _c;
|
|
109
|
+
const env = {
|
|
110
|
+
contentCapturingMode: readContentCapturingMode(),
|
|
111
|
+
experimentalTelemetry: isTruthyEnv(EXPERIMENTAL_TELEMETRY_ENV),
|
|
112
|
+
experimentalFeatures: normalizeExperimentalFeatures(
|
|
113
|
+
((_a = (0, import_env_aware_utils.getEnvVar)(EXPERIMENTAL_TELEMETRY_FEATURES_ENV)) != null ? _a : "").split(",")
|
|
114
|
+
)
|
|
115
|
+
};
|
|
116
|
+
if (overrides === void 0 || isTruthyEnv(IGNORE_RUN_CONFIG_ENV)) {
|
|
117
|
+
return env;
|
|
118
|
+
}
|
|
119
|
+
const contentCapturingMode = (_b = overrides.captureMessageContent) != null ? _b : env.contentCapturingMode;
|
|
120
|
+
if (overrides.adkExperimentalTelemetryOptIn !== void 0) {
|
|
121
|
+
return {
|
|
122
|
+
contentCapturingMode,
|
|
123
|
+
experimentalTelemetry: overrides.adkExperimentalTelemetryOptIn,
|
|
124
|
+
experimentalFeatures: /* @__PURE__ */ new Set()
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const features = normalizeExperimentalFeatures(
|
|
128
|
+
(_c = overrides.experimentalFeaturesOptIn) != null ? _c : []
|
|
129
|
+
);
|
|
130
|
+
if (features.size > 0) {
|
|
131
|
+
return {
|
|
132
|
+
contentCapturingMode,
|
|
133
|
+
experimentalTelemetry: false,
|
|
134
|
+
experimentalFeatures: features
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return { ...env, contentCapturingMode };
|
|
138
|
+
}
|
|
139
|
+
__name(resolveTelemetryConfig, "resolveTelemetryConfig");
|
|
140
|
+
function shouldAddContentToLogs(config) {
|
|
141
|
+
return config.contentCapturingMode === "EVENT_ONLY" || config.contentCapturingMode === "SPAN_AND_EVENT";
|
|
142
|
+
}
|
|
143
|
+
__name(shouldAddContentToLogs, "shouldAddContentToLogs");
|
|
144
|
+
function shouldAddContentToSpans(config) {
|
|
145
|
+
return config.contentCapturingMode === "SPAN_ONLY" || config.contentCapturingMode === "SPAN_AND_EVENT";
|
|
146
|
+
}
|
|
147
|
+
__name(shouldAddContentToSpans, "shouldAddContentToSpans");
|
|
148
|
+
function isExperimentalFeatureEnabled(config, feature) {
|
|
149
|
+
return config.experimentalTelemetry || config.experimentalFeatures.has(feature);
|
|
150
|
+
}
|
|
151
|
+
__name(isExperimentalFeatureEnabled, "isExperimentalFeatureEnabled");
|
|
152
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
153
|
+
0 && (module.exports = {
|
|
154
|
+
isExperimentalFeatureEnabled,
|
|
155
|
+
isTruthyEnv,
|
|
156
|
+
resolveTelemetryConfig,
|
|
157
|
+
shouldAddContentToLogs,
|
|
158
|
+
shouldAddContentToSpans
|
|
159
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var error_exports = {};
|
|
27
|
+
__export(error_exports, {
|
|
28
|
+
getToolResponseErrorType: () => getToolResponseErrorType,
|
|
29
|
+
normalizeErrorClassification: () => normalizeErrorClassification,
|
|
30
|
+
resolveErrorType: () => resolveErrorType
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(error_exports);
|
|
33
|
+
var import_genai = require("@google/genai");
|
|
34
|
+
/**
|
|
35
|
+
* @license
|
|
36
|
+
* Copyright 2026 Google LLC
|
|
37
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
38
|
+
*/
|
|
39
|
+
function normalizeErrorClassification(value) {
|
|
40
|
+
if (typeof value === "string") {
|
|
41
|
+
const trimmed = value.trim();
|
|
42
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
43
|
+
}
|
|
44
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
45
|
+
return String(value);
|
|
46
|
+
}
|
|
47
|
+
return void 0;
|
|
48
|
+
}
|
|
49
|
+
__name(normalizeErrorClassification, "normalizeErrorClassification");
|
|
50
|
+
function resolveErrorType(error) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
if (error !== null && (typeof error === "object" || typeof error === "function")) {
|
|
53
|
+
try {
|
|
54
|
+
const errorObject = error;
|
|
55
|
+
const customErrorType = (_a = normalizeErrorClassification(errorObject.errorType)) != null ? _a : normalizeErrorClassification(errorObject.error_type);
|
|
56
|
+
if (customErrorType !== void 0) {
|
|
57
|
+
return customErrorType;
|
|
58
|
+
}
|
|
59
|
+
if (error instanceof import_genai.ApiError) {
|
|
60
|
+
const apiStatus = normalizeErrorClassification(error.status);
|
|
61
|
+
if (apiStatus !== void 0) {
|
|
62
|
+
return apiStatus;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const constructorName = normalizeErrorClassification(
|
|
66
|
+
(_b = errorObject.constructor) == null ? void 0 : _b.name
|
|
67
|
+
);
|
|
68
|
+
if (constructorName !== void 0) {
|
|
69
|
+
return constructorName;
|
|
70
|
+
}
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return typeof error;
|
|
75
|
+
}
|
|
76
|
+
__name(resolveErrorType, "resolveErrorType");
|
|
77
|
+
function getToolResponseErrorType(result) {
|
|
78
|
+
var _a, _b, _c;
|
|
79
|
+
if (result === null || typeof result !== "object" || Array.isArray(result)) {
|
|
80
|
+
return void 0;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
if (!Object.hasOwn(result, "error")) {
|
|
84
|
+
return void 0;
|
|
85
|
+
}
|
|
86
|
+
const response = result;
|
|
87
|
+
return (_c = (_b = (_a = normalizeErrorClassification(response.errorType)) != null ? _a : normalizeErrorClassification(response.error_type)) != null ? _b : normalizeErrorClassification(response.errorCode)) != null ? _c : normalizeErrorClassification(response.error_code);
|
|
88
|
+
} catch {
|
|
89
|
+
return void 0;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
__name(getToolResponseErrorType, "getToolResponseErrorType");
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
getToolResponseErrorType,
|
|
96
|
+
normalizeErrorClassification,
|
|
97
|
+
resolveErrorType
|
|
98
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var finish_reason_exports = {};
|
|
27
|
+
__export(finish_reason_exports, {
|
|
28
|
+
isReportedFinishReason: () => isReportedFinishReason,
|
|
29
|
+
toOutputMessageFinishReason: () => toOutputMessageFinishReason
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(finish_reason_exports);
|
|
32
|
+
var import_genai = require("@google/genai");
|
|
33
|
+
/**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2026 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
37
|
+
*/
|
|
38
|
+
function isReportedFinishReason(finishReason) {
|
|
39
|
+
return finishReason !== void 0 && finishReason !== import_genai.FinishReason.FINISH_REASON_UNSPECIFIED;
|
|
40
|
+
}
|
|
41
|
+
__name(isReportedFinishReason, "isReportedFinishReason");
|
|
42
|
+
function toOutputMessageFinishReason(finishReason) {
|
|
43
|
+
if (!isReportedFinishReason(finishReason)) {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
switch (finishReason) {
|
|
47
|
+
// The output message schema has no value for OTHER.
|
|
48
|
+
case import_genai.FinishReason.OTHER:
|
|
49
|
+
return "error";
|
|
50
|
+
case import_genai.FinishReason.STOP:
|
|
51
|
+
return "stop";
|
|
52
|
+
case import_genai.FinishReason.MAX_TOKENS:
|
|
53
|
+
return "length";
|
|
54
|
+
default:
|
|
55
|
+
return String(finishReason).toLowerCase();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
__name(toOutputMessageFinishReason, "toOutputMessageFinishReason");
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
isReportedFinishReason,
|
|
62
|
+
toOutputMessageFinishReason
|
|
63
|
+
});
|