@google/adk 1.5.0 → 2.0.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 +18 -0
- package/dist/cjs/a2a/a2a_remote_agent.js +17 -4
- package/dist/cjs/a2a/a2a_remote_agent_run_processor.js +7 -3
- package/dist/cjs/a2a/a2a_remote_agent_utils.js +9 -2
- package/dist/cjs/a2a/agent_card.js +33 -3
- package/dist/cjs/a2a/agent_executor.js +25 -16
- package/dist/cjs/a2a/agent_to_a2a.js +22 -11
- package/dist/cjs/a2a/auth.js +68 -0
- package/dist/cjs/a2a/event_converter_utils.js +50 -15
- package/dist/cjs/a2a/event_processor_utils.js +71 -35
- package/dist/cjs/a2a/executor_context.js +2 -0
- package/dist/cjs/a2a/index.js +53 -0
- package/dist/cjs/a2a/metadata_converter_utils.js +5 -0
- package/dist/cjs/a2a/part_converter_utils.js +12 -0
- package/dist/cjs/agents/active_streaming_tool.js +5 -2
- package/dist/cjs/agents/base_agent.js +46 -9
- package/dist/cjs/agents/context.js +5 -2
- package/dist/cjs/agents/framework_function_calls.js +64 -0
- package/dist/cjs/agents/functions.js +58 -23
- package/dist/cjs/agents/instructions.js +51 -12
- package/dist/cjs/agents/invocation_context.js +42 -8
- package/dist/cjs/agents/live_request_queue.js +29 -5
- package/dist/cjs/agents/llm_agent.js +536 -45
- package/dist/cjs/agents/loop_agent.js +19 -2
- package/dist/cjs/agents/parallel_agent.js +21 -2
- package/dist/cjs/agents/processors/agent_transfer_llm_request_processor.js +7 -4
- package/dist/cjs/agents/processors/base_llm_processor.js +9 -4
- package/dist/cjs/agents/processors/basic_llm_request_processor.js +8 -4
- package/dist/cjs/agents/processors/code_execution_request_processor.js +18 -5
- package/dist/cjs/agents/processors/content_processor_utils.js +85 -15
- package/dist/cjs/agents/processors/content_request_processor.js +11 -25
- 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 +8 -3
- package/dist/cjs/agents/processors/interactions_request_processor.js +5 -2
- package/dist/cjs/agents/processors/request_confirmation_llm_request_processor.js +313 -92
- package/dist/cjs/agents/processors/request_input_llm_request_processor.js +218 -0
- package/dist/cjs/agents/processors/tool_filter_request_processor.js +5 -2
- package/dist/cjs/agents/readonly_context.js +7 -3
- package/dist/cjs/agents/routed_agent.js +6 -13
- package/dist/cjs/agents/run_config.js +12 -0
- package/dist/cjs/agents/sequential_agent.js +20 -3
- package/dist/cjs/agents/user_input_request.js +145 -0
- package/dist/cjs/apps/app.js +11 -11
- package/dist/cjs/apps/resumability_config.js +2 -0
- package/dist/cjs/artifacts/file_artifact_service.js +21 -2
- package/dist/cjs/artifacts/gcs_artifact_service.js +46 -11
- package/dist/cjs/artifacts/in_memory_artifact_service.js +19 -11
- package/dist/cjs/artifacts/registry.js +6 -1
- package/dist/cjs/artifacts/scoped_artifact_service.js +5 -2
- package/dist/cjs/auth/auth_handler.js +5 -2
- 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 +19 -5
- 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 +5 -2
- package/dist/cjs/auth/oauth2/oauth2_discovery.js +7 -2
- package/dist/cjs/auth/oauth2/oauth2_utils.js +6 -0
- 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 +6 -2
- package/dist/cjs/code_executors/built_in_code_executor.js +6 -2
- package/dist/cjs/code_executors/code_execution_utils.js +6 -0
- package/dist/cjs/code_executors/code_executor_context.js +5 -2
- package/dist/cjs/code_executors/unsafe_local_code_executor.js +31 -14
- package/dist/cjs/common.js +112 -1
- package/dist/cjs/context/agent_controlled_context_compactor.js +7 -13
- package/dist/cjs/context/anchored_context_compactor.js +5 -2
- package/dist/cjs/context/compaction_utils.js +17 -2
- package/dist/cjs/context/summarizers/llm_summarizer.js +5 -2
- package/dist/cjs/context/token_based_context_compactor.js +11 -23
- package/dist/cjs/context/trajectory_thought_pruning_compactor.js +5 -2
- package/dist/cjs/context/truncating_context_compactor.js +5 -2
- package/dist/cjs/environment/base_environment.js +97 -0
- package/dist/cjs/environment/local_environment.js +186 -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 +5 -0
- package/dist/cjs/events/structured_events.js +2 -0
- package/dist/cjs/examples/base_example_provider.js +6 -2
- package/dist/cjs/examples/example_util.js +3 -0
- package/dist/cjs/features/feature_registry.js +7 -0
- package/dist/cjs/index.js +7 -22
- package/dist/cjs/integrations/agent_registry/agent_registry.js +7 -4
- 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 +21 -4
- package/dist/cjs/memory/vertex_ai_memory_bank_service.js +20 -2
- package/dist/cjs/models/apigee_llm.js +9 -3
- package/dist/cjs/models/base_llm.js +7 -3
- package/dist/cjs/models/gemini_llm_connection.js +5 -2
- package/dist/cjs/models/google_llm.js +24 -12
- package/dist/cjs/models/interactions_utils.js +16 -0
- package/dist/cjs/models/llm_request.js +4 -0
- package/dist/cjs/models/llm_response.js +2 -0
- package/dist/cjs/models/registry.js +6 -2
- package/dist/cjs/models/routed_llm.js +4 -13
- package/dist/cjs/plugins/base_plugin.js +43 -7
- 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/security_plugin.js +15 -8
- package/dist/cjs/runner/in_memory_runner.js +5 -2
- package/dist/cjs/runner/runner.js +226 -29
- package/dist/cjs/sessions/base_session_service.js +21 -5
- package/dist/cjs/sessions/database_session_service.js +6 -2
- package/dist/cjs/sessions/db/operations.js +34 -6
- package/dist/cjs/sessions/db/schema.js +16 -8
- package/dist/cjs/sessions/in_memory_session_service.js +30 -22
- package/dist/cjs/sessions/registry.js +4 -1
- 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 +132 -25
- package/dist/cjs/skills/gcp_skill_registry.js +2 -0
- package/dist/cjs/skills/loader.js +62 -16
- package/dist/cjs/skills/prompt.js +3 -0
- package/dist/cjs/telemetry/google_cloud.js +42 -9
- package/dist/cjs/telemetry/setup.js +5 -0
- package/dist/cjs/telemetry/tracing.js +60 -4
- package/dist/cjs/tools/agent_tool.js +6 -2
- package/dist/cjs/tools/base_tool.js +24 -2
- package/dist/cjs/tools/base_toolset.js +6 -2
- package/dist/cjs/tools/consolidate_context_tool.js +5 -2
- package/dist/cjs/tools/enterprise_web_search_tool.js +6 -2
- 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 +5 -2
- package/dist/cjs/tools/function_tool.js +73 -8
- package/dist/cjs/tools/get_user_choice_tool.js +54 -0
- package/dist/cjs/tools/google_maps_grounding_tool.js +6 -2
- package/dist/cjs/tools/google_search_tool.js +5 -2
- package/dist/cjs/tools/load_artifacts_tool.js +8 -2
- package/dist/cjs/tools/load_memory_tool.js +5 -2
- package/dist/cjs/tools/load_web_page.js +21 -1
- 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 +5 -2
- package/dist/cjs/tools/mcp/mcp_session_manager.js +69 -27
- 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 +4 -0
- 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 +2 -0
- 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 +23 -5
- package/dist/cjs/tools/preload_memory_tool.js +5 -2
- package/dist/cjs/tools/request_input_tool.js +56 -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 +5 -2
- package/dist/cjs/tools/vertex_ai_search_tool.js +5 -2
- package/dist/cjs/tools/vertex_rag_retrieval_tool.js +5 -2
- 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 +45 -0
- package/dist/cjs/utils/deprecated.js +68 -0
- package/dist/cjs/utils/env_aware_utils.js +56 -13
- package/dist/cjs/utils/error_utils.js +128 -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 +12 -4
- package/dist/cjs/utils/gemini_schema_util.js +6 -2
- 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 +13 -4
- 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 +45 -0
- package/dist/cjs/utils/partial_copy.js +2 -0
- package/dist/cjs/utils/redact_uri.js +66 -0
- package/dist/cjs/utils/schema.js +178 -0
- package/dist/cjs/utils/simple_zod_to_json.js +17 -4
- 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 +6 -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 +156 -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 +19 -0
- package/dist/esm/a2a/a2a_remote_agent.js +18 -4
- package/dist/esm/a2a/a2a_remote_agent_run_processor.js +8 -3
- package/dist/esm/a2a/a2a_remote_agent_utils.js +10 -2
- package/dist/esm/a2a/agent_card.js +34 -3
- package/dist/esm/a2a/agent_executor.js +27 -17
- package/dist/esm/a2a/agent_to_a2a.js +44 -16
- package/dist/esm/a2a/auth.js +41 -0
- package/dist/esm/a2a/event_converter_utils.js +51 -15
- package/dist/esm/a2a/event_processor_utils.js +74 -34
- package/dist/esm/a2a/executor_context.js +3 -0
- package/dist/esm/a2a/index.js +20 -0
- package/dist/esm/a2a/metadata_converter_utils.js +6 -0
- package/dist/esm/a2a/part_converter_utils.js +13 -0
- package/dist/esm/agents/active_streaming_tool.js +6 -2
- package/dist/esm/agents/base_agent.js +47 -9
- package/dist/esm/agents/context.js +6 -2
- package/dist/esm/agents/framework_function_calls.js +34 -0
- package/dist/esm/agents/functions.js +62 -20
- package/dist/esm/agents/instructions.js +52 -12
- package/dist/esm/agents/invocation_context.js +41 -7
- package/dist/esm/agents/live_request_queue.js +30 -5
- package/dist/esm/agents/llm_agent.js +537 -45
- package/dist/esm/agents/loop_agent.js +21 -2
- package/dist/esm/agents/parallel_agent.js +23 -2
- package/dist/esm/agents/processors/agent_transfer_llm_request_processor.js +8 -4
- package/dist/esm/agents/processors/base_llm_processor.js +10 -4
- package/dist/esm/agents/processors/basic_llm_request_processor.js +9 -4
- package/dist/esm/agents/processors/code_execution_request_processor.js +19 -5
- package/dist/esm/agents/processors/content_processor_utils.js +88 -16
- package/dist/esm/agents/processors/content_request_processor.js +12 -25
- 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 +9 -3
- package/dist/esm/agents/processors/interactions_request_processor.js +6 -2
- package/dist/esm/agents/processors/request_confirmation_llm_request_processor.js +318 -93
- package/dist/esm/agents/processors/request_input_llm_request_processor.js +197 -0
- package/dist/esm/agents/processors/tool_filter_request_processor.js +6 -2
- package/dist/esm/agents/readonly_context.js +8 -3
- package/dist/esm/agents/routed_agent.js +6 -14
- package/dist/esm/agents/run_config.js +13 -0
- package/dist/esm/agents/sequential_agent.js +22 -3
- package/dist/esm/agents/user_input_request.js +120 -0
- package/dist/esm/apps/app.js +14 -11
- package/dist/esm/apps/resumability_config.js +3 -0
- package/dist/esm/artifacts/file_artifact_service.js +22 -2
- package/dist/esm/artifacts/gcs_artifact_service.js +58 -11
- package/dist/esm/artifacts/in_memory_artifact_service.js +20 -11
- package/dist/esm/artifacts/registry.js +7 -1
- package/dist/esm/artifacts/scoped_artifact_service.js +6 -2
- package/dist/esm/auth/auth_handler.js +6 -2
- 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 +20 -5
- 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 +6 -2
- package/dist/esm/auth/oauth2/oauth2_discovery.js +8 -2
- package/dist/esm/auth/oauth2/oauth2_utils.js +7 -0
- 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 +7 -2
- package/dist/esm/code_executors/built_in_code_executor.js +7 -2
- package/dist/esm/code_executors/code_execution_utils.js +7 -0
- package/dist/esm/code_executors/code_executor_context.js +6 -2
- package/dist/esm/code_executors/unsafe_local_code_executor.js +31 -13
- package/dist/esm/common.js +113 -4
- package/dist/esm/context/agent_controlled_context_compactor.js +8 -13
- package/dist/esm/context/anchored_context_compactor.js +6 -2
- package/dist/esm/context/compaction_utils.js +16 -1
- package/dist/esm/context/summarizers/llm_summarizer.js +6 -2
- package/dist/esm/context/token_based_context_compactor.js +16 -24
- package/dist/esm/context/trajectory_thought_pruning_compactor.js +6 -2
- package/dist/esm/context/truncating_context_compactor.js +6 -2
- package/dist/esm/environment/base_environment.js +71 -0
- package/dist/esm/environment/local_environment.js +150 -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 +6 -0
- package/dist/esm/events/structured_events.js +3 -0
- package/dist/esm/examples/base_example_provider.js +7 -2
- package/dist/esm/examples/example_util.js +4 -0
- package/dist/esm/features/feature_registry.js +8 -0
- package/dist/esm/index.js +4 -13
- package/dist/esm/integrations/agent_registry/agent_registry.js +8 -4
- 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 +22 -4
- package/dist/esm/memory/vertex_ai_memory_bank_service.js +25 -3
- package/dist/esm/models/apigee_llm.js +10 -3
- package/dist/esm/models/base_llm.js +8 -3
- package/dist/esm/models/gemini_llm_connection.js +6 -2
- package/dist/esm/models/google_llm.js +26 -13
- package/dist/esm/models/interactions_utils.js +17 -0
- package/dist/esm/models/llm_request.js +5 -0
- package/dist/esm/models/llm_response.js +3 -0
- package/dist/esm/models/registry.js +7 -2
- package/dist/esm/models/routed_llm.js +4 -14
- package/dist/esm/plugins/base_plugin.js +43 -7
- 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/security_plugin.js +14 -6
- package/dist/esm/runner/in_memory_runner.js +6 -2
- package/dist/esm/runner/runner.js +233 -31
- package/dist/esm/sessions/base_session_service.js +22 -5
- package/dist/esm/sessions/database_session_service.js +7 -2
- package/dist/esm/sessions/db/operations.js +34 -6
- package/dist/esm/sessions/db/schema.js +16 -8
- package/dist/esm/sessions/in_memory_session_service.js +31 -22
- package/dist/esm/sessions/registry.js +5 -1
- 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 +136 -26
- package/dist/esm/skills/gcp_skill_registry.js +2 -0
- package/dist/esm/skills/loader.js +63 -16
- package/dist/esm/skills/prompt.js +4 -0
- package/dist/esm/telemetry/google_cloud.js +54 -9
- package/dist/esm/telemetry/setup.js +6 -0
- package/dist/esm/telemetry/tracing.js +59 -4
- package/dist/esm/tools/agent_tool.js +7 -2
- package/dist/esm/tools/base_tool.js +25 -2
- package/dist/esm/tools/base_toolset.js +7 -2
- package/dist/esm/tools/consolidate_context_tool.js +6 -2
- package/dist/esm/tools/enterprise_web_search_tool.js +7 -2
- 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 +6 -2
- package/dist/esm/tools/function_tool.js +74 -8
- package/dist/esm/tools/get_user_choice_tool.js +27 -0
- package/dist/esm/tools/google_maps_grounding_tool.js +7 -2
- package/dist/esm/tools/google_search_tool.js +6 -2
- package/dist/esm/tools/load_artifacts_tool.js +9 -2
- package/dist/esm/tools/load_memory_tool.js +6 -2
- package/dist/esm/tools/load_web_page.js +22 -1
- package/dist/esm/tools/long_running_tool.js +6 -2
- package/dist/esm/tools/mcp/index.js +11 -0
- package/dist/esm/tools/mcp/load_mcp_resource_tool.js +6 -2
- package/dist/esm/tools/mcp/mcp_session_manager.js +80 -30
- 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 +5 -0
- 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 +2 -0
- 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 +23 -5
- package/dist/esm/tools/preload_memory_tool.js +6 -2
- package/dist/esm/tools/request_input_tool.js +29 -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 +6 -2
- package/dist/esm/tools/vertex_ai_search_tool.js +6 -2
- package/dist/esm/tools/vertex_rag_retrieval_tool.js +6 -2
- 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 +18 -0
- package/dist/esm/utils/deprecated.js +40 -0
- package/dist/esm/utils/env_aware_utils.js +56 -13
- package/dist/esm/utils/error_utils.js +101 -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 +13 -4
- package/dist/esm/utils/gemini_schema_util.js +7 -2
- 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 +14 -4
- 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 +18 -0
- package/dist/esm/utils/partial_copy.js +3 -0
- package/dist/esm/utils/redact_uri.js +39 -0
- package/dist/esm/utils/schema.js +152 -0
- package/dist/esm/utils/simple_zod_to_json.js +15 -4
- 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 +7 -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 +131 -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/trigger.js +7 -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/agent_card.d.ts +3 -3
- package/dist/types/a2a/agent_to_a2a.d.ts +4 -4
- package/dist/types/a2a/auth.d.ts +30 -0
- package/dist/types/a2a/event_converter_utils.d.ts +4 -1
- package/dist/types/a2a/event_processor_utils.d.ts +17 -2
- package/dist/types/a2a/index.d.ts +18 -0
- package/dist/types/agents/base_agent.d.ts +37 -9
- package/dist/types/agents/framework_function_calls.d.ts +26 -0
- package/dist/types/agents/functions.d.ts +1 -2
- package/dist/types/agents/invocation_context.d.ts +95 -3
- package/dist/types/agents/live_request_queue.d.ts +7 -1
- package/dist/types/agents/llm_agent.d.ts +77 -1
- 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/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/run_config.d.ts +57 -2
- 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/auth/credential_response_binding.d.ts +24 -0
- package/dist/types/auth/credential_service/in_memory_credential_service.d.ts +11 -0
- package/dist/types/code_executors/unsafe_local_code_executor.d.ts +5 -1
- package/dist/types/common.d.ts +20 -8
- package/dist/types/context/agent_controlled_context_compactor.d.ts +0 -1
- package/dist/types/context/compaction_utils.d.ts +8 -0
- package/dist/types/context/token_based_context_compactor.d.ts +0 -1
- package/dist/types/environment/base_environment.d.ts +101 -0
- package/dist/types/environment/local_environment.d.ts +72 -0
- package/dist/types/events/event.d.ts +94 -1
- package/dist/types/events/event_actions.d.ts +10 -0
- package/dist/types/index.d.ts +6 -13
- package/dist/types/memory/in_memory_memory_service.d.ts +11 -0
- package/dist/types/models/apigee_llm.d.ts +4 -4
- package/dist/types/models/google_llm.d.ts +2 -1
- package/dist/types/plugins/base_plugin.d.ts +39 -2
- package/dist/types/plugins/plugin_manager.d.ts +20 -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 +59 -3
- package/dist/types/sessions/base_session_service.d.ts +10 -2
- package/dist/types/sessions/in_memory_session_service.d.ts +9 -0
- package/dist/types/sessions/state.d.ts +34 -1
- package/dist/types/sessions/state_write_order.d.ts +39 -0
- package/dist/types/sessions/vertex_ai_session_service.d.ts +19 -1
- package/dist/types/skills/loader.d.ts +5 -0
- package/dist/types/telemetry/tracing.d.ts +15 -0
- package/dist/types/tools/base_tool.d.ts +15 -0
- package/dist/types/tools/finish_task_tool.d.ts +47 -0
- package/dist/types/tools/function_tool.d.ts +46 -1
- package/dist/types/tools/get_user_choice_tool.d.ts +14 -0
- 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 +1 -1
- package/dist/types/tools/request_input_tool.d.ts +20 -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/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 +39 -0
- package/dist/types/utils/error_utils.d.ts +18 -0
- package/dist/types/utils/file_utils.d.ts +10 -2
- package/dist/types/utils/genai_schema_to_json.d.ts +25 -0
- package/dist/types/utils/optional_peer.d.ts +36 -0
- package/dist/types/utils/output_schema_utils.d.ts +18 -0
- package/dist/types/utils/redact_uri.d.ts +28 -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/vertex_ai_utils.d.ts +5 -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/a2a/a2a_event.js +19 -0
- package/dist/web/a2a/a2a_remote_agent.js +18 -4
- package/dist/web/a2a/a2a_remote_agent_run_processor.js +8 -3
- package/dist/web/a2a/a2a_remote_agent_utils.js +10 -2
- package/dist/web/a2a/agent_card.js +34 -3
- package/dist/web/a2a/agent_executor.js +45 -17
- package/dist/web/a2a/agent_to_a2a.js +44 -16
- package/dist/web/a2a/auth.js +41 -0
- package/dist/web/a2a/event_converter_utils.js +50 -15
- package/dist/web/a2a/event_processor_utils.js +73 -34
- package/dist/web/a2a/executor_context.js +3 -0
- package/dist/web/a2a/index.js +20 -0
- package/dist/web/a2a/metadata_converter_utils.js +5 -0
- package/dist/web/a2a/part_converter_utils.js +13 -0
- package/dist/web/agents/active_streaming_tool.js +6 -2
- package/dist/web/agents/base_agent.js +48 -9
- package/dist/web/agents/context.js +6 -2
- package/dist/web/agents/framework_function_calls.js +34 -0
- package/dist/web/agents/functions.js +62 -20
- package/dist/web/agents/instructions.js +52 -12
- package/dist/web/agents/invocation_context.js +56 -7
- package/dist/web/agents/live_request_queue.js +30 -5
- package/dist/web/agents/llm_agent.js +631 -52
- package/dist/web/agents/loop_agent.js +21 -2
- package/dist/web/agents/parallel_agent.js +23 -2
- package/dist/web/agents/processors/agent_transfer_llm_request_processor.js +8 -4
- package/dist/web/agents/processors/base_llm_processor.js +10 -4
- package/dist/web/agents/processors/basic_llm_request_processor.js +8 -4
- package/dist/web/agents/processors/code_execution_request_processor.js +19 -5
- package/dist/web/agents/processors/content_processor_utils.js +87 -16
- package/dist/web/agents/processors/content_request_processor.js +12 -25
- package/dist/web/agents/processors/context_compactor_request_processor.js +6 -2
- package/dist/web/agents/processors/identity_llm_request_processor.js +13 -4
- package/dist/web/agents/processors/instructions_llm_request_processor.js +9 -3
- package/dist/web/agents/processors/interactions_request_processor.js +6 -2
- package/dist/web/agents/processors/request_confirmation_llm_request_processor.js +329 -104
- package/dist/web/agents/processors/request_input_llm_request_processor.js +228 -0
- package/dist/web/agents/processors/tool_filter_request_processor.js +6 -2
- package/dist/web/agents/readonly_context.js +8 -3
- package/dist/web/agents/routed_agent.js +6 -14
- package/dist/web/agents/run_config.js +12 -0
- package/dist/web/agents/sequential_agent.js +22 -3
- package/dist/web/agents/user_input_request.js +135 -0
- package/dist/web/apps/app.js +14 -11
- package/dist/web/apps/resumability_config.js +2 -0
- package/dist/web/artifacts/file_artifact_service.js +22 -2
- package/dist/web/artifacts/gcs_artifact_service.js +56 -11
- package/dist/web/artifacts/in_memory_artifact_service.js +20 -11
- package/dist/web/artifacts/registry.js +7 -1
- package/dist/web/artifacts/scoped_artifact_service.js +5 -2
- package/dist/web/auth/auth_handler.js +5 -2
- package/dist/web/auth/auth_preprocessor.js +50 -41
- package/dist/web/auth/auth_provider_registry.js +6 -2
- package/dist/web/auth/auth_schemes.js +3 -0
- package/dist/web/auth/credential_response_binding.js +91 -0
- package/dist/web/auth/credential_service/in_memory_credential_service.js +20 -5
- package/dist/web/auth/credential_service/session_state_credential_service.js +6 -2
- package/dist/web/auth/exchanger/base_credential_exchanger.js +6 -2
- package/dist/web/auth/exchanger/credential_exchanger_registry.js +6 -2
- package/dist/web/auth/oauth2/oauth2_credential_exchanger.js +8 -2
- package/dist/web/auth/oauth2/oauth2_credential_refresher.js +5 -2
- package/dist/web/auth/oauth2/oauth2_discovery.js +8 -2
- package/dist/web/auth/oauth2/oauth2_utils.js +7 -0
- package/dist/web/auth/refresher/base_credential_refresher.js +6 -2
- package/dist/web/auth/refresher/credential_refresher_registry.js +6 -2
- package/dist/web/code_executors/agent_engine_sandbox_code_executor.js +3 -0
- package/dist/web/code_executors/base_code_executor.js +7 -2
- package/dist/web/code_executors/built_in_code_executor.js +7 -2
- package/dist/web/code_executors/code_execution_utils.js +7 -0
- package/dist/web/code_executors/code_executor_context.js +6 -2
- package/dist/web/code_executors/unsafe_local_code_executor.js +31 -13
- package/dist/web/common.js +113 -4
- package/dist/web/context/agent_controlled_context_compactor.js +8 -13
- package/dist/web/context/anchored_context_compactor.js +5 -2
- package/dist/web/context/compaction_utils.js +16 -1
- package/dist/web/context/summarizers/llm_summarizer.js +6 -2
- package/dist/web/context/token_based_context_compactor.js +16 -24
- package/dist/web/context/trajectory_thought_pruning_compactor.js +6 -2
- package/dist/web/context/truncating_context_compactor.js +6 -2
- package/dist/web/environment/base_environment.js +71 -0
- package/dist/web/environment/local_environment.js +165 -0
- package/dist/web/events/compacted_event.js +4 -0
- package/dist/web/events/event.js +37 -3
- package/dist/web/events/event_actions.js +5 -0
- package/dist/web/events/structured_events.js +3 -0
- package/dist/web/examples/base_example_provider.js +7 -2
- package/dist/web/examples/example_util.js +4 -0
- package/dist/web/features/feature_registry.js +8 -0
- package/dist/web/index.js +4 -13
- package/dist/web/integrations/agent_registry/agent_registry.js +8 -4
- package/dist/web/integrations/agent_registry/agent_registry_mcp_toolset.js +5 -2
- package/dist/web/integrations/agent_registry/helpers.js +4 -0
- package/dist/web/memory/in_memory_memory_service.js +22 -4
- package/dist/web/memory/vertex_ai_memory_bank_service.js +24 -3
- package/dist/web/models/apigee_llm.js +9 -3
- package/dist/web/models/base_llm.js +8 -3
- package/dist/web/models/gemini_llm_connection.js +6 -2
- package/dist/web/models/google_llm.js +25 -13
- package/dist/web/models/interactions_utils.js +17 -0
- package/dist/web/models/llm_request.js +5 -0
- package/dist/web/models/llm_response.js +3 -0
- package/dist/web/models/registry.js +7 -2
- package/dist/web/models/routed_llm.js +4 -14
- package/dist/web/plugins/base_plugin.js +43 -7
- package/dist/web/plugins/global_instruction_plugin.js +6 -2
- package/dist/web/plugins/logging_plugin.js +14 -8
- package/dist/web/plugins/plugin_manager.js +38 -2
- package/dist/web/plugins/security_plugin.js +14 -6
- package/dist/web/runner/in_memory_runner.js +6 -2
- package/dist/web/runner/runner.js +249 -31
- package/dist/web/sessions/base_session_service.js +22 -5
- package/dist/web/sessions/database_session_service.js +6 -2
- package/dist/web/sessions/db/operations.js +34 -6
- package/dist/web/sessions/db/schema.js +16 -8
- package/dist/web/sessions/in_memory_session_service.js +31 -22
- package/dist/web/sessions/registry.js +5 -1
- package/dist/web/sessions/session.js +3 -0
- package/dist/web/sessions/state.js +77 -7
- package/dist/web/sessions/state_write_order.js +74 -0
- package/dist/web/sessions/vertex_ai_session_service.js +142 -26
- package/dist/web/skills/gcp_skill_registry.js +2 -0
- package/dist/web/skills/loader.js +62 -16
- package/dist/web/skills/prompt.js +4 -0
- package/dist/web/telemetry/google_cloud.js +54 -9
- package/dist/web/telemetry/setup.js +6 -0
- package/dist/web/telemetry/tracing.js +77 -7
- package/dist/web/tools/agent_tool.js +7 -2
- package/dist/web/tools/base_tool.js +25 -2
- package/dist/web/tools/base_toolset.js +7 -2
- package/dist/web/tools/consolidate_context_tool.js +6 -2
- package/dist/web/tools/enterprise_web_search_tool.js +7 -2
- package/dist/web/tools/example_tool.js +6 -2
- package/dist/web/tools/exit_loop_tool.js +6 -2
- package/dist/web/tools/finish_task_tool.js +92 -0
- package/dist/web/tools/forwarding_artifact_service.js +6 -2
- package/dist/web/tools/function_tool.js +74 -8
- package/dist/web/tools/get_user_choice_tool.js +27 -0
- package/dist/web/tools/google_maps_grounding_tool.js +7 -2
- package/dist/web/tools/google_search_tool.js +6 -2
- package/dist/web/tools/load_artifacts_tool.js +9 -2
- package/dist/web/tools/load_memory_tool.js +6 -2
- package/dist/web/tools/load_web_page.js +22 -1
- package/dist/web/tools/long_running_tool.js +5 -2
- package/dist/web/tools/mcp/index.js +11 -0
- package/dist/web/tools/mcp/load_mcp_resource_tool.js +6 -2
- package/dist/web/tools/mcp/mcp_session_manager.js +80 -30
- package/dist/web/tools/mcp/mcp_tool.js +6 -2
- package/dist/web/tools/mcp/mcp_toolset.js +5 -2
- package/dist/web/tools/openapi_tool/auth/auth_helpers.js +5 -0
- package/dist/web/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +2 -0
- package/dist/web/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +2 -0
- package/dist/web/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +30 -9
- package/dist/web/tools/openapi_tool/openapi_spec_parser/operation_parser.js +2 -0
- package/dist/web/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +6 -2
- package/dist/web/tools/openapi_tool/openapi_toolset.js +2 -0
- package/dist/web/tools/openapi_tool/rest_api_tool.js +23 -5
- package/dist/web/tools/preload_memory_tool.js +6 -2
- package/dist/web/tools/request_input_tool.js +29 -0
- package/dist/web/tools/skill/list_skills_tool.js +2 -0
- package/dist/web/tools/skill/load_skill_resource_tool.js +2 -0
- package/dist/web/tools/skill/load_skill_tool.js +4 -1
- package/dist/web/tools/skill/run_skill_inline_script_tool.js +26 -2
- package/dist/web/tools/skill/run_skill_script_tool.js +28 -2
- package/dist/web/tools/skill/search_skills_tool.js +2 -0
- package/dist/web/tools/skill/skill_toolset.js +25 -0
- package/dist/web/tools/tool_confirmation.js +24 -2
- package/dist/web/tools/url_context_tool.js +6 -2
- package/dist/web/tools/vertex_ai_search_tool.js +6 -2
- package/dist/web/tools/vertex_rag_retrieval_tool.js +6 -2
- package/dist/web/utils/async_hooks_shim.js +6 -2
- package/dist/web/utils/async_queue.js +46 -18
- package/dist/web/utils/branch_trie.js +3 -0
- package/dist/web/utils/case_utils.js +3 -0
- package/dist/web/utils/client_labels.js +6 -0
- package/dist/web/utils/crypto_shim.js +18 -0
- package/dist/web/utils/deprecated.js +40 -0
- package/dist/web/utils/env_aware_utils.js +56 -13
- package/dist/web/utils/error_utils.js +101 -0
- package/dist/web/utils/experimental.js +10 -2
- package/dist/web/utils/failover_utils.js +4 -0
- package/dist/web/utils/file_extension_utils.js +4 -0
- package/dist/web/utils/file_utils.js +12 -4
- package/dist/web/utils/gemini_schema_util.js +6 -2
- package/dist/web/utils/genai_schema_to_json.js +80 -0
- package/dist/web/utils/live_connection_utils.js +5 -2
- package/dist/web/utils/logger.js +14 -4
- package/dist/web/utils/model_name.js +9 -0
- package/dist/web/utils/object_notation_utils.js +8 -3
- package/dist/web/utils/optional_peer.js +38 -0
- package/dist/web/utils/output_schema_utils.js +18 -0
- package/dist/web/utils/partial_copy.js +3 -0
- package/dist/web/utils/redact_uri.js +39 -0
- package/dist/web/utils/schema.js +167 -0
- package/dist/web/utils/simple_zod_to_json.js +15 -4
- package/dist/web/utils/streaming_utils.js +14 -6
- package/dist/web/utils/task.js +8 -4
- package/dist/web/utils/variant_utils.js +5 -2
- package/dist/web/utils/vertex_ai_utils.js +7 -2
- package/dist/web/version.js +1 -1
- package/dist/web/workflow/base_node.js +215 -0
- package/dist/web/workflow/branch_path.js +77 -0
- package/dist/web/workflow/dynamic_node_scheduler.js +202 -0
- package/dist/web/workflow/errors.js +140 -0
- package/dist/web/workflow/graph.js +127 -0
- package/dist/web/workflow/index.js +80 -0
- package/dist/web/workflow/node.js +87 -0
- package/dist/web/workflow/node_builders.js +40 -0
- package/dist/web/workflow/node_context.js +236 -0
- package/dist/web/workflow/node_error_event.js +86 -0
- package/dist/web/workflow/node_runner.js +481 -0
- package/dist/web/workflow/node_state.js +43 -0
- package/dist/web/workflow/node_status.js +20 -0
- package/dist/web/workflow/nodes/function_node.js +221 -0
- package/dist/web/workflow/nodes/join_node.js +47 -0
- package/dist/web/workflow/nodes/node_tool.js +131 -0
- package/dist/web/workflow/nodes/parallel_worker.js +120 -0
- package/dist/web/workflow/nodes/tool_node.js +126 -0
- package/dist/web/workflow/request_input.js +36 -0
- package/dist/web/workflow/retry_config.js +43 -0
- package/dist/web/workflow/run_llm_agent_as_node.js +266 -0
- package/dist/web/workflow/run_node_as_invocation.js +170 -0
- package/dist/web/workflow/schedule_dynamic_node.js +26 -0
- package/dist/web/workflow/trigger.js +7 -0
- package/dist/web/workflow/utils/graph_parser.js +188 -0
- package/dist/web/workflow/utils/graph_validation.js +189 -0
- package/dist/web/workflow/utils/hitl_utils.js +239 -0
- package/dist/web/workflow/utils/rehydration_utils.js +342 -0
- package/dist/web/workflow/utils/retry_utils.js +82 -0
- package/dist/web/workflow/utils/workflow_graph_utils.js +115 -0
- package/dist/web/workflow/workflow.js +529 -0
- package/package.json +82 -8
|
@@ -19,6 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
21
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
22
23
|
/**
|
|
23
24
|
* @license
|
|
24
25
|
* Copyright 2026 Google LLC
|
|
@@ -31,7 +32,7 @@ import {
|
|
|
31
32
|
import { MCPTool } from "../../tools/mcp/mcp_tool.js";
|
|
32
33
|
import { logger } from "../../utils/logger.js";
|
|
33
34
|
import { GCP_MCP_SERVER_DESTINATION_ID } from "./types.js";
|
|
34
|
-
class
|
|
35
|
+
const _AgentRegistrySingleMCPToolset = class _AgentRegistrySingleMCPToolset extends BaseToolset {
|
|
35
36
|
/**
|
|
36
37
|
* @param options - Configuration for the MCP toolset.
|
|
37
38
|
* @param options.destinationResourceId - Telemetry identifier injected as
|
|
@@ -111,7 +112,9 @@ class AgentRegistrySingleMCPToolset extends BaseToolset {
|
|
|
111
112
|
}
|
|
112
113
|
async close() {
|
|
113
114
|
}
|
|
114
|
-
}
|
|
115
|
+
};
|
|
116
|
+
__name(_AgentRegistrySingleMCPToolset, "AgentRegistrySingleMCPToolset");
|
|
117
|
+
let AgentRegistrySingleMCPToolset = _AgentRegistrySingleMCPToolset;
|
|
115
118
|
export {
|
|
116
119
|
AgentRegistrySingleMCPToolset
|
|
117
120
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
5
|
/**
|
|
4
6
|
* @license
|
|
5
7
|
* Copyright 2026 Google LLC
|
|
@@ -13,6 +15,7 @@ function isGoogleApi(url) {
|
|
|
13
15
|
return false;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
18
|
+
__name(isGoogleApi, "isGoogleApi");
|
|
16
19
|
function cleanName(name) {
|
|
17
20
|
let clean = name.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
18
21
|
clean = clean.replace(/_+/g, "_");
|
|
@@ -22,6 +25,7 @@ function cleanName(name) {
|
|
|
22
25
|
}
|
|
23
26
|
return clean;
|
|
24
27
|
}
|
|
28
|
+
__name(cleanName, "cleanName");
|
|
25
29
|
export {
|
|
26
30
|
cleanName,
|
|
27
31
|
isGoogleApi
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
5
|
/**
|
|
4
6
|
* @license
|
|
5
7
|
* Copyright 2025 Google LLC
|
|
6
8
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
9
|
*/
|
|
8
|
-
class
|
|
10
|
+
const _InMemoryMemoryService = class _InMemoryMemoryService {
|
|
9
11
|
constructor() {
|
|
10
12
|
this.memories = [];
|
|
11
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A map from user key to a map from session ID to events.
|
|
15
|
+
*
|
|
16
|
+
* The inner map is keyed by `session.id`, which arrives off the request path
|
|
17
|
+
* and contains no `/`, so it can be exactly `__proto__`. On a plain object
|
|
18
|
+
* literal that key would reach the inherited `__proto__` setter and
|
|
19
|
+
* re-parent the map instead of creating an own property, silently dropping
|
|
20
|
+
* the session from the `Object.values` scan in `searchMemory`. The outer key
|
|
21
|
+
* always contains a `/` (see `getUserKey`) and cannot collide, but is
|
|
22
|
+
* created the same way for consistency.
|
|
23
|
+
*/
|
|
24
|
+
this.sessionEvents = /* @__PURE__ */ Object.create(null);
|
|
12
25
|
}
|
|
13
26
|
async addSessionToMemory(session) {
|
|
14
27
|
const userKey = getUserKey(session.appName, session.userId);
|
|
15
28
|
if (!this.sessionEvents[userKey]) {
|
|
16
|
-
this.sessionEvents[userKey] =
|
|
29
|
+
this.sessionEvents[userKey] = /* @__PURE__ */ Object.create(null);
|
|
17
30
|
}
|
|
18
31
|
this.sessionEvents[userKey][session.id] = session.events.filter(
|
|
19
32
|
(event) => {
|
|
@@ -54,18 +67,23 @@ class InMemoryMemoryService {
|
|
|
54
67
|
}
|
|
55
68
|
return response;
|
|
56
69
|
}
|
|
57
|
-
}
|
|
70
|
+
};
|
|
71
|
+
__name(_InMemoryMemoryService, "InMemoryMemoryService");
|
|
72
|
+
let InMemoryMemoryService = _InMemoryMemoryService;
|
|
58
73
|
function getUserKey(appName, userId) {
|
|
59
74
|
return "".concat(appName, "/").concat(userId);
|
|
60
75
|
}
|
|
76
|
+
__name(getUserKey, "getUserKey");
|
|
61
77
|
function extractWordsLower(text) {
|
|
62
78
|
return new Set(
|
|
63
79
|
[...text.matchAll(/[A-Za-z]+/g)].map((match) => match[0].toLowerCase())
|
|
64
80
|
);
|
|
65
81
|
}
|
|
82
|
+
__name(extractWordsLower, "extractWordsLower");
|
|
66
83
|
function formatTimestamp(timestamp) {
|
|
67
84
|
return new Date(timestamp).toISOString();
|
|
68
85
|
}
|
|
86
|
+
__name(formatTimestamp, "formatTimestamp");
|
|
69
87
|
export {
|
|
70
88
|
InMemoryMemoryService
|
|
71
89
|
};
|
|
@@ -16,6 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
}
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
19
20
|
/**
|
|
20
21
|
* @license
|
|
21
22
|
* Copyright 2026 Google LLC
|
|
@@ -24,7 +25,10 @@ var __spreadValues = (a, b) => {
|
|
|
24
25
|
import { Client } from "@google-cloud/vertexai";
|
|
25
26
|
import { createUserContent } from "@google/genai";
|
|
26
27
|
import { logger } from "../utils/logger.js";
|
|
27
|
-
import {
|
|
28
|
+
import {
|
|
29
|
+
EXPRESS_MODE_UNSUPPORTED_MESSAGE,
|
|
30
|
+
getExpressModeApiKey
|
|
31
|
+
} from "../utils/vertex_ai_utils.js";
|
|
28
32
|
const GENERATE_MEMORIES_KNOWN_FIELDS = [
|
|
29
33
|
"disableConsolidation",
|
|
30
34
|
"waitForCompletion",
|
|
@@ -54,6 +58,7 @@ function shouldFilterOutEvent(content) {
|
|
|
54
58
|
(p) => p.text || p.inlineData || p.fileData
|
|
55
59
|
);
|
|
56
60
|
}
|
|
61
|
+
__name(shouldFilterOutEvent, "shouldFilterOutEvent");
|
|
57
62
|
function toVertexMetadataValue(key, value) {
|
|
58
63
|
if (typeof value === "boolean") {
|
|
59
64
|
return { boolValue: value };
|
|
@@ -82,7 +87,8 @@ function toVertexMetadataValue(key, value) {
|
|
|
82
87
|
}
|
|
83
88
|
return { stringValue: String(value) };
|
|
84
89
|
}
|
|
85
|
-
|
|
90
|
+
__name(toVertexMetadataValue, "toVertexMetadataValue");
|
|
91
|
+
const _VertexAiMemoryBankService = class _VertexAiMemoryBankService {
|
|
86
92
|
constructor(options) {
|
|
87
93
|
if (!options.agentEngineId) {
|
|
88
94
|
throw new Error(
|
|
@@ -105,6 +111,9 @@ class VertexAiMemoryBankService {
|
|
|
105
111
|
if (options.client) {
|
|
106
112
|
this.memories = options.client.agentEnginesInternal.memories;
|
|
107
113
|
} else {
|
|
114
|
+
if (this.expressModeApiKey && (!this.projectId || !this.location)) {
|
|
115
|
+
throw new Error(EXPRESS_MODE_UNSUPPORTED_MESSAGE);
|
|
116
|
+
}
|
|
108
117
|
const client = new Client({
|
|
109
118
|
project: this.projectId,
|
|
110
119
|
location: this.location
|
|
@@ -249,7 +258,9 @@ class VertexAiMemoryBankService {
|
|
|
249
258
|
);
|
|
250
259
|
}
|
|
251
260
|
}
|
|
252
|
-
}
|
|
261
|
+
};
|
|
262
|
+
__name(_VertexAiMemoryBankService, "VertexAiMemoryBankService");
|
|
263
|
+
let VertexAiMemoryBankService = _VertexAiMemoryBankService;
|
|
253
264
|
function buildCreateMemoryConfig(params) {
|
|
254
265
|
const config = { waitForCompletion: false };
|
|
255
266
|
if (params.customMetadata) {
|
|
@@ -309,6 +320,7 @@ function buildCreateMemoryConfig(params) {
|
|
|
309
320
|
}
|
|
310
321
|
return config;
|
|
311
322
|
}
|
|
323
|
+
__name(buildCreateMemoryConfig, "buildCreateMemoryConfig");
|
|
312
324
|
function extractRevisionLabels(value, source) {
|
|
313
325
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
314
326
|
logger.warn("Ignoring ".concat(source, " because it is not an object."));
|
|
@@ -329,6 +341,7 @@ function extractRevisionLabels(value, source) {
|
|
|
329
341
|
}
|
|
330
342
|
return revisionLabels;
|
|
331
343
|
}
|
|
344
|
+
__name(extractRevisionLabels, "extractRevisionLabels");
|
|
332
345
|
function buildVertexMetadata(metadataByKey) {
|
|
333
346
|
const vertexMetadata = {};
|
|
334
347
|
for (const [key, value] of Object.entries(metadataByKey)) {
|
|
@@ -339,6 +352,7 @@ function buildVertexMetadata(metadataByKey) {
|
|
|
339
352
|
}
|
|
340
353
|
return vertexMetadata;
|
|
341
354
|
}
|
|
355
|
+
__name(buildVertexMetadata, "buildVertexMetadata");
|
|
342
356
|
function buildGenerateMemoriesConfig(customMetadata) {
|
|
343
357
|
const config = { waitForCompletion: false };
|
|
344
358
|
if (!customMetadata) {
|
|
@@ -388,6 +402,7 @@ function buildGenerateMemoriesConfig(customMetadata) {
|
|
|
388
402
|
}
|
|
389
403
|
return config;
|
|
390
404
|
}
|
|
405
|
+
__name(buildGenerateMemoriesConfig, "buildGenerateMemoriesConfig");
|
|
391
406
|
function normalizeMemoriesForCreate(memories) {
|
|
392
407
|
if (!Array.isArray(memories)) {
|
|
393
408
|
throw new TypeError("memories must be a sequence of memory items.");
|
|
@@ -397,6 +412,7 @@ function normalizeMemoriesForCreate(memories) {
|
|
|
397
412
|
}
|
|
398
413
|
return memories;
|
|
399
414
|
}
|
|
415
|
+
__name(normalizeMemoriesForCreate, "normalizeMemoriesForCreate");
|
|
400
416
|
function memoryEntryToFact(memory, index) {
|
|
401
417
|
const textParts = [];
|
|
402
418
|
if (memory.content && memory.content.parts) {
|
|
@@ -419,6 +435,7 @@ function memoryEntryToFact(memory, index) {
|
|
|
419
435
|
}
|
|
420
436
|
return textParts.join("\n");
|
|
421
437
|
}
|
|
438
|
+
__name(memoryEntryToFact, "memoryEntryToFact");
|
|
422
439
|
function mergeCustomMetadataForMemory(params) {
|
|
423
440
|
const mergedMetadata = {};
|
|
424
441
|
if (params.customMetadata) {
|
|
@@ -433,6 +450,7 @@ function mergeCustomMetadataForMemory(params) {
|
|
|
433
450
|
}
|
|
434
451
|
return mergedMetadata;
|
|
435
452
|
}
|
|
453
|
+
__name(mergeCustomMetadataForMemory, "mergeCustomMetadataForMemory");
|
|
436
454
|
function revisionLabelsForMemory(memory) {
|
|
437
455
|
const revisionLabels = {};
|
|
438
456
|
if (memory.author) {
|
|
@@ -446,6 +464,7 @@ function revisionLabelsForMemory(memory) {
|
|
|
446
464
|
}
|
|
447
465
|
return revisionLabels;
|
|
448
466
|
}
|
|
467
|
+
__name(revisionLabelsForMemory, "revisionLabelsForMemory");
|
|
449
468
|
function isConsolidationEnabled(customMetadata) {
|
|
450
469
|
if (!customMetadata) {
|
|
451
470
|
return false;
|
|
@@ -461,6 +480,7 @@ function isConsolidationEnabled(customMetadata) {
|
|
|
461
480
|
}
|
|
462
481
|
return enableConsolidation;
|
|
463
482
|
}
|
|
483
|
+
__name(isConsolidationEnabled, "isConsolidationEnabled");
|
|
464
484
|
function iterMemoryBatches(memories) {
|
|
465
485
|
const memoryBatches = [];
|
|
466
486
|
for (let index = 0; index < memories.length; index += MAX_DIRECT_MEMORIES_PER_GENERATE_CALL) {
|
|
@@ -470,6 +490,7 @@ function iterMemoryBatches(memories) {
|
|
|
470
490
|
}
|
|
471
491
|
return memoryBatches;
|
|
472
492
|
}
|
|
493
|
+
__name(iterMemoryBatches, "iterMemoryBatches");
|
|
473
494
|
export {
|
|
474
495
|
VertexAiMemoryBankService
|
|
475
496
|
};
|
|
@@ -23,6 +23,7 @@ var __spreadValues = (a, b) => {
|
|
|
23
23
|
return a;
|
|
24
24
|
};
|
|
25
25
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
26
27
|
var __await = function(promise, isYieldStar) {
|
|
27
28
|
this[0] = promise;
|
|
28
29
|
this[1] = isYieldStar;
|
|
@@ -75,7 +76,7 @@ import { isBrowser } from "../utils/env_aware_utils.js";
|
|
|
75
76
|
import { logger } from "../utils/logger.js";
|
|
76
77
|
import { Gemini, geminiInitParams } from "./google_llm.js";
|
|
77
78
|
const APIGEE_PROXY_URL_ENV_VARIABLE_NAME = "APIGEE_PROXY_URL";
|
|
78
|
-
class
|
|
79
|
+
const _ApigeeLlm = class _ApigeeLlm extends Gemini {
|
|
79
80
|
constructor({
|
|
80
81
|
model,
|
|
81
82
|
proxyUrl,
|
|
@@ -147,15 +148,17 @@ class ApigeeLlm extends Gemini {
|
|
|
147
148
|
llmRequest.model = getModelId(modelToUse);
|
|
148
149
|
return super.connect(llmRequest);
|
|
149
150
|
}
|
|
150
|
-
}
|
|
151
|
+
};
|
|
152
|
+
__name(_ApigeeLlm, "ApigeeLlm");
|
|
151
153
|
/**
|
|
152
154
|
* A list of model name patterns that are supported by this LLM.
|
|
153
155
|
*
|
|
154
156
|
* @returns A list of supported models.
|
|
155
157
|
*/
|
|
156
|
-
|
|
158
|
+
_ApigeeLlm.supportedModels = [
|
|
157
159
|
/apigee\/.*/
|
|
158
160
|
];
|
|
161
|
+
let ApigeeLlm = _ApigeeLlm;
|
|
159
162
|
function apigeeToGeminiInitParams({
|
|
160
163
|
model,
|
|
161
164
|
vertexai,
|
|
@@ -177,6 +180,7 @@ function apigeeToGeminiInitParams({
|
|
|
177
180
|
}
|
|
178
181
|
return params;
|
|
179
182
|
}
|
|
183
|
+
__name(apigeeToGeminiInitParams, "apigeeToGeminiInitParams");
|
|
180
184
|
function getModelId(model) {
|
|
181
185
|
if (!validateModel(model)) {
|
|
182
186
|
throw new Error(
|
|
@@ -186,6 +190,7 @@ function getModelId(model) {
|
|
|
186
190
|
const components = model.split("/");
|
|
187
191
|
return components[components.length - 1];
|
|
188
192
|
}
|
|
193
|
+
__name(getModelId, "getModelId");
|
|
189
194
|
function validateModel(model) {
|
|
190
195
|
const validProviders = ["vertex_ai", "gemini"];
|
|
191
196
|
if (!model.startsWith("apigee/")) {
|
|
@@ -216,6 +221,7 @@ function validateModel(model) {
|
|
|
216
221
|
}
|
|
217
222
|
return false;
|
|
218
223
|
}
|
|
224
|
+
__name(validateModel, "validateModel");
|
|
219
225
|
export {
|
|
220
226
|
ApigeeLlm
|
|
221
227
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
5
|
/**
|
|
4
6
|
* @license
|
|
5
7
|
* Copyright 2025 Google LLC
|
|
@@ -11,8 +13,9 @@ const BASE_MODEL_SYMBOL = Symbol.for("google.adk.baseModel");
|
|
|
11
13
|
function isBaseLlm(obj) {
|
|
12
14
|
return typeof obj === "object" && obj !== null && BASE_MODEL_SYMBOL in obj && obj[BASE_MODEL_SYMBOL] === true;
|
|
13
15
|
}
|
|
16
|
+
__name(isBaseLlm, "isBaseLlm");
|
|
14
17
|
_a = BASE_MODEL_SYMBOL;
|
|
15
|
-
class
|
|
18
|
+
const _BaseLlm = class _BaseLlm {
|
|
16
19
|
/**
|
|
17
20
|
* Creates an instance of BaseLLM.
|
|
18
21
|
* @param params The parameters for creating a BaseLlm instance.
|
|
@@ -62,11 +65,13 @@ class BaseLlm {
|
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
|
-
}
|
|
68
|
+
};
|
|
69
|
+
__name(_BaseLlm, "BaseLlm");
|
|
66
70
|
/**
|
|
67
71
|
* List of supported models in regex for LlmRegistry.
|
|
68
72
|
*/
|
|
69
|
-
|
|
73
|
+
_BaseLlm.supportedModels = [];
|
|
74
|
+
let BaseLlm = _BaseLlm;
|
|
70
75
|
export {
|
|
71
76
|
BaseLlm,
|
|
72
77
|
isBaseLlm
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
3
4
|
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
6
|
var __await = function(promise, isYieldStar) {
|
|
5
7
|
this[0] = promise;
|
|
6
8
|
this[1] = isYieldStar;
|
|
@@ -25,7 +27,7 @@ var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")])
|
|
|
25
27
|
import { LiveResponseAggregator } from "../utils/live_connection_utils.js";
|
|
26
28
|
import { logger } from "../utils/logger.js";
|
|
27
29
|
import { isGemini3xFlashLive } from "../utils/model_name.js";
|
|
28
|
-
class
|
|
30
|
+
const _GeminiLlmConnection = class _GeminiLlmConnection {
|
|
29
31
|
constructor(geminiSession, modelVersion, messageQueue) {
|
|
30
32
|
this.geminiSession = geminiSession;
|
|
31
33
|
this.modelVersion = modelVersion;
|
|
@@ -173,7 +175,9 @@ class GeminiLlmConnection {
|
|
|
173
175
|
async close() {
|
|
174
176
|
this.geminiSession.close();
|
|
175
177
|
}
|
|
176
|
-
}
|
|
178
|
+
};
|
|
179
|
+
__name(_GeminiLlmConnection, "GeminiLlmConnection");
|
|
180
|
+
let GeminiLlmConnection = _GeminiLlmConnection;
|
|
177
181
|
export {
|
|
178
182
|
GeminiLlmConnection
|
|
179
183
|
};
|
|
@@ -20,6 +20,7 @@ var __spreadValues = (a, b) => {
|
|
|
20
20
|
}
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
23
24
|
var __await = function(promise, isYieldStar) {
|
|
24
25
|
this[0] = promise;
|
|
25
26
|
this[1] = isYieldStar;
|
|
@@ -74,7 +75,7 @@ import {
|
|
|
74
75
|
createPartFromText,
|
|
75
76
|
GoogleGenAI
|
|
76
77
|
} from "@google/genai";
|
|
77
|
-
import {
|
|
78
|
+
import { isBrowser, isEnterpriseModeEnabled } from "../utils/env_aware_utils.js";
|
|
78
79
|
import { logger } from "../utils/logger.js";
|
|
79
80
|
import { GoogleLLMVariant } from "../utils/variant_utils.js";
|
|
80
81
|
import { AsyncQueue } from "../utils/async_queue.js";
|
|
@@ -87,7 +88,8 @@ const GEMINI_MODEL_SYMBOL = Symbol.for("google.adk.geminiModel");
|
|
|
87
88
|
function isGemini(obj) {
|
|
88
89
|
return typeof obj === "object" && obj !== null && GEMINI_MODEL_SYMBOL in obj && obj[GEMINI_MODEL_SYMBOL] === true;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
+
__name(isGemini, "isGemini");
|
|
92
|
+
const _Gemini = class _Gemini extends (_b = BaseLlm, _a = GEMINI_MODEL_SYMBOL, _b) {
|
|
91
93
|
/**
|
|
92
94
|
* @param params The parameters for creating a Gemini instance.
|
|
93
95
|
*/
|
|
@@ -114,7 +116,7 @@ class Gemini extends (_b = BaseLlm, _a = GEMINI_MODEL_SYMBOL, _b) {
|
|
|
114
116
|
});
|
|
115
117
|
if (!params.vertexai && !params.apiKey) {
|
|
116
118
|
throw new Error(
|
|
117
|
-
"API key must be provided via constructor or GOOGLE_GENAI_API_KEY or GEMINI_API_KEY environment variable."
|
|
119
|
+
"API key must be provided via constructor or the GOOGLE_GENAI_API_KEY, GOOGLE_API_KEY or GEMINI_API_KEY environment variable."
|
|
118
120
|
);
|
|
119
121
|
}
|
|
120
122
|
this.project = params.project;
|
|
@@ -288,21 +290,27 @@ class Gemini extends (_b = BaseLlm, _a = GEMINI_MODEL_SYMBOL, _b) {
|
|
|
288
290
|
};
|
|
289
291
|
}
|
|
290
292
|
llmRequest.liveConnectConfig.tools = (_c = llmRequest.config) == null ? void 0 : _c.tools;
|
|
293
|
+
if (this.apiBackend === GoogleLLMVariant.GEMINI_API) {
|
|
294
|
+
const resumption = llmRequest.liveConnectConfig.sessionResumption;
|
|
295
|
+
if (resumption) {
|
|
296
|
+
delete resumption.transparent;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
291
299
|
const modelVersion = (_d = llmRequest.model) != null ? _d : this.model;
|
|
292
300
|
const messageQueue = new AsyncQueue();
|
|
293
301
|
const liveSession = await this.liveApiClient.live.connect({
|
|
294
302
|
model: modelVersion,
|
|
295
303
|
config: llmRequest.liveConnectConfig,
|
|
296
304
|
callbacks: {
|
|
297
|
-
onmessage: (message) => {
|
|
305
|
+
onmessage: /* @__PURE__ */ __name((message) => {
|
|
298
306
|
messageQueue.push(message);
|
|
299
|
-
},
|
|
300
|
-
onerror: (error) => {
|
|
307
|
+
}, "onmessage"),
|
|
308
|
+
onerror: /* @__PURE__ */ __name((error) => {
|
|
301
309
|
messageQueue.error(error);
|
|
302
|
-
},
|
|
303
|
-
onclose: () => {
|
|
310
|
+
}, "onerror"),
|
|
311
|
+
onclose: /* @__PURE__ */ __name(() => {
|
|
304
312
|
messageQueue.close();
|
|
305
|
-
}
|
|
313
|
+
}, "onclose")
|
|
306
314
|
}
|
|
307
315
|
});
|
|
308
316
|
return new GeminiLlmConnection(liveSession, modelVersion, messageQueue);
|
|
@@ -323,24 +331,27 @@ class Gemini extends (_b = BaseLlm, _a = GEMINI_MODEL_SYMBOL, _b) {
|
|
|
323
331
|
}
|
|
324
332
|
}
|
|
325
333
|
}
|
|
326
|
-
}
|
|
334
|
+
};
|
|
335
|
+
__name(_Gemini, "Gemini");
|
|
327
336
|
/**
|
|
328
337
|
* A list of model name patterns that are supported by this LLM.
|
|
329
338
|
*
|
|
330
339
|
* @returns A list of supported models.
|
|
331
340
|
*/
|
|
332
|
-
|
|
341
|
+
_Gemini.supportedModels = [
|
|
333
342
|
/gemini-.*/,
|
|
334
343
|
// fine-tuned vertex endpoint pattern
|
|
335
344
|
/projects\/.+\/locations\/.+\/endpoints\/.+/,
|
|
336
345
|
// vertex gemini long name
|
|
337
346
|
/projects\/.+\/locations\/.+\/publishers\/google\/models\/gemini.+/
|
|
338
347
|
];
|
|
348
|
+
let Gemini = _Gemini;
|
|
339
349
|
function removeDisplayNameIfPresent(dataObj) {
|
|
340
350
|
if (dataObj && dataObj.displayName) {
|
|
341
351
|
dataObj.displayName = void 0;
|
|
342
352
|
}
|
|
343
353
|
}
|
|
354
|
+
__name(removeDisplayNameIfPresent, "removeDisplayNameIfPresent");
|
|
344
355
|
function geminiInitParams({
|
|
345
356
|
model,
|
|
346
357
|
vertexai,
|
|
@@ -351,7 +362,7 @@ function geminiInitParams({
|
|
|
351
362
|
const params = { model, vertexai, project, location, apiKey };
|
|
352
363
|
params.vertexai = !!vertexai;
|
|
353
364
|
if (!params.vertexai && !isBrowser()) {
|
|
354
|
-
params.vertexai =
|
|
365
|
+
params.vertexai = isEnterpriseModeEnabled();
|
|
355
366
|
}
|
|
356
367
|
if (params.vertexai) {
|
|
357
368
|
if (!isBrowser() && !params.project) {
|
|
@@ -372,11 +383,12 @@ function geminiInitParams({
|
|
|
372
383
|
}
|
|
373
384
|
} else {
|
|
374
385
|
if (!params.apiKey && !isBrowser()) {
|
|
375
|
-
params.apiKey = process.env["GOOGLE_GENAI_API_KEY"] || process.env["GEMINI_API_KEY"];
|
|
386
|
+
params.apiKey = process.env["GOOGLE_GENAI_API_KEY"] || process.env["GOOGLE_API_KEY"] || process.env["GEMINI_API_KEY"];
|
|
376
387
|
}
|
|
377
388
|
}
|
|
378
389
|
return params;
|
|
379
390
|
}
|
|
391
|
+
__name(geminiInitParams, "geminiInitParams");
|
|
380
392
|
export {
|
|
381
393
|
Gemini,
|
|
382
394
|
geminiInitParams,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
3
4
|
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
6
|
var __await = function(promise, isYieldStar) {
|
|
5
7
|
this[0] = promise;
|
|
6
8
|
this[1] = isYieldStar;
|
|
@@ -38,6 +40,7 @@ function getInteractionMediaType(mimeType) {
|
|
|
38
40
|
return "document";
|
|
39
41
|
}
|
|
40
42
|
}
|
|
43
|
+
__name(getInteractionMediaType, "getInteractionMediaType");
|
|
41
44
|
function getLatestUserContents(contents) {
|
|
42
45
|
if (!contents || contents.length === 0) {
|
|
43
46
|
return [];
|
|
@@ -80,6 +83,7 @@ function getLatestUserContents(contents) {
|
|
|
80
83
|
}
|
|
81
84
|
return latestUserContents;
|
|
82
85
|
}
|
|
86
|
+
__name(getLatestUserContents, "getLatestUserContents");
|
|
83
87
|
function convertPartToMediaContent(part) {
|
|
84
88
|
if (part.text !== void 0 && part.text !== null) {
|
|
85
89
|
return { type: "text", text: part.text };
|
|
@@ -102,6 +106,7 @@ function convertPartToMediaContent(part) {
|
|
|
102
106
|
}
|
|
103
107
|
return null;
|
|
104
108
|
}
|
|
109
|
+
__name(convertPartToMediaContent, "convertPartToMediaContent");
|
|
105
110
|
function convertContentToSteps(content) {
|
|
106
111
|
const steps = [];
|
|
107
112
|
const role = content.role || "user";
|
|
@@ -187,6 +192,7 @@ function convertContentToSteps(content) {
|
|
|
187
192
|
}
|
|
188
193
|
return steps;
|
|
189
194
|
}
|
|
195
|
+
__name(convertContentToSteps, "convertContentToSteps");
|
|
190
196
|
function convertMediaContentToPart(content) {
|
|
191
197
|
if (content.type === "text") {
|
|
192
198
|
return { text: content.text || "" };
|
|
@@ -211,6 +217,7 @@ function convertMediaContentToPart(content) {
|
|
|
211
217
|
}
|
|
212
218
|
return null;
|
|
213
219
|
}
|
|
220
|
+
__name(convertMediaContentToPart, "convertMediaContentToPart");
|
|
214
221
|
function convertStepToParts(step) {
|
|
215
222
|
if (!step || !step.type) {
|
|
216
223
|
return [];
|
|
@@ -306,6 +313,7 @@ function convertStepToParts(step) {
|
|
|
306
313
|
return [];
|
|
307
314
|
}
|
|
308
315
|
}
|
|
316
|
+
__name(convertStepToParts, "convertStepToParts");
|
|
309
317
|
function convertToolsConfigToInteractionsFormat(config) {
|
|
310
318
|
if (!config.tools) {
|
|
311
319
|
return [];
|
|
@@ -354,6 +362,7 @@ function convertToolsConfigToInteractionsFormat(config) {
|
|
|
354
362
|
}
|
|
355
363
|
return interactionTools;
|
|
356
364
|
}
|
|
365
|
+
__name(convertToolsConfigToInteractionsFormat, "convertToolsConfigToInteractionsFormat");
|
|
357
366
|
function findLastPart(parts, predicate) {
|
|
358
367
|
for (let i = parts.length - 1; i >= 0; i--) {
|
|
359
368
|
if (predicate(parts[i])) {
|
|
@@ -362,6 +371,7 @@ function findLastPart(parts, predicate) {
|
|
|
362
371
|
}
|
|
363
372
|
return void 0;
|
|
364
373
|
}
|
|
374
|
+
__name(findLastPart, "findLastPart");
|
|
365
375
|
function getLatestModelParts(steps) {
|
|
366
376
|
if (!steps || steps.length === 0) {
|
|
367
377
|
return [];
|
|
@@ -377,6 +387,7 @@ function getLatestModelParts(steps) {
|
|
|
377
387
|
}
|
|
378
388
|
return latestParts;
|
|
379
389
|
}
|
|
390
|
+
__name(getLatestModelParts, "getLatestModelParts");
|
|
380
391
|
function convertInteractionToLlmResponse(interaction) {
|
|
381
392
|
if (interaction.status === "failed") {
|
|
382
393
|
let errorMsg = "Unknown error";
|
|
@@ -418,6 +429,7 @@ function convertInteractionToLlmResponse(interaction) {
|
|
|
418
429
|
interactionId: interaction.id
|
|
419
430
|
};
|
|
420
431
|
}
|
|
432
|
+
__name(convertInteractionToLlmResponse, "convertInteractionToLlmResponse");
|
|
421
433
|
function convertInteractionEventToLlmResponse(event, aggregatedParts, interactionId) {
|
|
422
434
|
var _a, _b;
|
|
423
435
|
const eventType = event.event_type || event.eventType;
|
|
@@ -573,6 +585,7 @@ function convertInteractionEventToLlmResponse(event, aggregatedParts, interactio
|
|
|
573
585
|
}
|
|
574
586
|
return null;
|
|
575
587
|
}
|
|
588
|
+
__name(convertInteractionEventToLlmResponse, "convertInteractionEventToLlmResponse");
|
|
576
589
|
function buildGenerationConfig(config) {
|
|
577
590
|
const generationConfig = {};
|
|
578
591
|
if (config.temperature !== void 0 && config.temperature !== null) {
|
|
@@ -598,6 +611,7 @@ function buildGenerationConfig(config) {
|
|
|
598
611
|
}
|
|
599
612
|
return generationConfig;
|
|
600
613
|
}
|
|
614
|
+
__name(buildGenerationConfig, "buildGenerationConfig");
|
|
601
615
|
function extractSystemInstruction(config) {
|
|
602
616
|
const systemInstruction = config.systemInstruction;
|
|
603
617
|
if (!systemInstruction) {
|
|
@@ -618,6 +632,7 @@ function extractSystemInstruction(config) {
|
|
|
618
632
|
}
|
|
619
633
|
return void 0;
|
|
620
634
|
}
|
|
635
|
+
__name(extractSystemInstruction, "extractSystemInstruction");
|
|
621
636
|
function extractStreamInteractionId(event) {
|
|
622
637
|
if (event.interaction_id || event.interactionId) {
|
|
623
638
|
return event.interaction_id || event.interactionId;
|
|
@@ -630,6 +645,7 @@ function extractStreamInteractionId(event) {
|
|
|
630
645
|
}
|
|
631
646
|
return void 0;
|
|
632
647
|
}
|
|
648
|
+
__name(extractStreamInteractionId, "extractStreamInteractionId");
|
|
633
649
|
function generateContentViaInteractions(apiClient, llmRequest, stream) {
|
|
634
650
|
return __asyncGenerator(this, null, function* () {
|
|
635
651
|
let contents = llmRequest.contents;
|
|
@@ -714,6 +730,7 @@ function generateContentViaInteractions(apiClient, llmRequest, stream) {
|
|
|
714
730
|
}
|
|
715
731
|
});
|
|
716
732
|
}
|
|
733
|
+
__name(generateContentViaInteractions, "generateContentViaInteractions");
|
|
717
734
|
export {
|
|
718
735
|
buildGenerationConfig,
|
|
719
736
|
convertContentToSteps,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
5
|
/**
|
|
4
6
|
* @license
|
|
5
7
|
* Copyright 2025 Google LLC
|
|
@@ -16,6 +18,7 @@ function appendInstructions(llmRequest, instructions) {
|
|
|
16
18
|
llmRequest.config.systemInstruction = newInstructions;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
21
|
+
__name(appendInstructions, "appendInstructions");
|
|
19
22
|
function appendTools(llmRequest, tools) {
|
|
20
23
|
if (!(tools == null ? void 0 : tools.length)) {
|
|
21
24
|
return;
|
|
@@ -38,6 +41,7 @@ function appendTools(llmRequest, tools) {
|
|
|
38
41
|
llmRequest.config.tools.push({ functionDeclarations });
|
|
39
42
|
}
|
|
40
43
|
}
|
|
44
|
+
__name(appendTools, "appendTools");
|
|
41
45
|
function setOutputSchema(llmRequest, schema) {
|
|
42
46
|
if (!llmRequest.config) {
|
|
43
47
|
llmRequest.config = {};
|
|
@@ -45,6 +49,7 @@ function setOutputSchema(llmRequest, schema) {
|
|
|
45
49
|
llmRequest.config.responseSchema = schema;
|
|
46
50
|
llmRequest.config.responseMimeType = "application/json";
|
|
47
51
|
}
|
|
52
|
+
__name(setOutputSchema, "setOutputSchema");
|
|
48
53
|
export {
|
|
49
54
|
appendInstructions,
|
|
50
55
|
appendTools,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
5
|
/**
|
|
4
6
|
* @license
|
|
5
7
|
* Copyright 2025 Google LLC
|
|
@@ -40,6 +42,7 @@ function createLlmResponse(response) {
|
|
|
40
42
|
usageMetadata
|
|
41
43
|
};
|
|
42
44
|
}
|
|
45
|
+
__name(createLlmResponse, "createLlmResponse");
|
|
43
46
|
export {
|
|
44
47
|
createLlmResponse
|
|
45
48
|
};
|