@google/adk 1.6.0 → 2.1.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_event.js +17 -28
- package/dist/cjs/a2a/a2a_remote_agent.js +13 -7
- package/dist/cjs/a2a/a2a_remote_agent_run_processor.js +7 -3
- package/dist/cjs/a2a/a2a_remote_agent_utils.js +111 -2
- package/dist/cjs/a2a/agent_card.js +90 -8
- package/dist/cjs/a2a/agent_executor.js +34 -18
- package/dist/cjs/a2a/agent_to_a2a.js +28 -11
- package/dist/cjs/a2a/auth.js +3 -0
- package/dist/cjs/a2a/event_converter_utils.js +10 -0
- package/dist/cjs/a2a/event_processor_utils.js +71 -35
- package/dist/cjs/a2a/executor_context.js +6 -2
- package/dist/cjs/a2a/index.js +57 -0
- package/dist/cjs/a2a/metadata_converter_utils.js +5 -0
- package/dist/cjs/a2a/part_converter_utils.js +12 -0
- package/dist/cjs/a2a/request_metadata.js +94 -0
- package/dist/cjs/agents/active_streaming_tool.js +5 -2
- package/dist/cjs/agents/base_agent.js +55 -17
- package/dist/cjs/agents/context.js +12 -2
- package/dist/cjs/agents/framework_function_calls.js +64 -0
- package/dist/cjs/agents/functions.js +185 -60
- package/dist/cjs/agents/instructions.js +51 -12
- package/dist/cjs/agents/invocation_context.js +43 -8
- package/dist/cjs/agents/live_request_queue.js +29 -5
- package/dist/cjs/agents/llm_agent.js +541 -50
- package/dist/cjs/agents/loop_agent.js +20 -3
- package/dist/cjs/agents/parallel_agent.js +22 -3
- package/dist/cjs/agents/processors/agent_transfer_llm_request_processor.js +32 -8
- package/dist/cjs/agents/processors/base_llm_processor.js +9 -4
- package/dist/cjs/agents/processors/basic_llm_request_processor.js +6 -3
- package/dist/cjs/agents/processors/code_execution_request_processor.js +20 -7
- package/dist/cjs/agents/processors/content_processor_utils.js +85 -15
- package/dist/cjs/agents/processors/content_request_processor.js +13 -5
- package/dist/cjs/agents/processors/context_compactor_request_processor.js +5 -2
- package/dist/cjs/agents/processors/identity_llm_request_processor.js +12 -4
- package/dist/cjs/agents/processors/instructions_llm_request_processor.js +5 -2
- package/dist/cjs/agents/processors/interactions_request_processor.js +5 -2
- package/dist/cjs/agents/processors/request_confirmation_llm_request_processor.js +320 -92
- package/dist/cjs/agents/processors/request_input_llm_request_processor.js +214 -0
- package/dist/cjs/agents/processors/tool_filter_request_processor.js +5 -2
- package/dist/cjs/agents/readonly_context.js +13 -3
- package/dist/cjs/agents/routed_agent.js +7 -14
- package/dist/cjs/agents/run_config.js +12 -0
- package/dist/cjs/agents/sequential_agent.js +21 -4
- package/dist/cjs/agents/user_input_request.js +145 -0
- package/dist/cjs/apps/app.js +12 -12
- package/dist/cjs/apps/resumability_config.js +2 -0
- package/dist/cjs/artifacts/file_artifact_service.js +22 -4
- package/dist/cjs/artifacts/gcs_artifact_service.js +46 -11
- package/dist/cjs/artifacts/in_memory_artifact_service.js +9 -2
- package/dist/cjs/artifacts/registry.js +6 -1
- package/dist/cjs/artifacts/scoped_artifact_service.js +14 -2
- package/dist/cjs/artifacts/session_artifact_service.js +19 -0
- package/dist/cjs/auth/auth_handler.js +49 -10
- package/dist/cjs/auth/auth_preprocessor.js +48 -40
- package/dist/cjs/auth/auth_provider_registry.js +5 -2
- package/dist/cjs/auth/auth_schemes.js +2 -0
- package/dist/cjs/auth/credential_response_binding.js +101 -0
- package/dist/cjs/auth/credential_service/in_memory_credential_service.js +5 -2
- package/dist/cjs/auth/credential_service/session_state_credential_service.js +5 -2
- package/dist/cjs/auth/exchanger/base_credential_exchanger.js +5 -2
- package/dist/cjs/auth/exchanger/credential_exchanger_registry.js +5 -2
- package/dist/cjs/auth/oauth2/oauth2_credential_exchanger.js +8 -2
- package/dist/cjs/auth/oauth2/oauth2_credential_refresher.js +6 -3
- package/dist/cjs/auth/oauth2/oauth2_discovery.js +7 -2
- package/dist/cjs/auth/oauth2/oauth2_utils.js +23 -2
- package/dist/cjs/auth/refresher/base_credential_refresher.js +5 -2
- package/dist/cjs/auth/refresher/credential_refresher_registry.js +5 -2
- package/dist/cjs/code_executors/agent_engine_sandbox_code_executor.js +3 -0
- package/dist/cjs/code_executors/base_code_executor.js +7 -3
- package/dist/cjs/code_executors/built_in_code_executor.js +7 -3
- package/dist/cjs/code_executors/code_execution_utils.js +8 -2
- package/dist/cjs/code_executors/code_executor_context.js +5 -2
- package/dist/cjs/code_executors/container_code_executor.js +186 -0
- package/dist/cjs/code_executors/docker_container.js +282 -0
- package/dist/cjs/code_executors/unsafe_local_code_executor.js +19 -8
- package/dist/cjs/common.js +180 -46
- package/dist/cjs/context/agent_controlled_context_compactor.js +15 -7
- package/dist/cjs/context/anchored_context_compactor.js +46 -20
- package/dist/cjs/context/compaction_utils.js +18 -6
- package/dist/cjs/context/summarizers/llm_summarizer.js +5 -2
- package/dist/cjs/context/token_based_context_compactor.js +19 -5
- package/dist/cjs/context/trajectory_thought_pruning_compactor.js +22 -12
- package/dist/cjs/context/truncating_context_compactor.js +22 -7
- package/dist/cjs/environment/base_environment.js +97 -0
- package/dist/cjs/environment/local_environment.js +186 -0
- package/dist/cjs/errors/already_exists_error.js +50 -0
- package/dist/cjs/errors/input_validation_error.js +50 -0
- package/dist/cjs/errors/not_found_error.js +50 -0
- package/dist/cjs/errors/session_not_found_error.js +50 -0
- package/dist/cjs/errors/tool_execution_error.js +68 -0
- package/dist/cjs/events/compacted_event.js +4 -0
- package/dist/cjs/events/event.js +38 -3
- package/dist/cjs/events/event_actions.js +12 -0
- package/dist/cjs/events/structured_events.js +2 -0
- package/dist/cjs/examples/base_example_provider.js +7 -3
- package/dist/cjs/examples/example_util.js +3 -0
- package/dist/cjs/features/feature_registry.js +7 -0
- package/dist/cjs/index.js +54 -25
- package/dist/cjs/index_web.js +2 -0
- package/dist/cjs/integrations/agent_registry/agent_registry.js +10 -6
- package/dist/cjs/integrations/agent_registry/agent_registry_mcp_toolset.js +7 -4
- package/dist/cjs/integrations/agent_registry/helpers.js +3 -0
- package/dist/cjs/memory/in_memory_memory_service.js +8 -2
- package/dist/cjs/memory/rag_memory_transcript.js +136 -0
- package/dist/cjs/memory/vertex_ai_memory_bank_service.js +19 -4
- package/dist/cjs/memory/vertex_ai_rag_api.js +120 -0
- package/dist/cjs/memory/vertex_ai_rag_memory_service.js +228 -0
- package/dist/cjs/models/apigee_llm.js +10 -4
- package/dist/cjs/models/base_llm.js +8 -4
- package/dist/cjs/models/chrome_prompt_llm.js +304 -0
- package/dist/cjs/models/chrome_prompt_utils.js +229 -0
- package/dist/cjs/models/gemini_llm_connection.js +5 -2
- package/dist/cjs/models/google_llm.js +33 -16
- package/dist/cjs/models/interactions_utils.js +18 -3
- package/dist/cjs/models/llm_request.js +4 -0
- package/dist/cjs/models/llm_response.js +2 -0
- package/dist/cjs/models/registry.js +8 -2
- package/dist/cjs/models/routed_llm.js +4 -13
- package/dist/cjs/plugins/_reflect_retry_utils.js +142 -0
- package/dist/cjs/plugins/base_plugin.js +39 -5
- package/dist/cjs/plugins/global_instruction_plugin.js +5 -2
- package/dist/cjs/plugins/logging_plugin.js +13 -8
- package/dist/cjs/plugins/plugin_manager.js +37 -2
- package/dist/cjs/plugins/reflect_retry_model_plugin.js +274 -0
- package/dist/cjs/plugins/reflect_retry_tool_plugin.js +276 -0
- package/dist/cjs/plugins/security_plugin.js +15 -8
- package/dist/cjs/runner/in_memory_runner.js +5 -2
- package/dist/cjs/runner/runner.js +236 -43
- package/dist/cjs/sessions/base_session_service.js +13 -2
- package/dist/cjs/sessions/database_session_service.js +84 -45
- package/dist/cjs/sessions/db/operations.js +259 -24
- package/dist/cjs/sessions/db/schema.js +118 -156
- package/dist/cjs/sessions/in_memory_session_service.js +22 -14
- package/dist/cjs/sessions/registry.js +9 -2
- package/dist/cjs/sessions/session.js +2 -0
- package/dist/cjs/sessions/state.js +80 -8
- package/dist/cjs/sessions/state_write_order.js +105 -0
- package/dist/cjs/sessions/vertex_ai_session_service.js +112 -17
- package/dist/cjs/skills/gcp_skill_registry.js +2 -0
- package/dist/cjs/skills/loader.js +22 -10
- package/dist/cjs/skills/prompt.js +3 -0
- package/dist/cjs/telemetry/google_cloud.js +42 -9
- package/dist/cjs/telemetry/setup.js +6 -1
- package/dist/cjs/telemetry/tracing.js +71 -5
- package/dist/cjs/tools/agent_tool.js +10 -7
- package/dist/cjs/tools/base_tool.js +38 -6
- package/dist/cjs/tools/base_toolset.js +10 -6
- package/dist/cjs/tools/built_in_tool.js +75 -0
- package/dist/cjs/tools/consolidate_context_tool.js +5 -2
- package/dist/cjs/tools/enterprise_web_search_tool.js +8 -7
- package/dist/cjs/tools/example_tool.js +5 -2
- package/dist/cjs/tools/exit_loop_tool.js +5 -2
- package/dist/cjs/tools/finish_task_tool.js +119 -0
- package/dist/cjs/tools/forwarding_artifact_service.js +23 -15
- package/dist/cjs/tools/function_tool.js +79 -11
- package/dist/cjs/tools/get_user_choice_tool.js +3 -2
- package/dist/cjs/tools/google_maps_grounding_tool.js +8 -7
- package/dist/cjs/tools/google_search_tool.js +7 -7
- package/dist/cjs/tools/load_artifacts_tool.js +55 -25
- package/dist/cjs/tools/load_memory_tool.js +5 -2
- package/dist/cjs/tools/load_web_page.js +14 -160
- package/dist/cjs/tools/long_running_tool.js +5 -2
- package/dist/cjs/tools/mcp/index.js +39 -0
- package/dist/cjs/tools/mcp/load_mcp_resource_tool.js +39 -7
- package/dist/cjs/tools/mcp/mcp_session_manager.js +36 -8
- package/dist/cjs/tools/mcp/mcp_tool.js +5 -2
- package/dist/cjs/tools/mcp/mcp_toolset.js +5 -2
- package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +15 -2
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +2 -0
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +2 -0
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +30 -9
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +3 -1
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +6 -2
- package/dist/cjs/tools/openapi_tool/openapi_toolset.js +2 -0
- package/dist/cjs/tools/openapi_tool/rest_api_tool.js +39 -23
- package/dist/cjs/tools/preload_memory_tool.js +6 -3
- package/dist/cjs/tools/request_input_tool.js +6 -4
- package/dist/cjs/tools/resume_inputs.js +27 -0
- package/dist/cjs/tools/retrieval/base_retrieval_tool.js +60 -0
- package/dist/cjs/tools/retrieval/files_retrieval.js +95 -0
- package/dist/cjs/tools/retrieval/llama_index_retrieval.js +57 -0
- package/dist/cjs/tools/skill/list_skills_tool.js +2 -0
- package/dist/cjs/tools/skill/load_skill_resource_tool.js +2 -0
- package/dist/cjs/tools/skill/load_skill_tool.js +4 -1
- package/dist/cjs/tools/skill/run_skill_inline_script_tool.js +8 -2
- package/dist/cjs/tools/skill/run_skill_script_tool.js +10 -2
- package/dist/cjs/tools/skill/search_skills_tool.js +2 -0
- package/dist/cjs/tools/skill/skill_toolset.js +35 -0
- package/dist/cjs/tools/tool_confirmation.js +26 -3
- package/dist/cjs/tools/url_context_tool.js +7 -7
- package/dist/cjs/tools/vertex_ai_search_tool.js +8 -9
- package/dist/cjs/tools/vertex_rag_retrieval_tool.js +7 -11
- package/dist/cjs/utils/async_hooks_shim.js +5 -2
- package/dist/cjs/utils/async_queue.js +45 -18
- package/dist/cjs/utils/branch_trie.js +2 -0
- package/dist/cjs/utils/case_utils.js +2 -0
- package/dist/cjs/utils/client_labels.js +5 -0
- package/dist/cjs/utils/crypto_shim.js +18 -0
- package/dist/cjs/utils/deprecated.js +68 -0
- package/dist/cjs/utils/env_aware_utils.js +41 -0
- package/dist/cjs/utils/error_utils.js +8 -0
- package/dist/cjs/utils/experimental.js +9 -2
- package/dist/cjs/utils/failover_utils.js +3 -0
- package/dist/cjs/utils/file_extension_utils.js +3 -0
- package/dist/cjs/utils/file_utils.js +7 -2
- package/dist/cjs/utils/gemini_schema_util.js +6 -8
- package/dist/cjs/utils/genai_schema_to_json.js +107 -0
- package/dist/cjs/utils/live_connection_utils.js +5 -2
- package/dist/cjs/utils/logger.js +28 -54
- package/dist/cjs/utils/logger_browser.js +86 -0
- package/dist/cjs/utils/logger_node.js +119 -0
- package/dist/cjs/utils/model_name.js +8 -0
- package/dist/cjs/utils/object_notation_utils.js +7 -3
- package/dist/cjs/utils/optional_peer.js +68 -0
- package/dist/cjs/utils/output_schema_utils.js +2 -0
- package/dist/cjs/utils/partial_copy.js +2 -0
- package/dist/cjs/utils/redact_inline_data.js +46 -0
- package/dist/cjs/utils/redact_uri.js +80 -0
- package/dist/cjs/utils/schema.js +178 -0
- package/dist/cjs/utils/simple_zod_to_json.js +17 -4
- package/dist/cjs/utils/ssrf_guard.js +262 -0
- package/dist/cjs/utils/streaming_utils.js +14 -6
- package/dist/cjs/utils/task.js +7 -4
- package/dist/cjs/utils/variant_utils.js +3 -1
- package/dist/cjs/utils/vertex_ai_utils.js +3 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/workflow/base_node.js +211 -0
- package/dist/cjs/workflow/branch_path.js +108 -0
- package/dist/cjs/workflow/dynamic_node_scheduler.js +220 -0
- package/dist/cjs/workflow/errors.js +178 -0
- package/dist/cjs/workflow/graph.js +158 -0
- package/dist/cjs/workflow/index.js +131 -0
- package/dist/cjs/workflow/node.js +65 -0
- package/dist/cjs/workflow/node_builders.js +68 -0
- package/dist/cjs/workflow/node_context.js +246 -0
- package/dist/cjs/workflow/node_error_event.js +86 -0
- package/dist/cjs/workflow/node_runner.js +459 -0
- package/dist/cjs/workflow/node_state.js +57 -0
- package/dist/cjs/workflow/node_status.js +48 -0
- package/dist/cjs/workflow/nodes/function_node.js +195 -0
- package/dist/cjs/workflow/nodes/join_node.js +56 -0
- package/dist/cjs/workflow/nodes/node_tool.js +147 -0
- package/dist/cjs/workflow/nodes/parallel_worker.js +129 -0
- package/dist/cjs/workflow/nodes/tool_node.js +117 -0
- package/dist/cjs/workflow/request_input.js +64 -0
- package/dist/cjs/workflow/retry_config.js +71 -0
- package/dist/cjs/workflow/run_llm_agent_as_node.js +192 -0
- package/dist/cjs/workflow/run_node_as_invocation.js +165 -0
- package/dist/cjs/workflow/schedule_dynamic_node.js +53 -0
- package/dist/cjs/workflow/trigger.js +27 -0
- package/dist/cjs/workflow/utils/graph_parser.js +212 -0
- package/dist/cjs/workflow/utils/graph_validation.js +216 -0
- package/dist/cjs/workflow/utils/hitl_utils.js +252 -0
- package/dist/cjs/workflow/utils/rehydration_utils.js +373 -0
- package/dist/cjs/workflow/utils/retry_utils.js +112 -0
- package/dist/cjs/workflow/utils/workflow_graph_utils.js +144 -0
- package/dist/cjs/workflow/workflow.js +509 -0
- package/dist/esm/a2a/a2a_event.js +18 -27
- package/dist/esm/a2a/a2a_remote_agent.js +16 -7
- package/dist/esm/a2a/a2a_remote_agent_run_processor.js +8 -3
- package/dist/esm/a2a/a2a_remote_agent_utils.js +110 -2
- package/dist/esm/a2a/agent_card.js +96 -8
- package/dist/esm/a2a/agent_executor.js +36 -19
- package/dist/esm/a2a/agent_to_a2a.js +52 -17
- package/dist/esm/a2a/auth.js +4 -0
- package/dist/esm/a2a/event_converter_utils.js +11 -0
- package/dist/esm/a2a/event_processor_utils.js +74 -35
- package/dist/esm/a2a/executor_context.js +7 -2
- package/dist/esm/a2a/index.js +26 -0
- package/dist/esm/a2a/metadata_converter_utils.js +6 -0
- package/dist/esm/a2a/part_converter_utils.js +13 -0
- package/dist/esm/a2a/request_metadata.js +68 -0
- package/dist/esm/agents/active_streaming_tool.js +6 -2
- package/dist/esm/agents/base_agent.js +56 -17
- package/dist/esm/agents/context.js +13 -2
- package/dist/esm/agents/framework_function_calls.js +34 -0
- package/dist/esm/agents/functions.js +191 -58
- package/dist/esm/agents/instructions.js +52 -12
- package/dist/esm/agents/invocation_context.js +42 -7
- package/dist/esm/agents/live_request_queue.js +30 -5
- package/dist/esm/agents/llm_agent.js +542 -50
- package/dist/esm/agents/loop_agent.js +22 -3
- package/dist/esm/agents/parallel_agent.js +24 -3
- package/dist/esm/agents/processors/agent_transfer_llm_request_processor.js +33 -8
- package/dist/esm/agents/processors/base_llm_processor.js +10 -4
- package/dist/esm/agents/processors/basic_llm_request_processor.js +7 -3
- package/dist/esm/agents/processors/code_execution_request_processor.js +21 -7
- package/dist/esm/agents/processors/content_processor_utils.js +88 -16
- package/dist/esm/agents/processors/content_request_processor.js +14 -5
- package/dist/esm/agents/processors/context_compactor_request_processor.js +6 -2
- package/dist/esm/agents/processors/identity_llm_request_processor.js +13 -4
- package/dist/esm/agents/processors/instructions_llm_request_processor.js +6 -2
- package/dist/esm/agents/processors/interactions_request_processor.js +6 -2
- package/dist/esm/agents/processors/request_confirmation_llm_request_processor.js +325 -93
- package/dist/esm/agents/processors/request_input_llm_request_processor.js +193 -0
- package/dist/esm/agents/processors/tool_filter_request_processor.js +6 -2
- package/dist/esm/agents/readonly_context.js +14 -3
- package/dist/esm/agents/routed_agent.js +7 -15
- package/dist/esm/agents/run_config.js +13 -0
- package/dist/esm/agents/sequential_agent.js +23 -4
- package/dist/esm/agents/user_input_request.js +120 -0
- package/dist/esm/apps/app.js +15 -12
- package/dist/esm/apps/resumability_config.js +3 -0
- package/dist/esm/artifacts/file_artifact_service.js +23 -4
- package/dist/esm/artifacts/gcs_artifact_service.js +58 -11
- package/dist/esm/artifacts/in_memory_artifact_service.js +10 -2
- package/dist/esm/artifacts/registry.js +7 -1
- package/dist/esm/artifacts/scoped_artifact_service.js +15 -2
- package/dist/esm/artifacts/session_artifact_service.js +12 -0
- package/dist/esm/auth/auth_handler.js +53 -10
- package/dist/esm/auth/auth_preprocessor.js +50 -41
- package/dist/esm/auth/auth_provider_registry.js +6 -2
- package/dist/esm/auth/auth_schemes.js +3 -0
- package/dist/esm/auth/credential_response_binding.js +74 -0
- package/dist/esm/auth/credential_service/in_memory_credential_service.js +6 -2
- package/dist/esm/auth/credential_service/session_state_credential_service.js +6 -2
- package/dist/esm/auth/exchanger/base_credential_exchanger.js +6 -2
- package/dist/esm/auth/exchanger/credential_exchanger_registry.js +6 -2
- package/dist/esm/auth/oauth2/oauth2_credential_exchanger.js +9 -2
- package/dist/esm/auth/oauth2/oauth2_credential_refresher.js +7 -3
- package/dist/esm/auth/oauth2/oauth2_discovery.js +8 -2
- package/dist/esm/auth/oauth2/oauth2_utils.js +22 -2
- package/dist/esm/auth/refresher/base_credential_refresher.js +6 -2
- package/dist/esm/auth/refresher/credential_refresher_registry.js +6 -2
- package/dist/esm/code_executors/agent_engine_sandbox_code_executor.js +3 -0
- package/dist/esm/code_executors/base_code_executor.js +8 -3
- package/dist/esm/code_executors/built_in_code_executor.js +8 -3
- package/dist/esm/code_executors/code_execution_utils.js +9 -2
- package/dist/esm/code_executors/code_executor_context.js +6 -2
- package/dist/esm/code_executors/container_code_executor.js +155 -0
- package/dist/esm/code_executors/docker_container.js +265 -0
- package/dist/esm/code_executors/unsafe_local_code_executor.js +20 -8
- package/dist/esm/common.js +181 -41
- package/dist/esm/context/agent_controlled_context_compactor.js +16 -7
- package/dist/esm/context/anchored_context_compactor.js +51 -21
- package/dist/esm/context/compaction_utils.js +17 -5
- package/dist/esm/context/summarizers/llm_summarizer.js +6 -2
- package/dist/esm/context/token_based_context_compactor.js +20 -5
- package/dist/esm/context/trajectory_thought_pruning_compactor.js +23 -12
- package/dist/esm/context/truncating_context_compactor.js +23 -7
- package/dist/esm/environment/base_environment.js +71 -0
- package/dist/esm/environment/local_environment.js +150 -0
- package/dist/esm/errors/already_exists_error.js +23 -0
- package/dist/esm/errors/input_validation_error.js +23 -0
- package/dist/esm/errors/not_found_error.js +23 -0
- package/dist/esm/errors/session_not_found_error.js +23 -0
- package/dist/esm/errors/tool_execution_error.js +40 -0
- package/dist/esm/events/compacted_event.js +5 -0
- package/dist/esm/events/event.js +38 -3
- package/dist/esm/events/event_actions.js +12 -0
- package/dist/esm/events/structured_events.js +3 -0
- package/dist/esm/examples/base_example_provider.js +8 -3
- package/dist/esm/examples/example_util.js +4 -0
- package/dist/esm/features/feature_registry.js +8 -0
- package/dist/esm/index.js +41 -15
- package/dist/esm/index_web.js +2 -0
- package/dist/esm/integrations/agent_registry/agent_registry.js +11 -6
- package/dist/esm/integrations/agent_registry/agent_registry_mcp_toolset.js +6 -2
- package/dist/esm/integrations/agent_registry/helpers.js +4 -0
- package/dist/esm/memory/in_memory_memory_service.js +9 -2
- package/dist/esm/memory/rag_memory_transcript.js +106 -0
- package/dist/esm/memory/vertex_ai_memory_bank_service.js +20 -4
- package/dist/esm/memory/vertex_ai_rag_api.js +93 -0
- package/dist/esm/memory/vertex_ai_rag_memory_service.js +208 -0
- package/dist/esm/models/apigee_llm.js +11 -4
- package/dist/esm/models/base_llm.js +9 -4
- package/dist/esm/models/chrome_prompt_llm.js +285 -0
- package/dist/esm/models/chrome_prompt_utils.js +192 -0
- package/dist/esm/models/gemini_llm_connection.js +6 -2
- package/dist/esm/models/google_llm.js +35 -17
- package/dist/esm/models/interactions_utils.js +19 -3
- package/dist/esm/models/llm_request.js +5 -0
- package/dist/esm/models/llm_response.js +3 -0
- package/dist/esm/models/registry.js +9 -2
- package/dist/esm/models/routed_llm.js +4 -14
- package/dist/esm/plugins/_reflect_retry_utils.js +111 -0
- package/dist/esm/plugins/base_plugin.js +39 -5
- package/dist/esm/plugins/global_instruction_plugin.js +6 -2
- package/dist/esm/plugins/logging_plugin.js +14 -8
- package/dist/esm/plugins/plugin_manager.js +38 -2
- package/dist/esm/plugins/reflect_retry_model_plugin.js +250 -0
- package/dist/esm/plugins/reflect_retry_tool_plugin.js +254 -0
- package/dist/esm/plugins/security_plugin.js +14 -6
- package/dist/esm/runner/in_memory_runner.js +6 -2
- package/dist/esm/runner/runner.js +249 -46
- package/dist/esm/sessions/base_session_service.js +14 -2
- package/dist/esm/sessions/database_session_service.js +65 -27
- package/dist/esm/sessions/db/operations.js +259 -24
- package/dist/esm/sessions/db/schema.js +116 -157
- package/dist/esm/sessions/in_memory_session_service.js +23 -14
- package/dist/esm/sessions/registry.js +10 -2
- package/dist/esm/sessions/session.js +3 -0
- package/dist/esm/sessions/state.js +78 -7
- package/dist/esm/sessions/state_write_order.js +74 -0
- package/dist/esm/sessions/vertex_ai_session_service.js +111 -16
- package/dist/esm/skills/gcp_skill_registry.js +2 -0
- package/dist/esm/skills/loader.js +23 -10
- package/dist/esm/skills/prompt.js +4 -0
- package/dist/esm/telemetry/google_cloud.js +54 -9
- package/dist/esm/telemetry/setup.js +7 -1
- package/dist/esm/telemetry/tracing.js +70 -5
- package/dist/esm/tools/agent_tool.js +11 -7
- package/dist/esm/tools/base_tool.js +36 -5
- package/dist/esm/tools/base_toolset.js +11 -6
- package/dist/esm/tools/built_in_tool.js +51 -0
- package/dist/esm/tools/consolidate_context_tool.js +6 -2
- package/dist/esm/tools/enterprise_web_search_tool.js +9 -7
- package/dist/esm/tools/example_tool.js +6 -2
- package/dist/esm/tools/exit_loop_tool.js +6 -2
- package/dist/esm/tools/finish_task_tool.js +92 -0
- package/dist/esm/tools/forwarding_artifact_service.js +24 -15
- package/dist/esm/tools/function_tool.js +80 -11
- package/dist/esm/tools/get_user_choice_tool.js +4 -2
- package/dist/esm/tools/google_maps_grounding_tool.js +9 -7
- package/dist/esm/tools/google_search_tool.js +8 -7
- package/dist/esm/tools/load_artifacts_tool.js +57 -26
- package/dist/esm/tools/load_memory_tool.js +6 -2
- package/dist/esm/tools/load_web_page.js +19 -158
- package/dist/esm/tools/long_running_tool.js +6 -2
- package/dist/{web/context/summarizers/base_summarizer.js → esm/tools/mcp/index.js} +4 -0
- package/dist/esm/tools/mcp/load_mcp_resource_tool.js +40 -7
- package/dist/esm/tools/mcp/mcp_session_manager.js +45 -9
- package/dist/esm/tools/mcp/mcp_tool.js +6 -2
- package/dist/esm/tools/mcp/mcp_toolset.js +6 -2
- package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +18 -2
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +2 -0
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +2 -0
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +30 -9
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +3 -1
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +6 -2
- package/dist/esm/tools/openapi_tool/openapi_toolset.js +2 -0
- package/dist/esm/tools/openapi_tool/rest_api_tool.js +39 -23
- package/dist/esm/tools/preload_memory_tool.js +7 -3
- package/dist/esm/tools/request_input_tool.js +7 -4
- package/dist/esm/tools/retrieval/base_retrieval_tool.js +33 -0
- package/dist/esm/tools/retrieval/files_retrieval.js +81 -0
- package/dist/esm/tools/retrieval/llama_index_retrieval.js +30 -0
- package/dist/esm/tools/skill/list_skills_tool.js +2 -0
- package/dist/esm/tools/skill/load_skill_resource_tool.js +2 -0
- package/dist/esm/tools/skill/load_skill_tool.js +4 -1
- package/dist/esm/tools/skill/run_skill_inline_script_tool.js +8 -2
- package/dist/esm/tools/skill/run_skill_script_tool.js +10 -2
- package/dist/esm/tools/skill/search_skills_tool.js +2 -0
- package/dist/esm/tools/skill/skill_toolset.js +25 -0
- package/dist/esm/tools/tool_confirmation.js +24 -2
- package/dist/esm/tools/url_context_tool.js +8 -7
- package/dist/esm/tools/vertex_ai_search_tool.js +9 -9
- package/dist/esm/tools/vertex_rag_retrieval_tool.js +8 -11
- package/dist/esm/utils/async_hooks_shim.js +6 -2
- package/dist/esm/utils/async_queue.js +46 -18
- package/dist/esm/utils/branch_trie.js +3 -0
- package/dist/esm/utils/case_utils.js +3 -0
- package/dist/esm/utils/client_labels.js +6 -0
- package/dist/esm/utils/crypto_shim.js +17 -0
- package/dist/esm/utils/deprecated.js +40 -0
- package/dist/esm/utils/env_aware_utils.js +41 -0
- package/dist/esm/utils/error_utils.js +9 -0
- package/dist/esm/utils/experimental.js +10 -2
- package/dist/esm/utils/failover_utils.js +4 -0
- package/dist/esm/utils/file_extension_utils.js +4 -0
- package/dist/esm/utils/file_utils.js +8 -2
- package/dist/esm/utils/gemini_schema_util.js +7 -8
- package/dist/esm/utils/genai_schema_to_json.js +80 -0
- package/dist/esm/utils/live_connection_utils.js +6 -2
- package/dist/esm/utils/logger.js +28 -44
- package/dist/esm/utils/logger_browser.js +58 -0
- package/dist/esm/utils/logger_node.js +81 -0
- package/dist/esm/utils/model_name.js +9 -0
- package/dist/esm/utils/object_notation_utils.js +8 -3
- package/dist/esm/utils/optional_peer.js +41 -0
- package/dist/esm/utils/output_schema_utils.js +3 -0
- package/dist/esm/utils/partial_copy.js +3 -0
- package/dist/esm/utils/redact_inline_data.js +19 -0
- package/dist/esm/utils/redact_uri.js +53 -0
- package/dist/esm/utils/schema.js +152 -0
- package/dist/esm/utils/simple_zod_to_json.js +15 -4
- package/dist/esm/utils/ssrf_guard.js +230 -0
- package/dist/esm/utils/streaming_utils.js +15 -6
- package/dist/esm/utils/task.js +8 -4
- package/dist/esm/utils/variant_utils.js +5 -2
- package/dist/esm/utils/vertex_ai_utils.js +5 -2
- package/dist/esm/version.js +1 -1
- package/dist/esm/workflow/base_node.js +182 -0
- package/dist/esm/workflow/branch_path.js +77 -0
- package/dist/esm/workflow/dynamic_node_scheduler.js +202 -0
- package/dist/esm/workflow/errors.js +140 -0
- package/dist/esm/workflow/graph.js +127 -0
- package/dist/esm/workflow/index.js +80 -0
- package/dist/esm/workflow/node.js +38 -0
- package/dist/esm/workflow/node_builders.js +40 -0
- package/dist/esm/workflow/node_context.js +219 -0
- package/dist/esm/workflow/node_error_event.js +57 -0
- package/dist/esm/workflow/node_runner.js +439 -0
- package/dist/esm/workflow/node_state.js +29 -0
- package/dist/esm/workflow/node_status.js +20 -0
- package/dist/esm/workflow/nodes/function_node.js +172 -0
- package/dist/esm/workflow/nodes/join_node.js +29 -0
- package/dist/esm/workflow/nodes/node_tool.js +122 -0
- package/dist/esm/workflow/nodes/parallel_worker.js +102 -0
- package/dist/esm/workflow/nodes/tool_node.js +90 -0
- package/dist/esm/workflow/request_input.js +36 -0
- package/dist/esm/workflow/retry_config.js +43 -0
- package/dist/esm/workflow/run_llm_agent_as_node.js +172 -0
- package/dist/esm/workflow/run_node_as_invocation.js +139 -0
- package/dist/esm/workflow/schedule_dynamic_node.js +26 -0
- package/dist/esm/workflow/utils/graph_parser.js +188 -0
- package/dist/esm/workflow/utils/graph_validation.js +189 -0
- package/dist/esm/workflow/utils/hitl_utils.js +222 -0
- package/dist/esm/workflow/utils/rehydration_utils.js +342 -0
- package/dist/esm/workflow/utils/retry_utils.js +82 -0
- package/dist/esm/workflow/utils/workflow_graph_utils.js +115 -0
- package/dist/esm/workflow/workflow.js +493 -0
- package/dist/types/a2a/a2a_event.d.ts +7 -10
- package/dist/types/a2a/a2a_remote_agent.d.ts +5 -0
- package/dist/types/a2a/a2a_remote_agent_utils.d.ts +25 -0
- package/dist/types/a2a/agent_card.d.ts +12 -3
- package/dist/types/a2a/agent_executor.d.ts +1 -1
- package/dist/types/a2a/agent_to_a2a.d.ts +6 -4
- package/dist/types/a2a/auth.d.ts +5 -1
- package/dist/types/a2a/event_processor_utils.d.ts +17 -2
- package/dist/types/a2a/executor_context.d.ts +7 -1
- package/dist/types/a2a/index.d.ts +18 -0
- package/dist/types/a2a/request_metadata.d.ts +22 -0
- package/dist/types/agents/base_agent.d.ts +56 -25
- package/dist/types/agents/context.d.ts +8 -0
- package/dist/types/agents/framework_function_calls.d.ts +26 -0
- package/dist/types/agents/functions.d.ts +73 -8
- package/dist/types/agents/invocation_context.d.ts +106 -6
- package/dist/types/agents/live_request_queue.d.ts +7 -1
- package/dist/types/agents/llm_agent.d.ts +86 -8
- package/dist/types/agents/loop_agent.d.ts +5 -0
- package/dist/types/agents/parallel_agent.d.ts +5 -0
- package/dist/types/agents/processors/agent_transfer_llm_request_processor.d.ts +16 -1
- package/dist/types/agents/processors/content_processor_utils.d.ts +3 -2
- package/dist/types/agents/processors/identity_llm_request_processor.d.ts +4 -1
- package/dist/types/agents/processors/request_input_llm_request_processor.d.ts +21 -0
- package/dist/types/agents/readonly_context.d.ts +4 -0
- package/dist/types/agents/run_config.d.ts +72 -4
- package/dist/types/agents/sequential_agent.d.ts +5 -0
- package/dist/types/agents/user_input_request.d.ts +71 -0
- package/dist/types/apps/app.d.ts +8 -3
- package/dist/types/artifacts/gcs_artifact_service.d.ts +9 -2
- package/dist/types/artifacts/scoped_artifact_service.d.ts +13 -0
- package/dist/types/artifacts/session_artifact_service.d.ts +8 -1
- package/dist/types/auth/auth_credential.d.ts +13 -8
- package/dist/types/auth/auth_handler.d.ts +12 -1
- package/dist/types/auth/credential_response_binding.d.ts +24 -0
- package/dist/types/auth/oauth2/oauth2_credential_refresher.d.ts +1 -1
- package/dist/types/auth/oauth2/oauth2_utils.d.ts +9 -0
- package/dist/types/auth/refresher/base_credential_refresher.d.ts +1 -1
- package/dist/types/code_executors/code_execution_utils.d.ts +1 -1
- package/dist/types/code_executors/container_code_executor.d.ts +89 -0
- package/dist/types/code_executors/docker_container.d.ts +79 -0
- package/dist/types/common.d.ts +39 -27
- package/dist/types/context/compaction_utils.d.ts +9 -1
- package/dist/types/environment/base_environment.d.ts +101 -0
- package/dist/types/environment/local_environment.d.ts +72 -0
- package/dist/types/errors/already_exists_error.d.ts +14 -0
- package/dist/types/errors/input_validation_error.d.ts +14 -0
- package/dist/types/errors/not_found_error.d.ts +14 -0
- package/dist/types/errors/session_not_found_error.d.ts +14 -0
- package/dist/types/errors/tool_execution_error.d.ts +36 -0
- package/dist/types/events/event.d.ts +94 -1
- package/dist/types/events/event_actions.d.ts +23 -0
- package/dist/types/index.d.ts +27 -14
- package/dist/types/memory/rag_memory_transcript.d.ts +55 -0
- package/dist/types/memory/vertex_ai_rag_api.d.ts +89 -0
- package/dist/types/memory/vertex_ai_rag_memory_service.d.ts +68 -0
- package/dist/types/models/apigee_llm.d.ts +4 -4
- package/dist/types/models/chrome_prompt_llm.d.ts +210 -0
- package/dist/types/models/chrome_prompt_utils.d.ts +68 -0
- package/dist/types/models/google_llm.d.ts +10 -4
- package/dist/types/models/registry.d.ts +3 -2
- package/dist/types/plugins/_reflect_retry_utils.d.ts +72 -0
- package/dist/types/plugins/base_plugin.d.ts +47 -10
- package/dist/types/plugins/logging_plugin.d.ts +3 -2
- package/dist/types/plugins/plugin_manager.d.ts +20 -0
- package/dist/types/plugins/reflect_retry_model_plugin.d.ts +132 -0
- package/dist/types/plugins/reflect_retry_tool_plugin.d.ts +187 -0
- package/dist/types/plugins/security_plugin.d.ts +4 -2
- package/dist/types/runner/in_memory_runner.d.ts +2 -2
- package/dist/types/runner/runner.d.ts +64 -9
- package/dist/types/sessions/base_session_service.d.ts +2 -2
- package/dist/types/sessions/database_session_service.d.ts +1 -1
- package/dist/types/sessions/db/operations.d.ts +13 -1
- package/dist/types/sessions/db/schema.d.ts +23 -9
- package/dist/types/sessions/state.d.ts +34 -1
- package/dist/types/sessions/state_write_order.d.ts +39 -0
- package/dist/types/telemetry/tracing.d.ts +15 -0
- package/dist/types/tools/base_tool.d.ts +26 -0
- package/dist/types/tools/base_toolset.d.ts +3 -4
- package/dist/types/tools/built_in_tool.d.ts +41 -0
- package/dist/types/tools/enterprise_web_search_tool.d.ts +4 -4
- package/dist/types/tools/finish_task_tool.d.ts +47 -0
- package/dist/types/tools/forwarding_artifact_service.d.ts +23 -10
- package/dist/types/tools/function_tool.d.ts +88 -10
- package/dist/types/tools/google_maps_grounding_tool.d.ts +4 -4
- package/dist/types/tools/google_search_tool.d.ts +4 -4
- package/dist/types/tools/long_running_tool.d.ts +1 -1
- package/dist/types/tools/mcp/index.d.ts +13 -0
- package/dist/types/tools/mcp/mcp_session_manager.d.ts +3 -3
- package/dist/types/tools/mcp/mcp_tool.d.ts +1 -1
- package/dist/types/tools/mcp/mcp_toolset.d.ts +12 -11
- package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +5 -0
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.d.ts +0 -1
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.d.ts +0 -1
- package/dist/types/tools/preload_memory_tool.d.ts +1 -1
- package/dist/types/tools/request_input_tool.d.ts +6 -1
- package/dist/types/tools/resume_inputs.d.ts +25 -0
- package/dist/types/tools/retrieval/base_retrieval_tool.d.ts +21 -0
- package/dist/types/tools/retrieval/files_retrieval.d.ts +50 -0
- package/dist/types/tools/retrieval/llama_index_retrieval.d.ts +62 -0
- package/dist/types/tools/skill/skill_toolset.d.ts +26 -0
- package/dist/types/tools/tool_confirmation.d.ts +47 -0
- package/dist/types/tools/url_context_tool.d.ts +4 -4
- package/dist/types/tools/vertex_ai_search_tool.d.ts +4 -4
- package/dist/types/tools/vertex_rag_retrieval_tool.d.ts +13 -12
- package/dist/types/utils/async_queue.d.ts +34 -2
- package/dist/types/utils/crypto_shim.d.ts +16 -0
- package/dist/types/utils/deprecated.d.ts +21 -0
- package/dist/types/utils/env_aware_utils.d.ts +16 -0
- package/dist/types/utils/file_utils.d.ts +10 -2
- package/dist/types/utils/gemini_schema_util.d.ts +5 -7
- package/dist/types/utils/genai_schema_to_json.d.ts +25 -0
- package/dist/types/utils/logger.d.ts +23 -1
- package/dist/types/utils/logger_browser.d.ts +28 -0
- package/dist/types/utils/logger_node.d.ts +20 -0
- package/dist/types/utils/optional_peer.d.ts +36 -0
- package/dist/types/utils/output_schema_utils.d.ts +3 -3
- package/dist/types/utils/redact_inline_data.d.ts +16 -0
- package/dist/types/utils/redact_uri.d.ts +32 -0
- package/dist/types/utils/schema.d.ts +73 -0
- package/dist/types/utils/simple_zod_to_json.d.ts +8 -0
- package/dist/types/utils/ssrf_guard.d.ts +32 -0
- package/dist/types/utils/vertex_ai_utils.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/workflow/base_node.d.ts +142 -0
- package/dist/types/workflow/branch_path.d.ts +40 -0
- package/dist/types/workflow/dynamic_node_scheduler.d.ts +64 -0
- package/dist/types/workflow/errors.d.ts +132 -0
- package/dist/types/workflow/graph.d.ts +127 -0
- package/dist/types/workflow/index.d.ts +46 -0
- package/dist/types/workflow/node.d.ts +48 -0
- package/dist/types/workflow/node_builders.d.ts +25 -0
- package/dist/types/workflow/node_context.d.ts +208 -0
- package/dist/types/workflow/node_error_event.d.ts +18 -0
- package/dist/types/workflow/node_runner.d.ts +82 -0
- package/dist/types/workflow/node_state.d.ts +47 -0
- package/dist/types/workflow/node_status.d.ts +28 -0
- package/dist/types/workflow/nodes/function_node.d.ts +78 -0
- package/dist/types/workflow/nodes/join_node.d.ts +24 -0
- package/dist/types/workflow/nodes/node_tool.d.ts +53 -0
- package/dist/types/workflow/nodes/parallel_worker.d.ts +55 -0
- package/dist/types/workflow/nodes/tool_node.d.ts +34 -0
- package/dist/types/workflow/request_input.d.ts +73 -0
- package/dist/types/workflow/retry_config.d.ts +84 -0
- package/dist/types/workflow/run_llm_agent_as_node.d.ts +28 -0
- package/dist/types/workflow/run_node_as_invocation.d.ts +72 -0
- package/dist/types/workflow/schedule_dynamic_node.d.ts +66 -0
- package/dist/types/workflow/trigger.d.ts +22 -0
- package/dist/types/workflow/utils/graph_parser.d.ts +8 -0
- package/dist/types/workflow/utils/graph_validation.d.ts +18 -0
- package/dist/types/workflow/utils/hitl_utils.d.ts +92 -0
- package/dist/types/workflow/utils/rehydration_utils.d.ts +132 -0
- package/dist/types/workflow/utils/retry_utils.d.ts +54 -0
- package/dist/types/workflow/utils/workflow_graph_utils.d.ts +76 -0
- package/dist/types/workflow/workflow.d.ts +115 -0
- package/dist/web/index_web.js +304 -3
- package/dist/web/index_web.js.map +7 -0
- package/package.json +97 -20
- package/dist/web/a2a/a2a_event.js +0 -271
- package/dist/web/a2a/a2a_remote_agent.js +0 -196
- package/dist/web/a2a/a2a_remote_agent_run_processor.js +0 -184
- package/dist/web/a2a/a2a_remote_agent_utils.js +0 -133
- package/dist/web/a2a/agent_card.js +0 -342
- package/dist/web/a2a/agent_executor.js +0 -218
- package/dist/web/a2a/agent_to_a2a.js +0 -97
- package/dist/web/a2a/auth.js +0 -37
- package/dist/web/a2a/event_converter_utils.js +0 -232
- package/dist/web/a2a/event_processor_utils.js +0 -170
- package/dist/web/a2a/executor_context.js +0 -25
- package/dist/web/a2a/metadata_converter_utils.js +0 -110
- package/dist/web/a2a/part_converter_utils.js +0 -188
- package/dist/web/agents/active_streaming_tool.js +0 -21
- package/dist/web/agents/base_agent.js +0 -423
- package/dist/web/agents/context.js +0 -142
- package/dist/web/agents/functions.js +0 -433
- package/dist/web/agents/instructions.js +0 -148
- package/dist/web/agents/invocation_context.js +0 -77
- package/dist/web/agents/live_request_queue.js +0 -126
- package/dist/web/agents/llm_agent.js +0 -936
- package/dist/web/agents/loop_agent.js +0 -112
- package/dist/web/agents/parallel_agent.js +0 -101
- package/dist/web/agents/processors/agent_transfer_llm_request_processor.js +0 -109
- package/dist/web/agents/processors/base_llm_processor.js +0 -15
- package/dist/web/agents/processors/basic_llm_request_processor.js +0 -81
- package/dist/web/agents/processors/code_execution_request_processor.js +0 -367
- package/dist/web/agents/processors/content_processor_utils.js +0 -361
- package/dist/web/agents/processors/content_request_processor.js +0 -67
- package/dist/web/agents/processors/context_compactor_request_processor.js +0 -74
- package/dist/web/agents/processors/identity_llm_request_processor.js +0 -50
- package/dist/web/agents/processors/instructions_llm_request_processor.js +0 -81
- package/dist/web/agents/processors/interactions_request_processor.js +0 -52
- package/dist/web/agents/processors/request_confirmation_llm_request_processor.js +0 -168
- package/dist/web/agents/processors/tool_filter_request_processor.js +0 -68
- package/dist/web/agents/readonly_context.js +0 -55
- package/dist/web/agents/routed_agent.js +0 -169
- package/dist/web/agents/run_config.js +0 -62
- package/dist/web/agents/sequential_agent.js +0 -122
- package/dist/web/agents/transcription_entry.js +0 -7
- package/dist/web/apps/app.js +0 -49
- package/dist/web/apps/resumability_config.js +0 -31
- package/dist/web/artifacts/base_artifact_service.js +0 -7
- package/dist/web/artifacts/file_artifact_service.js +0 -548
- package/dist/web/artifacts/gcs_artifact_service.js +0 -253
- package/dist/web/artifacts/in_memory_artifact_service.js +0 -164
- package/dist/web/artifacts/registry.js +0 -30
- package/dist/web/artifacts/scoped_artifact_service.js +0 -86
- package/dist/web/auth/auth_credential.js +0 -18
- package/dist/web/auth/auth_handler.js +0 -148
- package/dist/web/auth/auth_preprocessor.js +0 -175
- package/dist/web/auth/auth_provider_registry.js +0 -33
- package/dist/web/auth/auth_schemes.js +0 -33
- package/dist/web/auth/auth_tool.js +0 -7
- package/dist/web/auth/credential_service/base_credential_service.js +0 -7
- package/dist/web/auth/credential_service/in_memory_credential_service.js +0 -46
- package/dist/web/auth/credential_service/session_state_credential_service.js +0 -23
- package/dist/web/auth/exchanger/base_credential_exchanger.js +0 -12
- package/dist/web/auth/exchanger/credential_exchanger_registry.js +0 -31
- package/dist/web/auth/oauth2/oauth2_credential_exchanger.js +0 -188
- package/dist/web/auth/oauth2/oauth2_credential_refresher.js +0 -102
- package/dist/web/auth/oauth2/oauth2_discovery.js +0 -190
- package/dist/web/auth/oauth2/oauth2_utils.js +0 -98
- package/dist/web/auth/refresher/base_credential_refresher.js +0 -16
- package/dist/web/auth/refresher/credential_refresher_registry.js +0 -40
- package/dist/web/code_executors/agent_engine_sandbox_code_executor.js +0 -281
- package/dist/web/code_executors/base_code_executor.js +0 -63
- package/dist/web/code_executors/built_in_code_executor.js +0 -45
- package/dist/web/code_executors/code_execution_utils.js +0 -124
- package/dist/web/code_executors/code_executor_context.js +0 -170
- package/dist/web/code_executors/unsafe_local_code_executor.js +0 -214
- package/dist/web/common.js +0 -347
- package/dist/web/context/agent_controlled_context_compactor.js +0 -72
- package/dist/web/context/anchored_context_compactor.js +0 -117
- package/dist/web/context/base_context_compactor.js +0 -7
- package/dist/web/context/compaction_utils.js +0 -38
- package/dist/web/context/summarizers/llm_summarizer.js +0 -87
- package/dist/web/context/token_based_context_compactor.js +0 -111
- package/dist/web/context/trajectory_thought_pruning_compactor.js +0 -43
- package/dist/web/context/truncating_context_compactor.js +0 -30
- package/dist/web/events/compacted_event.js +0 -47
- package/dist/web/events/event.js +0 -174
- package/dist/web/events/event_actions.js +0 -69
- package/dist/web/events/structured_events.js +0 -76
- package/dist/web/examples/base_example_provider.js +0 -27
- package/dist/web/examples/example.js +0 -7
- package/dist/web/examples/example_util.js +0 -79
- package/dist/web/features/feature_registry.js +0 -107
- package/dist/web/index.js +0 -68
- package/dist/web/integrations/agent_registry/agent_registry.js +0 -333
- package/dist/web/integrations/agent_registry/agent_registry_mcp_toolset.js +0 -117
- package/dist/web/integrations/agent_registry/helpers.js +0 -28
- package/dist/web/integrations/agent_registry/types.js +0 -20
- package/dist/web/memory/base_memory_service.js +0 -7
- package/dist/web/memory/in_memory_memory_service.js +0 -82
- package/dist/web/memory/memory_entry.js +0 -7
- package/dist/web/memory/vertex_ai_memory_bank_service.js +0 -481
- package/dist/web/models/apigee_llm.js +0 -221
- package/dist/web/models/base_llm.js +0 -73
- package/dist/web/models/base_llm_connection.js +0 -7
- package/dist/web/models/gemini_llm_connection.js +0 -179
- package/dist/web/models/google_llm.js +0 -384
- package/dist/web/models/interactions_utils.js +0 -728
- package/dist/web/models/llm_request.js +0 -52
- package/dist/web/models/llm_response.js +0 -45
- package/dist/web/models/registry.js +0 -95
- package/dist/web/models/routed_llm.js +0 -122
- package/dist/web/plugins/base_plugin.js +0 -271
- package/dist/web/plugins/global_instruction_plugin.js +0 -67
- package/dist/web/plugins/logging_plugin.js +0 -235
- package/dist/web/plugins/plugin_manager.js +0 -282
- package/dist/web/plugins/security_plugin.js +0 -140
- package/dist/web/runner/in_memory_runner.js +0 -46
- package/dist/web/runner/runner.js +0 -535
- package/dist/web/sessions/base_session_service.js +0 -111
- package/dist/web/sessions/database_session_service.js +0 -436
- package/dist/web/sessions/db/operations.js +0 -96
- package/dist/web/sessions/db/schema.js +0 -208
- package/dist/web/sessions/in_memory_session_service.js +0 -242
- package/dist/web/sessions/registry.js +0 -34
- package/dist/web/sessions/session.js +0 -20
- package/dist/web/sessions/state.js +0 -89
- package/dist/web/sessions/vertex_ai_session_service.js +0 -443
- package/dist/web/skills/gcp_skill_registry.js +0 -78
- package/dist/web/skills/loader.js +0 -360
- package/dist/web/skills/prompt.js +0 -30
- package/dist/web/skills/skill.js +0 -67
- package/dist/web/skills/skill_registry.js +0 -7
- package/dist/web/telemetry/google_cloud.js +0 -54
- package/dist/web/telemetry/setup.js +0 -83
- package/dist/web/telemetry/tracing.js +0 -234
- package/dist/web/tools/agent_tool.js +0 -145
- package/dist/web/tools/base_tool.js +0 -93
- package/dist/web/tools/base_toolset.js +0 -57
- package/dist/web/tools/consolidate_context_tool.js +0 -51
- package/dist/web/tools/enterprise_web_search_tool.js +0 -55
- package/dist/web/tools/example_tool.js +0 -42
- package/dist/web/tools/exit_loop_tool.js +0 -43
- package/dist/web/tools/forwarding_artifact_service.js +0 -47
- package/dist/web/tools/function_tool.js +0 -85
- package/dist/web/tools/get_user_choice_tool.js +0 -25
- package/dist/web/tools/google_maps_grounding_tool.js +0 -54
- package/dist/web/tools/google_search_tool.js +0 -51
- package/dist/web/tools/load_artifacts_tool.js +0 -152
- package/dist/web/tools/load_memory_tool.js +0 -79
- package/dist/web/tools/load_web_page.js +0 -221
- package/dist/web/tools/long_running_tool.js +0 -55
- package/dist/web/tools/mcp/load_mcp_resource_tool.js +0 -107
- package/dist/web/tools/mcp/mcp_session_manager.js +0 -78
- package/dist/web/tools/mcp/mcp_tool.js +0 -43
- package/dist/web/tools/mcp/mcp_toolset.js +0 -141
- package/dist/web/tools/openapi_tool/auth/auth_helpers.js +0 -48
- package/dist/web/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +0 -60
- package/dist/web/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +0 -111
- package/dist/web/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +0 -221
- package/dist/web/tools/openapi_tool/openapi_spec_parser/operation_parser.js +0 -198
- package/dist/web/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +0 -94
- package/dist/web/tools/openapi_tool/openapi_toolset.js +0 -97
- package/dist/web/tools/openapi_tool/rest_api_tool.js +0 -229
- package/dist/web/tools/preload_memory_tool.js +0 -77
- package/dist/web/tools/request_input_tool.js +0 -26
- package/dist/web/tools/skill/list_skills_tool.js +0 -50
- package/dist/web/tools/skill/load_skill_resource_tool.js +0 -190
- package/dist/web/tools/skill/load_skill_tool.js +0 -93
- package/dist/web/tools/skill/run_skill_inline_script_tool.js +0 -167
- package/dist/web/tools/skill/run_skill_script_tool.js +0 -201
- package/dist/web/tools/skill/search_skills_tool.js +0 -82
- package/dist/web/tools/skill/skill_toolset.js +0 -160
- package/dist/web/tools/tool_confirmation.js +0 -21
- package/dist/web/tools/url_context_tool.js +0 -44
- package/dist/web/tools/vertex_ai_search_tool.js +0 -103
- package/dist/web/tools/vertex_rag_retrieval_tool.js +0 -36
- package/dist/web/utils/async_hooks_shim.js +0 -24
- package/dist/web/utils/async_queue.js +0 -60
- package/dist/web/utils/branch_trie.js +0 -13
- package/dist/web/utils/case_utils.js +0 -25
- package/dist/web/utils/client_labels.js +0 -64
- package/dist/web/utils/crypto_shim.js +0 -15
- package/dist/web/utils/env_aware_utils.js +0 -74
- package/dist/web/utils/error_utils.js +0 -92
- package/dist/web/utils/experimental.js +0 -46
- package/dist/web/utils/failover_utils.js +0 -96
- package/dist/web/utils/file_extension_utils.js +0 -51
- package/dist/web/utils/file_utils.js +0 -103
- package/dist/web/utils/gemini_schema_util.js +0 -173
- package/dist/web/utils/live_connection_utils.js +0 -254
- package/dist/web/utils/logger.js +0 -130
- package/dist/web/utils/model_name.js +0 -66
- package/dist/web/utils/object_notation_utils.js +0 -49
- package/dist/web/utils/output_schema_utils.js +0 -15
- package/dist/web/utils/partial_copy.js +0 -23
- package/dist/web/utils/simple_zod_to_json.js +0 -123
- package/dist/web/utils/streaming_utils.js +0 -430
- package/dist/web/utils/task.js +0 -34
- package/dist/web/utils/variant_utils.js +0 -20
- package/dist/web/utils/vertex_ai_utils.js +0 -24
- package/dist/web/version.js +0 -11
- /package/dist/{web/artifacts/session_artifact_service.js → esm/tools/resume_inputs.js} +0 -0
- /package/dist/{web/auth/base_auth_provider.js → esm/workflow/trigger.js} +0 -0
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
-
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2026 Google LLC
|
|
22
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
23
|
-
*/
|
|
24
|
-
import { isGemini3xFlashLive } from "./model_name.js";
|
|
25
|
-
class LiveResponseAggregator {
|
|
26
|
-
constructor(modelVersion) {
|
|
27
|
-
this.modelVersion = modelVersion;
|
|
28
|
-
this.text = "";
|
|
29
|
-
this.isThought = false;
|
|
30
|
-
this.toolCallParts = [];
|
|
31
|
-
this.pendingGroundingMetadata = void 0;
|
|
32
|
-
this.inputTranscriptionText = "";
|
|
33
|
-
this.outputTranscriptionText = "";
|
|
34
|
-
}
|
|
35
|
-
*processMessage(message) {
|
|
36
|
-
if (message.usageMetadata) {
|
|
37
|
-
yield __spreadValues({
|
|
38
|
-
usageMetadata: message.usageMetadata
|
|
39
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
40
|
-
}
|
|
41
|
-
if (message.serverContent) {
|
|
42
|
-
const serverContent = message.serverContent;
|
|
43
|
-
const content = serverContent.modelTurn;
|
|
44
|
-
if (serverContent.groundingMetadata) {
|
|
45
|
-
this.pendingGroundingMetadata = serverContent.groundingMetadata;
|
|
46
|
-
}
|
|
47
|
-
if (!(content && content.parts) && serverContent.groundingMetadata && !serverContent.turnComplete) {
|
|
48
|
-
yield __spreadValues(__spreadValues({
|
|
49
|
-
groundingMetadata: serverContent.groundingMetadata
|
|
50
|
-
}, serverContent.interrupted !== void 0 ? { interrupted: serverContent.interrupted } : {}), this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
51
|
-
}
|
|
52
|
-
if (content && content.parts) {
|
|
53
|
-
const llmResponse = __spreadValues(__spreadValues({
|
|
54
|
-
content
|
|
55
|
-
}, serverContent.interrupted !== void 0 ? { interrupted: serverContent.interrupted } : {}), this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
56
|
-
if (!serverContent.turnComplete && serverContent.groundingMetadata) {
|
|
57
|
-
llmResponse.groundingMetadata = serverContent.groundingMetadata;
|
|
58
|
-
}
|
|
59
|
-
const hasInlineData = content.parts.some((p) => p.inlineData);
|
|
60
|
-
for (const part of content.parts) {
|
|
61
|
-
if (part.text) {
|
|
62
|
-
const currentIsThought = !!part.thought;
|
|
63
|
-
if (this.text && currentIsThought !== this.isThought) {
|
|
64
|
-
yield this.buildFullTextResponse(this.text, this.isThought);
|
|
65
|
-
this.text = "";
|
|
66
|
-
this.isThought = false;
|
|
67
|
-
}
|
|
68
|
-
this.text += part.text;
|
|
69
|
-
this.isThought = currentIsThought;
|
|
70
|
-
llmResponse.partial = true;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (this.text && !content.parts.some((p) => p.text) && !hasInlineData) {
|
|
74
|
-
yield this.buildFullTextResponse(this.text, this.isThought);
|
|
75
|
-
this.text = "";
|
|
76
|
-
this.isThought = false;
|
|
77
|
-
}
|
|
78
|
-
yield llmResponse;
|
|
79
|
-
}
|
|
80
|
-
if (serverContent.inputTranscription) {
|
|
81
|
-
if (serverContent.inputTranscription.text) {
|
|
82
|
-
this.inputTranscriptionText += serverContent.inputTranscription.text;
|
|
83
|
-
yield __spreadValues({
|
|
84
|
-
inputTranscription: {
|
|
85
|
-
text: serverContent.inputTranscription.text,
|
|
86
|
-
finished: false
|
|
87
|
-
},
|
|
88
|
-
partial: true
|
|
89
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
90
|
-
}
|
|
91
|
-
if (serverContent.inputTranscription.finished) {
|
|
92
|
-
yield __spreadValues({
|
|
93
|
-
inputTranscription: {
|
|
94
|
-
text: this.inputTranscriptionText,
|
|
95
|
-
finished: true
|
|
96
|
-
},
|
|
97
|
-
partial: false
|
|
98
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
99
|
-
this.inputTranscriptionText = "";
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (serverContent.outputTranscription) {
|
|
103
|
-
if (serverContent.outputTranscription.text) {
|
|
104
|
-
this.outputTranscriptionText += serverContent.outputTranscription.text;
|
|
105
|
-
yield __spreadValues({
|
|
106
|
-
outputTranscription: {
|
|
107
|
-
text: serverContent.outputTranscription.text,
|
|
108
|
-
finished: false
|
|
109
|
-
},
|
|
110
|
-
partial: true
|
|
111
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
112
|
-
}
|
|
113
|
-
if (serverContent.outputTranscription.finished) {
|
|
114
|
-
yield __spreadValues({
|
|
115
|
-
outputTranscription: {
|
|
116
|
-
text: this.outputTranscriptionText,
|
|
117
|
-
finished: true
|
|
118
|
-
},
|
|
119
|
-
partial: false
|
|
120
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
121
|
-
this.outputTranscriptionText = "";
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (serverContent.interrupted || serverContent.turnComplete || serverContent.generationComplete) {
|
|
125
|
-
if (this.inputTranscriptionText) {
|
|
126
|
-
yield __spreadValues({
|
|
127
|
-
inputTranscription: {
|
|
128
|
-
text: this.inputTranscriptionText,
|
|
129
|
-
finished: true
|
|
130
|
-
},
|
|
131
|
-
partial: false
|
|
132
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
133
|
-
this.inputTranscriptionText = "";
|
|
134
|
-
}
|
|
135
|
-
if (this.outputTranscriptionText) {
|
|
136
|
-
yield __spreadValues({
|
|
137
|
-
outputTranscription: {
|
|
138
|
-
text: this.outputTranscriptionText,
|
|
139
|
-
finished: true
|
|
140
|
-
},
|
|
141
|
-
partial: false
|
|
142
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
143
|
-
this.outputTranscriptionText = "";
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (serverContent.turnComplete) {
|
|
147
|
-
let gMetadataToYield = this.pendingGroundingMetadata;
|
|
148
|
-
if (this.text) {
|
|
149
|
-
yield this.buildFullTextResponse(
|
|
150
|
-
this.text,
|
|
151
|
-
this.isThought,
|
|
152
|
-
gMetadataToYield
|
|
153
|
-
);
|
|
154
|
-
this.text = "";
|
|
155
|
-
this.isThought = false;
|
|
156
|
-
gMetadataToYield = void 0;
|
|
157
|
-
}
|
|
158
|
-
if (this.toolCallParts.length > 0) {
|
|
159
|
-
yield __spreadValues({
|
|
160
|
-
content: { role: "model", parts: this.toolCallParts }
|
|
161
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
162
|
-
this.toolCallParts = [];
|
|
163
|
-
}
|
|
164
|
-
const finalResponse = __spreadValues({
|
|
165
|
-
turnComplete: true
|
|
166
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
167
|
-
if (serverContent.interrupted !== void 0) {
|
|
168
|
-
finalResponse.interrupted = serverContent.interrupted;
|
|
169
|
-
}
|
|
170
|
-
const finalGrounding = serverContent.groundingMetadata || gMetadataToYield;
|
|
171
|
-
if (finalGrounding !== void 0 && finalGrounding !== null) {
|
|
172
|
-
finalResponse.groundingMetadata = finalGrounding;
|
|
173
|
-
}
|
|
174
|
-
yield finalResponse;
|
|
175
|
-
}
|
|
176
|
-
if (serverContent.interrupted) {
|
|
177
|
-
if (this.text) {
|
|
178
|
-
yield this.buildFullTextResponse(this.text, this.isThought);
|
|
179
|
-
this.text = "";
|
|
180
|
-
this.isThought = false;
|
|
181
|
-
} else {
|
|
182
|
-
yield __spreadValues({
|
|
183
|
-
interrupted: serverContent.interrupted
|
|
184
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (message.toolCall) {
|
|
189
|
-
if (this.text) {
|
|
190
|
-
yield this.buildFullTextResponse(this.text, this.isThought);
|
|
191
|
-
this.text = "";
|
|
192
|
-
this.isThought = false;
|
|
193
|
-
}
|
|
194
|
-
if (message.toolCall.functionCalls) {
|
|
195
|
-
this.toolCallParts.push(
|
|
196
|
-
...message.toolCall.functionCalls.map((fc) => ({
|
|
197
|
-
functionCall: fc
|
|
198
|
-
}))
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
const isGemini3x = isGemini3xFlashLive(this.modelVersion);
|
|
202
|
-
if (isGemini3x && this.toolCallParts.length > 0) {
|
|
203
|
-
yield __spreadValues({
|
|
204
|
-
content: { role: "model", parts: this.toolCallParts }
|
|
205
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
206
|
-
this.toolCallParts = [];
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
if (message.sessionResumptionUpdate) {
|
|
210
|
-
yield __spreadValues({
|
|
211
|
-
liveSessionResumptionUpdate: message.sessionResumptionUpdate
|
|
212
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
213
|
-
}
|
|
214
|
-
if (message.goAway) {
|
|
215
|
-
yield __spreadValues({
|
|
216
|
-
goAway: message.goAway
|
|
217
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Flushes any remaining aggregated components when the connection is closed.
|
|
222
|
-
*/
|
|
223
|
-
*close() {
|
|
224
|
-
if (this.toolCallParts.length > 0) {
|
|
225
|
-
yield __spreadValues({
|
|
226
|
-
content: { role: "model", parts: this.toolCallParts }
|
|
227
|
-
}, this.modelVersion ? { modelVersion: this.modelVersion } : {});
|
|
228
|
-
this.toolCallParts = [];
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
buildFullTextResponse(text, isThought, groundingMetadata) {
|
|
232
|
-
const part = { text };
|
|
233
|
-
if (isThought) {
|
|
234
|
-
part.thought = true;
|
|
235
|
-
}
|
|
236
|
-
const response = {
|
|
237
|
-
content: {
|
|
238
|
-
role: "model",
|
|
239
|
-
parts: [part]
|
|
240
|
-
},
|
|
241
|
-
partial: false
|
|
242
|
-
};
|
|
243
|
-
if (groundingMetadata !== void 0 && groundingMetadata !== null) {
|
|
244
|
-
response.groundingMetadata = groundingMetadata;
|
|
245
|
-
}
|
|
246
|
-
if (this.modelVersion) {
|
|
247
|
-
response.modelVersion = this.modelVersion;
|
|
248
|
-
}
|
|
249
|
-
return response;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
export {
|
|
253
|
-
LiveResponseAggregator
|
|
254
|
-
};
|
package/dist/web/utils/logger.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
-
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2025 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
import * as winston from "winston";
|
|
9
|
-
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
10
|
-
LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
|
|
11
|
-
LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
|
|
12
|
-
LogLevel2[LogLevel2["WARN"] = 2] = "WARN";
|
|
13
|
-
LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
|
|
14
|
-
return LogLevel2;
|
|
15
|
-
})(LogLevel || {});
|
|
16
|
-
class SimpleLogger {
|
|
17
|
-
constructor() {
|
|
18
|
-
this.logLevel = 1 /* INFO */;
|
|
19
|
-
this.logger = winston.createLogger({
|
|
20
|
-
levels: {
|
|
21
|
-
"debug": 0 /* DEBUG */,
|
|
22
|
-
"info": 1 /* INFO */,
|
|
23
|
-
"warn": 2 /* WARN */,
|
|
24
|
-
"error": 3 /* ERROR */
|
|
25
|
-
},
|
|
26
|
-
level: "error",
|
|
27
|
-
format: winston.format.combine(
|
|
28
|
-
winston.format.label({ label: "ADK" }),
|
|
29
|
-
winston.format((info) => {
|
|
30
|
-
info.level = info.level.toUpperCase();
|
|
31
|
-
return info;
|
|
32
|
-
})(),
|
|
33
|
-
winston.format.colorize(),
|
|
34
|
-
winston.format.timestamp(),
|
|
35
|
-
winston.format.printf((info) => {
|
|
36
|
-
return "".concat(info.level, ": [").concat(info.label, "] ").concat(info.timestamp, " ").concat(info.message);
|
|
37
|
-
})
|
|
38
|
-
),
|
|
39
|
-
transports: [new winston.transports.Console()]
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
setLogLevel(level) {
|
|
43
|
-
this.logLevel = level;
|
|
44
|
-
}
|
|
45
|
-
log(level, ...messages) {
|
|
46
|
-
if (this.logLevel > level) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
this.logger.log(level.toString(), messages.join(" "));
|
|
50
|
-
}
|
|
51
|
-
debug(...messages) {
|
|
52
|
-
if (this.logLevel > 0 /* DEBUG */) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
this.logger.debug(messages.join(" "));
|
|
56
|
-
}
|
|
57
|
-
info(...messages) {
|
|
58
|
-
if (this.logLevel > 1 /* INFO */) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
this.logger.info(messages.join(" "));
|
|
62
|
-
}
|
|
63
|
-
warn(...messages) {
|
|
64
|
-
if (this.logLevel > 2 /* WARN */) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
this.logger.warn(messages.join(" "));
|
|
68
|
-
}
|
|
69
|
-
error(...messages) {
|
|
70
|
-
if (this.logLevel > 3 /* ERROR */) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
this.logger.error(messages.join(" "));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
class NoOpLogger {
|
|
77
|
-
setLogLevel(_level) {
|
|
78
|
-
}
|
|
79
|
-
log(_level, ..._args) {
|
|
80
|
-
}
|
|
81
|
-
debug(..._args) {
|
|
82
|
-
}
|
|
83
|
-
info(..._args) {
|
|
84
|
-
}
|
|
85
|
-
warn(..._args) {
|
|
86
|
-
}
|
|
87
|
-
error(..._args) {
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
let currentLogger = new SimpleLogger();
|
|
91
|
-
function setLogger(customLogger) {
|
|
92
|
-
currentLogger = customLogger != null ? customLogger : new NoOpLogger();
|
|
93
|
-
}
|
|
94
|
-
function getLogger() {
|
|
95
|
-
return currentLogger;
|
|
96
|
-
}
|
|
97
|
-
function resetLogger() {
|
|
98
|
-
currentLogger = new SimpleLogger();
|
|
99
|
-
}
|
|
100
|
-
function setLogLevel(level) {
|
|
101
|
-
logger.setLogLevel(level);
|
|
102
|
-
}
|
|
103
|
-
const logger = {
|
|
104
|
-
setLogLevel(level) {
|
|
105
|
-
currentLogger.setLogLevel(level);
|
|
106
|
-
},
|
|
107
|
-
log(level, ...args) {
|
|
108
|
-
currentLogger.log(level, ...args);
|
|
109
|
-
},
|
|
110
|
-
debug(...args) {
|
|
111
|
-
currentLogger.debug(...args);
|
|
112
|
-
},
|
|
113
|
-
info(...args) {
|
|
114
|
-
currentLogger.info(...args);
|
|
115
|
-
},
|
|
116
|
-
warn(...args) {
|
|
117
|
-
currentLogger.warn(...args);
|
|
118
|
-
},
|
|
119
|
-
error(...args) {
|
|
120
|
-
currentLogger.error(...args);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
export {
|
|
124
|
-
LogLevel,
|
|
125
|
-
getLogger,
|
|
126
|
-
logger,
|
|
127
|
-
resetLogger,
|
|
128
|
-
setLogLevel,
|
|
129
|
-
setLogger
|
|
130
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
-
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2025 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
import { getBooleanEnvVar } from "./env_aware_utils.js";
|
|
9
|
-
const MODEL_NAME_PATTERN = "^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/(.+)$";
|
|
10
|
-
function extractModelName(modelString) {
|
|
11
|
-
const match = modelString.match(MODEL_NAME_PATTERN);
|
|
12
|
-
if (match) {
|
|
13
|
-
return match[1];
|
|
14
|
-
}
|
|
15
|
-
return modelString;
|
|
16
|
-
}
|
|
17
|
-
function isGeminiModel(modelString) {
|
|
18
|
-
const modelName = extractModelName(modelString);
|
|
19
|
-
return modelName.startsWith("gemini-");
|
|
20
|
-
}
|
|
21
|
-
function parseVersion(versionString) {
|
|
22
|
-
if (!/^\d+(\.\d+)*$/.test(versionString)) {
|
|
23
|
-
return { valid: false, major: 0, minor: 0, patch: 0 };
|
|
24
|
-
}
|
|
25
|
-
const parts = versionString.split(".").map((part) => parseInt(part, 10));
|
|
26
|
-
return {
|
|
27
|
-
valid: true,
|
|
28
|
-
major: parts[0],
|
|
29
|
-
minor: parts.length > 1 ? parts[1] : 0,
|
|
30
|
-
patch: parts.length > 2 ? parts[2] : 0
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function isGemini1Model(modelString) {
|
|
34
|
-
const modelName = extractModelName(modelString);
|
|
35
|
-
return modelName.startsWith("gemini-1");
|
|
36
|
-
}
|
|
37
|
-
function isGemini2OrAbove(modelString) {
|
|
38
|
-
if (!modelString) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
const modelName = extractModelName(modelString);
|
|
42
|
-
if (!modelName.startsWith("gemini-")) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
const versionString = modelName.slice("gemini-".length).split("-", 1)[0];
|
|
46
|
-
const parsedVersion = parseVersion(versionString);
|
|
47
|
-
return parsedVersion.valid && parsedVersion.major >= 2;
|
|
48
|
-
}
|
|
49
|
-
function isGemini3xFlashLive(modelString) {
|
|
50
|
-
if (!modelString) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
const modelName = extractModelName(modelString);
|
|
54
|
-
return modelName.startsWith("gemini-3.") && modelName.includes("-flash-live");
|
|
55
|
-
}
|
|
56
|
-
function isGeminiModelIdCheckDisabled() {
|
|
57
|
-
return getBooleanEnvVar("ADK_DISABLE_GEMINI_MODEL_ID_CHECK");
|
|
58
|
-
}
|
|
59
|
-
export {
|
|
60
|
-
extractModelName,
|
|
61
|
-
isGemini1Model,
|
|
62
|
-
isGemini2OrAbove,
|
|
63
|
-
isGemini3xFlashLive,
|
|
64
|
-
isGeminiModel,
|
|
65
|
-
isGeminiModelIdCheckDisabled
|
|
66
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
-
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2026 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
function toCamelCase(obj, preserveKeys = []) {
|
|
9
|
-
return toNotation(obj, toCamelCaseKey, "", preserveKeys);
|
|
10
|
-
}
|
|
11
|
-
function toSnakeCase(obj, preserveKeys = []) {
|
|
12
|
-
return toNotation(obj, toSnakeCaseKey, "", preserveKeys);
|
|
13
|
-
}
|
|
14
|
-
const toCamelCaseKey = (key) => key.replace(
|
|
15
|
-
/_([a-z])/g,
|
|
16
|
-
(_match, letter) => letter.toUpperCase()
|
|
17
|
-
);
|
|
18
|
-
const toSnakeCaseKey = (key) => key.replace(/[A-Z]/g, (g) => "_" + g.toLowerCase());
|
|
19
|
-
function toNotation(obj, converter, parentKey = "", preserveKeys = []) {
|
|
20
|
-
if (Array.isArray(obj)) {
|
|
21
|
-
return obj.map(
|
|
22
|
-
(item) => toNotation(item, converter, parentKey, preserveKeys)
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
if (typeof obj === "object" && obj !== null) {
|
|
26
|
-
const source = obj;
|
|
27
|
-
const result = {};
|
|
28
|
-
for (const key of Object.keys(source)) {
|
|
29
|
-
const convertedKey = converter(key);
|
|
30
|
-
const fullPath = parentKey !== "" ? parentKey + "." + key : key;
|
|
31
|
-
if (preserveKeys.includes(fullPath)) {
|
|
32
|
-
result[convertedKey] = source[key];
|
|
33
|
-
} else {
|
|
34
|
-
result[convertedKey] = toNotation(
|
|
35
|
-
source[key],
|
|
36
|
-
converter,
|
|
37
|
-
fullPath,
|
|
38
|
-
preserveKeys
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
return obj;
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
toCamelCase,
|
|
48
|
-
toSnakeCase
|
|
49
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
-
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2026 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
import { isGemini2OrAbove } from "./model_name.js";
|
|
9
|
-
import { getGoogleLlmVariant, GoogleLLMVariant } from "./variant_utils.js";
|
|
10
|
-
function canUseOutputSchemaWithTools(modelString) {
|
|
11
|
-
return getGoogleLlmVariant() === GoogleLLMVariant.VERTEX_AI && isGemini2OrAbove(modelString);
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
canUseOutputSchemaWithTools
|
|
15
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
-
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2026 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
function partialCopy(source, targetKeys) {
|
|
9
|
-
const result = {};
|
|
10
|
-
const sourceAsUnknown = source;
|
|
11
|
-
targetKeys.forEach((key) => {
|
|
12
|
-
const keyStr = key;
|
|
13
|
-
if (keyStr in source) {
|
|
14
|
-
result[key] = sourceAsUnknown[keyStr];
|
|
15
|
-
} else {
|
|
16
|
-
result[key] = void 0;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
partialCopy
|
|
23
|
-
};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
-
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2025 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
import { Type } from "@google/genai";
|
|
9
|
-
import {
|
|
10
|
-
zodToJsonSchema as toJSONSchemaV3
|
|
11
|
-
} from "zod-to-json-schema";
|
|
12
|
-
import { toJSONSchema as toJSONSchemaV4 } from "zod/v4";
|
|
13
|
-
function isZodSchema(obj) {
|
|
14
|
-
return obj !== null && typeof obj === "object" && "parse" in obj && typeof obj.parse === "function" && "safeParse" in obj && typeof obj.safeParse === "function";
|
|
15
|
-
}
|
|
16
|
-
function isZodV3Schema(obj) {
|
|
17
|
-
return isZodSchema(obj) && !("_zod" in obj);
|
|
18
|
-
}
|
|
19
|
-
function isZodV4Schema(obj) {
|
|
20
|
-
return isZodSchema(obj) && "_zod" in obj;
|
|
21
|
-
}
|
|
22
|
-
function getZodTypeName(schema) {
|
|
23
|
-
var _a, _b;
|
|
24
|
-
const schemaAny = schema;
|
|
25
|
-
if ((_a = schemaAny._def) == null ? void 0 : _a.typeName) {
|
|
26
|
-
return schemaAny._def.typeName;
|
|
27
|
-
}
|
|
28
|
-
const zod4Type = (_b = schemaAny._def) == null ? void 0 : _b.type;
|
|
29
|
-
if (typeof zod4Type === "string" && zod4Type) {
|
|
30
|
-
return "Zod" + zod4Type.charAt(0).toUpperCase() + zod4Type.slice(1);
|
|
31
|
-
}
|
|
32
|
-
return void 0;
|
|
33
|
-
}
|
|
34
|
-
function isZodObject(obj) {
|
|
35
|
-
return isZodSchema(obj) && getZodTypeName(obj) === "ZodObject";
|
|
36
|
-
}
|
|
37
|
-
function zodObjectToSchema(schema) {
|
|
38
|
-
if (!isZodObject(schema)) {
|
|
39
|
-
throw new Error("Expected a Zod Object");
|
|
40
|
-
}
|
|
41
|
-
if (isZodV4Schema(schema)) {
|
|
42
|
-
return toJSONSchemaV4(schema, {
|
|
43
|
-
target: "openapi-3.0",
|
|
44
|
-
io: "input",
|
|
45
|
-
override: (ctx) => {
|
|
46
|
-
var _a;
|
|
47
|
-
const { jsonSchema } = ctx;
|
|
48
|
-
if (jsonSchema.additionalProperties !== void 0) {
|
|
49
|
-
delete jsonSchema.additionalProperties;
|
|
50
|
-
}
|
|
51
|
-
if (jsonSchema.readOnly !== void 0) {
|
|
52
|
-
delete jsonSchema.readOnly;
|
|
53
|
-
}
|
|
54
|
-
if (jsonSchema.maxItems !== void 0) {
|
|
55
|
-
jsonSchema.maxItems = jsonSchema.maxItems.toString();
|
|
56
|
-
}
|
|
57
|
-
if (jsonSchema.format === "email" || jsonSchema.format === "uuid") {
|
|
58
|
-
delete jsonSchema.pattern;
|
|
59
|
-
}
|
|
60
|
-
if (jsonSchema.minItems !== void 0) {
|
|
61
|
-
jsonSchema.minItems = jsonSchema.minItems.toString();
|
|
62
|
-
}
|
|
63
|
-
if (jsonSchema.minLength !== void 0) {
|
|
64
|
-
jsonSchema.minLength = jsonSchema.minLength.toString();
|
|
65
|
-
}
|
|
66
|
-
if (jsonSchema.maxLength !== void 0) {
|
|
67
|
-
jsonSchema.maxLength = jsonSchema.maxLength.toString();
|
|
68
|
-
}
|
|
69
|
-
if (((_a = jsonSchema.enum) == null ? void 0 : _a.length) === 1 && jsonSchema.enum[0] === null) {
|
|
70
|
-
jsonSchema.type = Type.NULL;
|
|
71
|
-
delete jsonSchema.enum;
|
|
72
|
-
}
|
|
73
|
-
if (jsonSchema.type !== void 0) {
|
|
74
|
-
jsonSchema.type = jsonSchema.type.toUpperCase();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
if (isZodV3Schema(schema)) {
|
|
80
|
-
return toJSONSchemaV3(schema, {
|
|
81
|
-
target: "openApi3",
|
|
82
|
-
emailStrategy: "format:email",
|
|
83
|
-
postProcess: (jsonSchema) => {
|
|
84
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
85
|
-
if (!jsonSchema) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (jsonSchema.additionalProperties !== void 0) {
|
|
89
|
-
delete jsonSchema.additionalProperties;
|
|
90
|
-
}
|
|
91
|
-
if (jsonSchema.maxItems !== void 0) {
|
|
92
|
-
jsonSchema.maxItems = (_a = jsonSchema.maxItems) == null ? void 0 : _a.toString();
|
|
93
|
-
}
|
|
94
|
-
if (jsonSchema.minItems !== void 0) {
|
|
95
|
-
jsonSchema.minItems = (_b = jsonSchema.minItems) == null ? void 0 : _b.toString();
|
|
96
|
-
}
|
|
97
|
-
if (jsonSchema.minLength !== void 0) {
|
|
98
|
-
jsonSchema.minLength = (_c = jsonSchema.minLength) == null ? void 0 : _c.toString();
|
|
99
|
-
}
|
|
100
|
-
if (jsonSchema.maxLength !== void 0) {
|
|
101
|
-
jsonSchema.maxLength = (_d = jsonSchema.maxLength) == null ? void 0 : _d.toString();
|
|
102
|
-
}
|
|
103
|
-
if (((_e = jsonSchema.enum) == null ? void 0 : _e.length) === 1 && jsonSchema.enum[0] === "null") {
|
|
104
|
-
jsonSchema.type = Type.NULL;
|
|
105
|
-
delete jsonSchema.enum;
|
|
106
|
-
}
|
|
107
|
-
if (jsonSchema.type === "integer" && jsonSchema.format !== "int64") {
|
|
108
|
-
(_f = jsonSchema.minimum) != null ? _f : jsonSchema.minimum = Number.MIN_SAFE_INTEGER;
|
|
109
|
-
(_g = jsonSchema.maximum) != null ? _g : jsonSchema.maximum = Number.MAX_SAFE_INTEGER;
|
|
110
|
-
}
|
|
111
|
-
if (jsonSchema.type !== void 0) {
|
|
112
|
-
jsonSchema.type = jsonSchema.type.toUpperCase();
|
|
113
|
-
}
|
|
114
|
-
return jsonSchema;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
throw new Error("Unsupported Zod schema version.");
|
|
119
|
-
}
|
|
120
|
-
export {
|
|
121
|
-
isZodObject,
|
|
122
|
-
zodObjectToSchema
|
|
123
|
-
};
|