@google/adk 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/a2a/a2a_remote_agent.js +4 -1
- package/dist/cjs/a2a/agent_card.js +102 -26
- package/dist/cjs/a2a/agent_to_a2a.js +1 -1
- package/dist/cjs/a2a/event_converter_utils.js +5 -1
- package/dist/cjs/a2a/metadata_converter_utils.js +2 -1
- package/dist/cjs/agents/functions.js +199 -25
- package/dist/cjs/agents/instructions.js +4 -1
- package/dist/cjs/agents/invocation_context.js +26 -4
- package/dist/cjs/agents/langgraph_agent.js +152 -0
- package/dist/cjs/agents/llm_agent.js +175 -101
- package/dist/cjs/agents/processors/code_execution_request_processor.js +10 -6
- package/dist/cjs/agents/remote_agent.js +187 -0
- package/dist/cjs/artifacts/in_memory_artifact_service.js +14 -0
- package/dist/cjs/auth/auth_handler.js +37 -5
- package/dist/cjs/auth/auth_schemes.js +9 -0
- package/dist/cjs/cli/cli_eval.js +532 -0
- package/dist/cjs/cli/utils/envs.js +116 -0
- package/dist/cjs/cli/utils/evals.js +137 -0
- package/dist/cjs/cli/utils/logs.js +150 -0
- package/dist/cjs/code_executors/agent_engine_sandbox_code_executor.js +7 -2
- package/dist/cjs/code_executors/code_execution_utils.js +48 -16
- package/dist/cjs/code_executors/code_executor_context.js +6 -2
- package/dist/cjs/common.js +90 -0
- package/dist/cjs/context/summarizers/llm_summarizer.js +12 -10
- package/dist/cjs/context/token_based_context_compactor.js +2 -1
- package/dist/cjs/events/abort_events.js +135 -0
- package/dist/cjs/events/event.js +4 -2
- package/dist/cjs/events/internal_metadata.js +131 -0
- package/dist/cjs/examples/example_util.js +23 -2
- package/dist/cjs/flows/llm_flows/audio_transcriber.js +170 -0
- package/dist/cjs/index.js +97 -1
- package/dist/cjs/integrations/agent_registry/helpers.js +1 -1
- package/dist/cjs/models/gemini_llm_connection.js +16 -8
- package/dist/cjs/models/google_llm.js +13 -16
- package/dist/cjs/models/llm_response.js +9 -1
- package/dist/cjs/models/registry.js +1 -1
- package/dist/cjs/models/routed_llm.js +9 -8
- package/dist/cjs/planners/plan_re_act_planner.js +1 -1
- package/dist/cjs/plugins/debug_logging_plugin.js +653 -0
- package/dist/cjs/plugins/plugin_manager.js +1 -1
- package/dist/cjs/plugins/tool_call_integrity_plugin.js +364 -0
- package/dist/cjs/runner/in_memory_runner.js +6 -11
- package/dist/cjs/runner/runner.js +121 -35
- package/dist/cjs/sessions/db/operations.js +1 -1
- package/dist/cjs/sessions/in_memory_session_service.js +3 -1
- package/dist/cjs/sessions/state.js +8 -4
- package/dist/cjs/sessions/vertex_ai_session_service.js +34 -15
- package/dist/cjs/telemetry/tracing.js +97 -66
- package/dist/cjs/tools/agent_tool.js +44 -0
- package/dist/cjs/tools/apihub_tool/apihub_toolset.js +142 -0
- package/dist/cjs/tools/apihub_tool/clients/apihub_client.js +272 -0
- package/dist/cjs/tools/apihub_tool/clients/secret_client.js +148 -0
- package/dist/cjs/tools/apihub_tool/clients/service_account.js +48 -0
- package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +185 -0
- package/dist/cjs/tools/application_integration_tool/clients/cloud_request.js +133 -0
- package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +603 -0
- package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +219 -0
- package/dist/cjs/tools/crewai_tool.js +132 -0
- package/dist/cjs/tools/example_tool.js +10 -0
- package/dist/cjs/tools/function_tool.js +319 -0
- package/dist/cjs/tools/google_api_tool/google_api_tool.js +97 -0
- package/dist/cjs/tools/google_api_tool/google_api_tool_set.js +226 -0
- package/dist/cjs/tools/google_api_tool/google_api_tool_sets.js +58 -0
- package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +440 -0
- package/dist/cjs/tools/google_api_tool/index.js +64 -0
- package/dist/cjs/tools/langchain_tool.js +172 -0
- package/dist/cjs/tools/mcp/index.js +12 -0
- package/dist/cjs/tools/mcp/mcp_session_manager.js +25 -0
- package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +1 -2
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +46 -2
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -1
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +94 -10
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +14 -2
- package/dist/cjs/tools/retrieval/base_retrieval_tool.js +18 -3
- package/dist/cjs/tools/toolbox_tool.js +108 -0
- package/dist/cjs/utils/env_aware_utils.js +6 -8
- package/dist/cjs/utils/error_utils.js +11 -11
- package/dist/cjs/utils/file_extension_utils.js +11 -0
- package/dist/cjs/utils/file_utils.js +2 -24
- package/dist/cjs/utils/gemini_schema_util.js +4 -1
- package/dist/cjs/utils/json_utils.js +49 -0
- package/dist/cjs/utils/live_connection_utils.js +4 -5
- package/dist/cjs/utils/logger_node.js +7 -1
- package/dist/cjs/utils/object_notation_utils.js +6 -3
- package/dist/cjs/utils/streaming_utils.js +12 -12
- package/dist/cjs/version.js +1 -1
- package/dist/esm/a2a/a2a_remote_agent.js +4 -1
- package/dist/esm/a2a/agent_card.js +103 -27
- package/dist/esm/a2a/agent_to_a2a.js +5 -2
- package/dist/esm/a2a/event_converter_utils.js +5 -1
- package/dist/esm/a2a/metadata_converter_utils.js +2 -1
- package/dist/esm/agents/functions.js +198 -25
- package/dist/esm/agents/instructions.js +4 -1
- package/dist/esm/agents/invocation_context.js +24 -4
- package/dist/esm/agents/langgraph_agent.js +123 -0
- package/dist/esm/agents/llm_agent.js +185 -104
- package/dist/esm/agents/processors/code_execution_request_processor.js +13 -8
- package/dist/esm/agents/remote_agent.js +164 -0
- package/dist/esm/artifacts/in_memory_artifact_service.js +14 -0
- package/dist/esm/auth/auth_handler.js +37 -5
- package/dist/esm/auth/auth_schemes.js +8 -0
- package/dist/esm/cli/cli_eval.js +510 -0
- package/dist/esm/cli/utils/envs.js +78 -0
- package/dist/esm/cli/utils/evals.js +109 -0
- package/dist/esm/cli/utils/logs.js +111 -0
- package/dist/esm/code_executors/agent_engine_sandbox_code_executor.js +7 -2
- package/dist/esm/code_executors/code_execution_utils.js +46 -16
- package/dist/esm/code_executors/code_executor_context.js +5 -2
- package/dist/esm/common.js +87 -3
- package/dist/esm/context/summarizers/llm_summarizer.js +12 -10
- package/dist/esm/context/token_based_context_compactor.js +2 -1
- package/dist/esm/events/abort_events.js +110 -0
- package/dist/esm/events/event.js +4 -2
- package/dist/esm/events/internal_metadata.js +97 -0
- package/dist/esm/examples/example_util.js +21 -1
- package/dist/esm/flows/llm_flows/audio_transcriber.js +142 -0
- package/dist/esm/index.js +99 -1
- package/dist/esm/integrations/agent_registry/helpers.js +1 -1
- package/dist/esm/models/gemini_llm_connection.js +16 -8
- package/dist/esm/models/google_llm.js +14 -17
- package/dist/esm/models/llm_response.js +9 -1
- package/dist/esm/models/registry.js +1 -1
- package/dist/esm/models/routed_llm.js +9 -8
- package/dist/esm/planners/plan_re_act_planner.js +1 -1
- package/dist/esm/plugins/debug_logging_plugin.js +615 -0
- package/dist/esm/plugins/plugin_manager.js +1 -1
- package/dist/esm/plugins/tool_call_integrity_plugin.js +339 -0
- package/dist/esm/runner/in_memory_runner.js +6 -11
- package/dist/esm/runner/runner.js +124 -35
- package/dist/esm/sessions/db/operations.js +1 -1
- package/dist/esm/sessions/in_memory_session_service.js +3 -1
- package/dist/esm/sessions/state.js +8 -4
- package/dist/esm/sessions/vertex_ai_session_service.js +34 -15
- package/dist/esm/telemetry/tracing.js +97 -66
- package/dist/esm/tools/agent_tool.js +44 -0
- package/dist/esm/tools/apihub_tool/apihub_toolset.js +106 -0
- package/dist/esm/tools/apihub_tool/clients/apihub_client.js +244 -0
- package/dist/esm/tools/apihub_tool/clients/secret_client.js +132 -0
- package/dist/esm/tools/apihub_tool/clients/service_account.js +21 -0
- package/dist/esm/tools/application_integration_tool/application_integration_toolset.js +163 -0
- package/dist/esm/tools/application_integration_tool/clients/cloud_request.js +103 -0
- package/dist/esm/tools/application_integration_tool/clients/connections_client.js +561 -0
- package/dist/esm/tools/application_integration_tool/clients/integration_client.js +215 -0
- package/dist/esm/tools/crewai_tool.js +107 -0
- package/dist/esm/tools/example_tool.js +13 -1
- package/dist/esm/tools/function_tool.js +316 -0
- package/dist/esm/tools/google_api_tool/google_api_tool.js +70 -0
- package/dist/esm/tools/google_api_tool/google_api_tool_set.js +188 -0
- package/dist/esm/tools/google_api_tool/google_api_tool_sets.js +24 -0
- package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +393 -0
- package/dist/esm/tools/google_api_tool/index.js +33 -0
- package/dist/esm/tools/langchain_tool.js +148 -0
- package/dist/esm/tools/mcp/index.js +6 -0
- package/dist/esm/tools/mcp/mcp_session_manager.js +25 -0
- package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +1 -2
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +50 -3
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -1
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +94 -10
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +15 -2
- package/dist/esm/tools/retrieval/base_retrieval_tool.js +16 -2
- package/dist/esm/tools/toolbox_tool.js +80 -0
- package/dist/esm/utils/env_aware_utils.js +6 -8
- package/dist/esm/utils/error_utils.js +9 -10
- package/dist/esm/utils/file_extension_utils.js +11 -0
- package/dist/esm/utils/file_utils.js +2 -23
- package/dist/esm/utils/gemini_schema_util.js +4 -1
- package/dist/esm/utils/json_utils.js +21 -0
- package/dist/esm/utils/live_connection_utils.js +4 -5
- package/dist/esm/utils/logger_node.js +7 -1
- package/dist/esm/utils/object_notation_utils.js +4 -2
- package/dist/esm/utils/streaming_utils.js +11 -11
- package/dist/esm/version.js +1 -1
- package/dist/types/a2a/a2a_remote_agent.d.ts +9 -0
- package/dist/types/a2a/agent_card.d.ts +44 -1
- package/dist/types/a2a/agent_to_a2a.d.ts +9 -0
- package/dist/types/a2a/index.d.ts +1 -0
- package/dist/types/agents/functions.d.ts +33 -1
- package/dist/types/agents/invocation_context.d.ts +20 -1
- package/dist/types/agents/langgraph_agent.d.ts +153 -0
- package/dist/types/agents/remote_agent.d.ts +68 -0
- package/dist/types/auth/auth_handler.d.ts +28 -1
- package/dist/types/auth/auth_schemes.d.ts +13 -0
- package/dist/types/cli/cli_eval.d.ts +173 -0
- package/dist/types/cli/utils/envs.d.ts +23 -0
- package/dist/types/cli/utils/evals.d.ts +47 -0
- package/dist/types/cli/utils/logs.d.ts +38 -0
- package/dist/types/code_executors/code_execution_utils.d.ts +39 -0
- package/dist/types/code_executors/code_executor_context.d.ts +1 -0
- package/dist/types/common.d.ts +30 -4
- package/dist/types/events/abort_events.d.ts +43 -0
- package/dist/types/events/event.d.ts +4 -0
- package/dist/types/events/internal_metadata.d.ts +78 -0
- package/dist/types/examples/example_util.d.ts +17 -0
- package/dist/types/flows/llm_flows/audio_transcriber.d.ts +85 -0
- package/dist/types/index.d.ts +16 -1
- package/dist/types/models/gemini_llm_connection.d.ts +6 -7
- package/dist/types/models/routed_llm.d.ts +1 -1
- package/dist/types/plugins/debug_logging_plugin.d.ts +157 -0
- package/dist/types/plugins/tool_call_integrity_plugin.d.ts +116 -0
- package/dist/types/runner/in_memory_runner.d.ts +2 -1
- package/dist/types/runner/runner.d.ts +34 -0
- package/dist/types/sessions/state.d.ts +5 -1
- package/dist/types/sessions/vertex_ai_session_service.d.ts +8 -0
- package/dist/types/skills/skill.d.ts +1 -1
- package/dist/types/telemetry/tracing.d.ts +4 -2
- package/dist/types/tools/apihub_tool/apihub_toolset.d.ts +122 -0
- package/dist/types/tools/apihub_tool/clients/apihub_client.d.ts +142 -0
- package/dist/types/tools/apihub_tool/clients/secret_client.d.ts +55 -0
- package/dist/types/tools/apihub_tool/clients/service_account.d.ts +11 -0
- package/dist/types/tools/application_integration_tool/application_integration_toolset.d.ts +86 -0
- package/dist/types/tools/application_integration_tool/clients/cloud_request.d.ts +53 -0
- package/dist/types/tools/application_integration_tool/clients/connections_client.d.ts +215 -0
- package/dist/types/tools/application_integration_tool/clients/integration_client.d.ts +72 -0
- package/dist/types/tools/crewai_tool.d.ts +85 -0
- package/dist/types/tools/example_tool.d.ts +10 -0
- package/dist/types/tools/function_tool.d.ts +32 -0
- package/dist/types/tools/google_api_tool/google_api_tool.d.ts +30 -0
- package/dist/types/tools/google_api_tool/google_api_tool_set.d.ts +78 -0
- package/dist/types/tools/google_api_tool/google_api_tool_sets.d.ts +33 -0
- package/dist/types/tools/google_api_tool/googleapi_to_openapi_converter.d.ts +164 -0
- package/dist/types/tools/google_api_tool/index.d.ts +11 -0
- package/dist/types/tools/langchain_tool.d.ts +103 -0
- package/dist/types/tools/mcp/index.d.ts +3 -0
- package/dist/types/tools/mcp/mcp_session_manager.d.ts +34 -1
- package/dist/types/tools/mcp/mcp_toolset.d.ts +15 -0
- package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +19 -0
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.d.ts +18 -1
- package/dist/types/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.d.ts +2 -1
- package/dist/types/tools/retrieval/base_retrieval_tool.d.ts +15 -0
- package/dist/types/tools/toolbox_tool.d.ts +73 -0
- package/dist/types/utils/env_aware_utils.d.ts +18 -2
- package/dist/types/utils/error_utils.d.ts +7 -0
- package/dist/types/utils/file_utils.d.ts +6 -1
- package/dist/types/utils/gemini_schema_util.d.ts +1 -2
- package/dist/types/utils/json_utils.d.ts +11 -0
- package/dist/types/utils/object_notation_utils.d.ts +7 -0
- package/dist/types/utils/streaming_utils.d.ts +11 -4
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index_web.js +105 -106
- package/dist/web/index_web.js.map +4 -4
- package/package.json +8 -3
package/dist/cjs/common.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(common_exports, {
|
|
|
41
41
|
AuthHandler: () => import_auth_handler.AuthHandler,
|
|
42
42
|
AuthPreprocessor: () => import_auth_preprocessor.AuthPreprocessor,
|
|
43
43
|
AuthProviderRegistry: () => import_auth_provider_registry.AuthProviderRegistry,
|
|
44
|
+
AuthSchemeType: () => import_auth_schemes.AuthSchemeType,
|
|
44
45
|
BaseAgent: () => import_base_agent.BaseAgent,
|
|
45
46
|
BaseCodeExecutor: () => import_base_code_executor.BaseCodeExecutor,
|
|
46
47
|
BaseEnvironment: () => import_base_environment.BaseEnvironment,
|
|
@@ -64,6 +65,7 @@ __export(common_exports, {
|
|
|
64
65
|
ChromeBuiltInLlm: () => import_chrome_prompt_llm.ChromeBuiltInLlm,
|
|
65
66
|
ChromeModelUnavailableError: () => import_chrome_prompt_llm.ChromeModelUnavailableError,
|
|
66
67
|
CodeExecutionLanguage: () => import_code_execution_utils.CodeExecutionLanguage,
|
|
68
|
+
CodeExecutionResponseProcessor: () => import_code_execution_request_processor.CodeExecutionResponseProcessor,
|
|
67
69
|
ConsolidateContextTool: () => import_consolidate_context_tool.ConsolidateContextTool,
|
|
68
70
|
ContentRequestProcessor: () => import_content_request_processor.ContentRequestProcessor,
|
|
69
71
|
Context: () => import_context.Context,
|
|
@@ -71,6 +73,7 @@ __export(common_exports, {
|
|
|
71
73
|
ContextCompactorRequestProcessor: () => import_context_compactor_request_processor.ContextCompactorRequestProcessor,
|
|
72
74
|
CredentialExchangeError: () => import_base_credential_exchanger.CredentialExchangeError,
|
|
73
75
|
CredentialRefresherRegistry: () => import_credential_refresher_registry.CredentialRefresherRegistry,
|
|
76
|
+
CrewaiTool: () => import_crewai_tool.CrewaiTool,
|
|
74
77
|
DEFAULT_ROUTE: () => import_workflow.DEFAULT_ROUTE,
|
|
75
78
|
ENTERPRISE_WEB_SEARCH: () => import_enterprise_web_search_tool.ENTERPRISE_WEB_SEARCH,
|
|
76
79
|
EXIT_LOOP: () => import_exit_loop_tool.EXIT_LOOP,
|
|
@@ -96,6 +99,7 @@ __export(common_exports, {
|
|
|
96
99
|
GoogleSearchTool: () => import_google_search_tool.GoogleSearchTool,
|
|
97
100
|
Graph: () => import_workflow.Graph,
|
|
98
101
|
INTERACTIONS_REQUEST_PROCESSOR: () => import_interactions_request_processor.INTERACTIONS_REQUEST_PROCESSOR,
|
|
102
|
+
INTERNAL_METADATA_PREFIX: () => import_internal_metadata.INTERNAL_METADATA_PREFIX,
|
|
99
103
|
InMemoryArtifactService: () => import_in_memory_artifact_service.InMemoryArtifactService,
|
|
100
104
|
InMemoryCredentialService: () => import_in_memory_credential_service.InMemoryCredentialService,
|
|
101
105
|
InMemoryMemoryService: () => import_in_memory_memory_service.InMemoryMemoryService,
|
|
@@ -110,10 +114,13 @@ __export(common_exports, {
|
|
|
110
114
|
LLMRegistry: () => import_registry.LLMRegistry,
|
|
111
115
|
LOAD_ARTIFACTS: () => import_load_artifacts_tool.LOAD_ARTIFACTS,
|
|
112
116
|
LOAD_MEMORY: () => import_load_memory_tool.LOAD_MEMORY,
|
|
117
|
+
LangGraphAgent: () => import_langgraph_agent.LangGraphAgent,
|
|
118
|
+
LangchainTool: () => import_langchain_tool.LangchainTool,
|
|
113
119
|
ListSkillsTool: () => import_list_skills_tool.ListSkillsTool,
|
|
114
120
|
LiveRequestQueue: () => import_live_request_queue.LiveRequestQueue,
|
|
115
121
|
LlamaIndexRetrieval: () => import_llama_index_retrieval.LlamaIndexRetrieval,
|
|
116
122
|
LlmAgent: () => import_llm_agent.LlmAgent,
|
|
123
|
+
LlmCallsLimitExceededError: () => import_invocation_context.LlmCallsLimitExceededError,
|
|
117
124
|
LlmSummarizer: () => import_llm_summarizer.LlmSummarizer,
|
|
118
125
|
LoadArtifactsTool: () => import_load_artifacts_tool.LoadArtifactsTool,
|
|
119
126
|
LoadMemoryTool: () => import_load_memory_tool.LoadMemoryTool,
|
|
@@ -144,9 +151,11 @@ __export(common_exports, {
|
|
|
144
151
|
REQUEST_CREDENTIAL_FUNCTION_CALL_NAME: () => import_functions.REQUEST_CREDENTIAL_FUNCTION_CALL_NAME,
|
|
145
152
|
REQUEST_INPUT_FUNCTION_CALL_NAME: () => import_functions.REQUEST_INPUT_FUNCTION_CALL_NAME,
|
|
146
153
|
RESERVED_TOOL_CALL_ERROR_TYPE: () => import_reflect_retry_model_plugin.RESERVED_TOOL_CALL_ERROR_TYPE,
|
|
154
|
+
RESTORED_EVENT_KEY: () => import_internal_metadata.RESTORED_EVENT_KEY,
|
|
147
155
|
ReadonlyContext: () => import_readonly_context.ReadonlyContext,
|
|
148
156
|
ReflectAndRetryModelPlugin: () => import_reflect_retry_model_plugin.ReflectAndRetryModelPlugin,
|
|
149
157
|
ReflectAndRetryToolPlugin: () => import_reflect_retry_tool_plugin.ReflectAndRetryToolPlugin,
|
|
158
|
+
RemoteAgent: () => import_remote_agent.RemoteAgent,
|
|
150
159
|
RequestInput: () => import_workflow.RequestInput,
|
|
151
160
|
RoutedAgent: () => import_routed_agent.RoutedAgent,
|
|
152
161
|
RoutedLlm: () => import_routed_llm.RoutedLlm,
|
|
@@ -164,11 +173,14 @@ __export(common_exports, {
|
|
|
164
173
|
StreamingMode: () => import_run_config.StreamingMode,
|
|
165
174
|
Task: () => import_task.Task,
|
|
166
175
|
TokenBasedContextCompactor: () => import_token_based_context_compactor.TokenBasedContextCompactor,
|
|
176
|
+
ToolCallIntegrityError: () => import_tool_call_integrity_plugin.ToolCallIntegrityError,
|
|
177
|
+
ToolCallIntegrityPlugin: () => import_tool_call_integrity_plugin.ToolCallIntegrityPlugin,
|
|
167
178
|
ToolConfirmation: () => import_tool_confirmation.ToolConfirmation,
|
|
168
179
|
ToolContext: () => import_tool_context.ToolContext,
|
|
169
180
|
ToolErrorType: () => import_tool_execution_error.ToolErrorType,
|
|
170
181
|
ToolExecutionError: () => import_tool_execution_error.ToolExecutionError,
|
|
171
182
|
ToolNode: () => import_workflow.ToolNode,
|
|
183
|
+
ToolboxTool: () => import_toolbox_tool.ToolboxTool,
|
|
172
184
|
TrackingScope: () => import_reflect_retry_utils.TrackingScope,
|
|
173
185
|
TrajectoryThoughtPruningCompactor: () => import_trajectory_thought_pruning_compactor.TrajectoryThoughtPruningCompactor,
|
|
174
186
|
TruncatingContextCompactor: () => import_truncating_context_compactor.TruncatingContextCompactor,
|
|
@@ -181,13 +193,21 @@ __export(common_exports, {
|
|
|
181
193
|
WebMCPToolset: () => import_webmcp_toolset.WebMCPToolset,
|
|
182
194
|
Workflow: () => import_workflow.Workflow,
|
|
183
195
|
WorkflowNode: () => import_workflow.WorkflowNode,
|
|
196
|
+
appendInstructions: () => import_llm_request.appendInstructions,
|
|
184
197
|
asRunnableRoot: () => import_workflow.asRunnableRoot,
|
|
198
|
+
buildFunctionDeclarationForLangchain: () => import_function_tool2.buildFunctionDeclarationForLangchain,
|
|
199
|
+
buildFunctionDeclarationForParamsForCrewai: () => import_function_tool2.buildFunctionDeclarationForParamsForCrewai,
|
|
200
|
+
buildFunctionDeclarationUtil: () => import_function_tool2.buildFunctionDeclarationUtil,
|
|
185
201
|
commonPrefixOf: () => import_workflow.commonPrefixOf,
|
|
202
|
+
convertSessionToEvalFormat: () => import_evals.convertSessionToEvalFormat,
|
|
203
|
+
createEmptyState: () => import_evals.createEmptyState,
|
|
186
204
|
createEvent: () => import_event.createEvent,
|
|
187
205
|
createEventActions: () => import_event_actions.createEventActions,
|
|
206
|
+
createLlmResponse: () => import_llm_response.createLlmResponse,
|
|
188
207
|
createNodeErrorEvent: () => import_workflow.createNodeErrorEvent,
|
|
189
208
|
createNodeState: () => import_workflow.createNodeState,
|
|
190
209
|
createResumabilityConfig: () => import_resumability_config.createResumabilityConfig,
|
|
210
|
+
createRunConfig: () => import_run_config.createRunConfig,
|
|
191
211
|
createSession: () => import_session.createSession,
|
|
192
212
|
createSubBranch: () => import_workflow.createSubBranch,
|
|
193
213
|
determineAgentForResumption: () => import_runner.determineAgentForResumption,
|
|
@@ -196,16 +216,20 @@ __export(common_exports, {
|
|
|
196
216
|
findMatchingFunctionCall: () => import_functions.findMatchingFunctionCall,
|
|
197
217
|
functionsExportedForTestingOnly: () => import_functions.functionsExportedForTestingOnly,
|
|
198
218
|
geminiInitParams: () => import_google_llm.geminiInitParams,
|
|
219
|
+
genaiSchemaToJsonSchema: () => import_genai_schema_to_json.genaiSchemaToJsonSchema,
|
|
199
220
|
generateClientFunctionCallId: () => import_event.generateClientFunctionCallId,
|
|
200
221
|
getAskUserConfirmationFunctionCalls: () => import_security_plugin.getAskUserConfirmationFunctionCalls,
|
|
201
222
|
getClientLabels: () => import_client_labels.getClientLabels,
|
|
202
223
|
getFunctionCalls: () => import_event.getFunctionCalls,
|
|
203
224
|
getFunctionResponses: () => import_event.getFunctionResponses,
|
|
225
|
+
getLastHumanMessages: () => import_langgraph_agent.getLastHumanMessages,
|
|
204
226
|
getLogger: () => import_logger.getLogger,
|
|
205
227
|
getModelContext: () => import_webmcp_types.getModelContext,
|
|
228
|
+
getOAuthGrantTypeFromFlow: () => import_auth_schemes.getOAuthGrantTypeFromFlow,
|
|
206
229
|
getPendingUserInputRequests: () => import_user_input_request.getPendingUserInputRequests,
|
|
207
230
|
getUserChoiceTool: () => import_get_user_choice_tool.getUserChoiceTool,
|
|
208
231
|
getUserInputRequests: () => import_user_input_request.getUserInputRequests,
|
|
232
|
+
handleFunctionCallsLive: () => import_functions.handleFunctionCallsLive,
|
|
209
233
|
hasThoughts: () => import_event.hasThoughts,
|
|
210
234
|
hasTrailingCodeExecutionResult: () => import_event.hasTrailingCodeExecutionResult,
|
|
211
235
|
isAgentTool: () => import_agent_tool.isAgentTool,
|
|
@@ -215,10 +239,12 @@ __export(common_exports, {
|
|
|
215
239
|
isBaseExampleProvider: () => import_base_example_provider.isBaseExampleProvider,
|
|
216
240
|
isBaseLlm: () => import_base_llm.isBaseLlm,
|
|
217
241
|
isBasePlanner: () => import_base_planner.isBasePlanner,
|
|
242
|
+
isBaseRetrievalTool: () => import_base_retrieval_tool2.isBaseRetrievalTool,
|
|
218
243
|
isBaseTool: () => import_base_tool.isBaseTool,
|
|
219
244
|
isBaseToolset: () => import_base_toolset.isBaseToolset,
|
|
220
245
|
isBuiltInPlanner: () => import_built_in_planner.isBuiltInPlanner,
|
|
221
246
|
isCompactedEvent: () => import_compacted_event.isCompactedEvent,
|
|
247
|
+
isCrewaiTool: () => import_crewai_tool.isCrewaiTool,
|
|
222
248
|
isFinalResponse: () => import_event.isFinalResponse,
|
|
223
249
|
isFunctionTool: () => import_function_tool.isFunctionTool,
|
|
224
250
|
isGemini2OrAbove: () => import_model_name.isGemini2OrAbove,
|
|
@@ -226,7 +252,10 @@ __export(common_exports, {
|
|
|
226
252
|
isGemini3xFlashLive: () => import_model_name.isGemini3xFlashLive,
|
|
227
253
|
isGemini3xLive: () => import_model_name.isGemini3xLive,
|
|
228
254
|
isIntentMismatchError: () => import_tool_confirmation.isIntentMismatchError,
|
|
255
|
+
isLangGraphAgent: () => import_langgraph_agent.isLangGraphAgent,
|
|
256
|
+
isLangchainTool: () => import_langchain_tool.isLangchainTool,
|
|
229
257
|
isLlmAgent: () => import_llm_agent.isLlmAgent,
|
|
258
|
+
isLlmCallsLimitExceededError: () => import_invocation_context.isLlmCallsLimitExceededError,
|
|
230
259
|
isLoopAgent: () => import_loop_agent.isLoopAgent,
|
|
231
260
|
isNodeErrorEvent: () => import_workflow.isNodeErrorEvent,
|
|
232
261
|
isNodeReportedError: () => import_workflow.isNodeReportedError,
|
|
@@ -234,6 +263,7 @@ __export(common_exports, {
|
|
|
234
263
|
isNodeState: () => import_workflow.isNodeState,
|
|
235
264
|
isNodeTimeoutError: () => import_workflow.isNodeTimeoutError,
|
|
236
265
|
isParallelAgent: () => import_parallel_agent.isParallelAgent,
|
|
266
|
+
isRemoteAgent: () => import_remote_agent.isRemoteAgent,
|
|
237
267
|
isRequestInput: () => import_workflow.isRequestInput,
|
|
238
268
|
isRoutableLlmAgent: () => import_runner.isRoutableLlmAgent,
|
|
239
269
|
isRoutedAgent: () => import_routed_agent.isRoutedAgent,
|
|
@@ -244,14 +274,19 @@ __export(common_exports, {
|
|
|
244
274
|
isSessionArtifactService: () => import_session_artifact_service.isSessionArtifactService,
|
|
245
275
|
isStateSchemaError: () => import_state.isStateSchemaError,
|
|
246
276
|
isToolNotFound: () => import_functions.isToolNotFound,
|
|
277
|
+
isToolboxTool: () => import_toolbox_tool.isToolboxTool,
|
|
247
278
|
isWebMCPSupported: () => import_webmcp_types.isWebMCPSupported,
|
|
248
279
|
isWorkflow: () => import_workflow.isWorkflow,
|
|
249
280
|
logger: () => import_logger.logger,
|
|
281
|
+
markRestored: () => import_internal_metadata.markRestored,
|
|
250
282
|
node: () => import_workflow.node,
|
|
251
283
|
normalizeRetryExceptions: () => import_workflow.normalizeRetryExceptions,
|
|
252
284
|
populateClientFunctionCallId: () => import_event.populateClientFunctionCallId,
|
|
253
285
|
prepareRetryConfig: () => import_workflow.prepareRetryConfig,
|
|
254
286
|
pruneThoughts: () => import_event.pruneThoughts,
|
|
287
|
+
publicEvent: () => import_internal_metadata.publicEvent,
|
|
288
|
+
publicMetadata: () => import_internal_metadata.publicMetadata,
|
|
289
|
+
publicSession: () => import_internal_metadata.publicSession,
|
|
255
290
|
renameReservedKeywords: () => import_case_utils.renameReservedKeywords,
|
|
256
291
|
requestInputTool: () => import_request_input_tool.requestInputTool,
|
|
257
292
|
requireAgent: () => import_invocation_context.requireAgent,
|
|
@@ -263,6 +298,8 @@ __export(common_exports, {
|
|
|
263
298
|
setLogger: () => import_logger.setLogger,
|
|
264
299
|
stringifyContent: () => import_event.stringifyContent,
|
|
265
300
|
stripAdkIdentityPreamble: () => import_chrome_prompt_llm.stripAdkIdentityPreamble,
|
|
301
|
+
toGeminiSchema: () => import_gemini_schema_util.toGeminiSchema,
|
|
302
|
+
toJsonSchema: () => import_schema.toJsonSchema,
|
|
266
303
|
toSnakeCaseName: () => import_case_utils.toSnakeCaseName,
|
|
267
304
|
toStructuredEvents: () => import_structured_events.toStructuredEvents,
|
|
268
305
|
validateAppName: () => import_app.validateAppName,
|
|
@@ -275,16 +312,19 @@ var import_base_agent = require("./agents/base_agent.js");
|
|
|
275
312
|
var import_context = require("./agents/context.js");
|
|
276
313
|
var import_functions = require("./agents/functions.js");
|
|
277
314
|
var import_invocation_context = require("./agents/invocation_context.js");
|
|
315
|
+
var import_langgraph_agent = require("./agents/langgraph_agent.js");
|
|
278
316
|
var import_live_request_queue = require("./agents/live_request_queue.js");
|
|
279
317
|
var import_llm_agent = require("./agents/llm_agent.js");
|
|
280
318
|
var import_loop_agent = require("./agents/loop_agent.js");
|
|
281
319
|
var import_parallel_agent = require("./agents/parallel_agent.js");
|
|
282
320
|
var import_agent_transfer_llm_request_processor = require("./agents/processors/agent_transfer_llm_request_processor.js");
|
|
283
321
|
var import_base_llm_processor = require("./agents/processors/base_llm_processor.js");
|
|
322
|
+
var import_code_execution_request_processor = require("./agents/processors/code_execution_request_processor.js");
|
|
284
323
|
var import_content_request_processor = require("./agents/processors/content_request_processor.js");
|
|
285
324
|
var import_context_compactor_request_processor = require("./agents/processors/context_compactor_request_processor.js");
|
|
286
325
|
var import_interactions_request_processor = require("./agents/processors/interactions_request_processor.js");
|
|
287
326
|
var import_readonly_context = require("./agents/readonly_context.js");
|
|
327
|
+
var import_remote_agent = require("./agents/remote_agent.js");
|
|
288
328
|
var import_routed_agent = require("./agents/routed_agent.js");
|
|
289
329
|
var import_run_config = require("./agents/run_config.js");
|
|
290
330
|
var import_sequential_agent = require("./agents/sequential_agent.js");
|
|
@@ -322,6 +362,7 @@ var import_tool_execution_error = require("./errors/tool_execution_error.js");
|
|
|
322
362
|
var import_compacted_event = require("./events/compacted_event.js");
|
|
323
363
|
var import_event = require("./events/event.js");
|
|
324
364
|
var import_event_actions = require("./events/event_actions.js");
|
|
365
|
+
var import_internal_metadata = require("./events/internal_metadata.js");
|
|
325
366
|
var import_structured_events = require("./events/structured_events.js");
|
|
326
367
|
var import_base_example_provider = require("./examples/base_example_provider.js");
|
|
327
368
|
var import_example = require("./examples/example.js");
|
|
@@ -330,6 +371,8 @@ var import_apigee_llm = require("./models/apigee_llm.js");
|
|
|
330
371
|
var import_base_llm = require("./models/base_llm.js");
|
|
331
372
|
var import_chrome_prompt_llm = require("./models/chrome_prompt_llm.js");
|
|
332
373
|
var import_google_llm = require("./models/google_llm.js");
|
|
374
|
+
var import_llm_request = require("./models/llm_request.js");
|
|
375
|
+
var import_llm_response = require("./models/llm_response.js");
|
|
333
376
|
var import_registry = require("./models/registry.js");
|
|
334
377
|
var import_routed_llm = require("./models/routed_llm.js");
|
|
335
378
|
var import_base_planner = require("./planners/base_planner.js");
|
|
@@ -343,6 +386,7 @@ var import_plugin_manager = require("./plugins/plugin_manager.js");
|
|
|
343
386
|
var import_reflect_retry_model_plugin = require("./plugins/reflect_retry_model_plugin.js");
|
|
344
387
|
var import_reflect_retry_tool_plugin = require("./plugins/reflect_retry_tool_plugin.js");
|
|
345
388
|
var import_security_plugin = require("./plugins/security_plugin.js");
|
|
389
|
+
var import_tool_call_integrity_plugin = require("./plugins/tool_call_integrity_plugin.js");
|
|
346
390
|
var import_in_memory_runner = require("./runner/in_memory_runner.js");
|
|
347
391
|
var import_runner = require("./runner/runner.js");
|
|
348
392
|
var import_base_session_service = require("./sessions/base_session_service.js");
|
|
@@ -381,8 +425,11 @@ var import_webmcp_types = require("./tools/webmcp/webmcp_types.js");
|
|
|
381
425
|
var import_async_queue = require("./utils/async_queue.js");
|
|
382
426
|
var import_case_utils = require("./utils/case_utils.js");
|
|
383
427
|
var import_client_labels = require("./utils/client_labels.js");
|
|
428
|
+
var import_gemini_schema_util = require("./utils/gemini_schema_util.js");
|
|
429
|
+
var import_genai_schema_to_json = require("./utils/genai_schema_to_json.js");
|
|
384
430
|
var import_logger = require("./utils/logger.js");
|
|
385
431
|
var import_model_name = require("./utils/model_name.js");
|
|
432
|
+
var import_schema = require("./utils/schema.js");
|
|
386
433
|
var import_simple_zod_to_json = require("./utils/simple_zod_to_json.js");
|
|
387
434
|
var import_task = require("./utils/task.js");
|
|
388
435
|
var import_variant_utils = require("./utils/variant_utils.js");
|
|
@@ -402,6 +449,12 @@ __reExport(common_exports, require("./features/feature_registry.js"), module.exp
|
|
|
402
449
|
__reExport(common_exports, require("./memory/base_memory_service.js"), module.exports);
|
|
403
450
|
__reExport(common_exports, require("./sessions/base_session_service.js"), module.exports);
|
|
404
451
|
__reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
452
|
+
var import_evals = require("./cli/utils/evals.js");
|
|
453
|
+
var import_crewai_tool = require("./tools/crewai_tool.js");
|
|
454
|
+
var import_function_tool2 = require("./tools/function_tool.js");
|
|
455
|
+
var import_langchain_tool = require("./tools/langchain_tool.js");
|
|
456
|
+
var import_base_retrieval_tool2 = require("./tools/retrieval/base_retrieval_tool.js");
|
|
457
|
+
var import_toolbox_tool = require("./tools/toolbox_tool.js");
|
|
405
458
|
/**
|
|
406
459
|
* @license
|
|
407
460
|
* Copyright 2025 Google LLC
|
|
@@ -425,6 +478,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
425
478
|
AuthHandler,
|
|
426
479
|
AuthPreprocessor,
|
|
427
480
|
AuthProviderRegistry,
|
|
481
|
+
AuthSchemeType,
|
|
428
482
|
BaseAgent,
|
|
429
483
|
BaseCodeExecutor,
|
|
430
484
|
BaseEnvironment,
|
|
@@ -448,6 +502,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
448
502
|
ChromeBuiltInLlm,
|
|
449
503
|
ChromeModelUnavailableError,
|
|
450
504
|
CodeExecutionLanguage,
|
|
505
|
+
CodeExecutionResponseProcessor,
|
|
451
506
|
ConsolidateContextTool,
|
|
452
507
|
ContentRequestProcessor,
|
|
453
508
|
Context,
|
|
@@ -455,6 +510,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
455
510
|
ContextCompactorRequestProcessor,
|
|
456
511
|
CredentialExchangeError,
|
|
457
512
|
CredentialRefresherRegistry,
|
|
513
|
+
CrewaiTool,
|
|
458
514
|
DEFAULT_ROUTE,
|
|
459
515
|
ENTERPRISE_WEB_SEARCH,
|
|
460
516
|
EXIT_LOOP,
|
|
@@ -480,6 +536,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
480
536
|
GoogleSearchTool,
|
|
481
537
|
Graph,
|
|
482
538
|
INTERACTIONS_REQUEST_PROCESSOR,
|
|
539
|
+
INTERNAL_METADATA_PREFIX,
|
|
483
540
|
InMemoryArtifactService,
|
|
484
541
|
InMemoryCredentialService,
|
|
485
542
|
InMemoryMemoryService,
|
|
@@ -494,10 +551,13 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
494
551
|
LLMRegistry,
|
|
495
552
|
LOAD_ARTIFACTS,
|
|
496
553
|
LOAD_MEMORY,
|
|
554
|
+
LangGraphAgent,
|
|
555
|
+
LangchainTool,
|
|
497
556
|
ListSkillsTool,
|
|
498
557
|
LiveRequestQueue,
|
|
499
558
|
LlamaIndexRetrieval,
|
|
500
559
|
LlmAgent,
|
|
560
|
+
LlmCallsLimitExceededError,
|
|
501
561
|
LlmSummarizer,
|
|
502
562
|
LoadArtifactsTool,
|
|
503
563
|
LoadMemoryTool,
|
|
@@ -528,9 +588,11 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
528
588
|
REQUEST_CREDENTIAL_FUNCTION_CALL_NAME,
|
|
529
589
|
REQUEST_INPUT_FUNCTION_CALL_NAME,
|
|
530
590
|
RESERVED_TOOL_CALL_ERROR_TYPE,
|
|
591
|
+
RESTORED_EVENT_KEY,
|
|
531
592
|
ReadonlyContext,
|
|
532
593
|
ReflectAndRetryModelPlugin,
|
|
533
594
|
ReflectAndRetryToolPlugin,
|
|
595
|
+
RemoteAgent,
|
|
534
596
|
RequestInput,
|
|
535
597
|
RoutedAgent,
|
|
536
598
|
RoutedLlm,
|
|
@@ -548,11 +610,14 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
548
610
|
StreamingMode,
|
|
549
611
|
Task,
|
|
550
612
|
TokenBasedContextCompactor,
|
|
613
|
+
ToolCallIntegrityError,
|
|
614
|
+
ToolCallIntegrityPlugin,
|
|
551
615
|
ToolConfirmation,
|
|
552
616
|
ToolContext,
|
|
553
617
|
ToolErrorType,
|
|
554
618
|
ToolExecutionError,
|
|
555
619
|
ToolNode,
|
|
620
|
+
ToolboxTool,
|
|
556
621
|
TrackingScope,
|
|
557
622
|
TrajectoryThoughtPruningCompactor,
|
|
558
623
|
TruncatingContextCompactor,
|
|
@@ -565,13 +630,21 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
565
630
|
WebMCPToolset,
|
|
566
631
|
Workflow,
|
|
567
632
|
WorkflowNode,
|
|
633
|
+
appendInstructions,
|
|
568
634
|
asRunnableRoot,
|
|
635
|
+
buildFunctionDeclarationForLangchain,
|
|
636
|
+
buildFunctionDeclarationForParamsForCrewai,
|
|
637
|
+
buildFunctionDeclarationUtil,
|
|
569
638
|
commonPrefixOf,
|
|
639
|
+
convertSessionToEvalFormat,
|
|
640
|
+
createEmptyState,
|
|
570
641
|
createEvent,
|
|
571
642
|
createEventActions,
|
|
643
|
+
createLlmResponse,
|
|
572
644
|
createNodeErrorEvent,
|
|
573
645
|
createNodeState,
|
|
574
646
|
createResumabilityConfig,
|
|
647
|
+
createRunConfig,
|
|
575
648
|
createSession,
|
|
576
649
|
createSubBranch,
|
|
577
650
|
determineAgentForResumption,
|
|
@@ -580,16 +653,20 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
580
653
|
findMatchingFunctionCall,
|
|
581
654
|
functionsExportedForTestingOnly,
|
|
582
655
|
geminiInitParams,
|
|
656
|
+
genaiSchemaToJsonSchema,
|
|
583
657
|
generateClientFunctionCallId,
|
|
584
658
|
getAskUserConfirmationFunctionCalls,
|
|
585
659
|
getClientLabels,
|
|
586
660
|
getFunctionCalls,
|
|
587
661
|
getFunctionResponses,
|
|
662
|
+
getLastHumanMessages,
|
|
588
663
|
getLogger,
|
|
589
664
|
getModelContext,
|
|
665
|
+
getOAuthGrantTypeFromFlow,
|
|
590
666
|
getPendingUserInputRequests,
|
|
591
667
|
getUserChoiceTool,
|
|
592
668
|
getUserInputRequests,
|
|
669
|
+
handleFunctionCallsLive,
|
|
593
670
|
hasThoughts,
|
|
594
671
|
hasTrailingCodeExecutionResult,
|
|
595
672
|
isAgentTool,
|
|
@@ -599,10 +676,12 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
599
676
|
isBaseExampleProvider,
|
|
600
677
|
isBaseLlm,
|
|
601
678
|
isBasePlanner,
|
|
679
|
+
isBaseRetrievalTool,
|
|
602
680
|
isBaseTool,
|
|
603
681
|
isBaseToolset,
|
|
604
682
|
isBuiltInPlanner,
|
|
605
683
|
isCompactedEvent,
|
|
684
|
+
isCrewaiTool,
|
|
606
685
|
isFinalResponse,
|
|
607
686
|
isFunctionTool,
|
|
608
687
|
isGemini2OrAbove,
|
|
@@ -610,7 +689,10 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
610
689
|
isGemini3xFlashLive,
|
|
611
690
|
isGemini3xLive,
|
|
612
691
|
isIntentMismatchError,
|
|
692
|
+
isLangGraphAgent,
|
|
693
|
+
isLangchainTool,
|
|
613
694
|
isLlmAgent,
|
|
695
|
+
isLlmCallsLimitExceededError,
|
|
614
696
|
isLoopAgent,
|
|
615
697
|
isNodeErrorEvent,
|
|
616
698
|
isNodeReportedError,
|
|
@@ -618,6 +700,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
618
700
|
isNodeState,
|
|
619
701
|
isNodeTimeoutError,
|
|
620
702
|
isParallelAgent,
|
|
703
|
+
isRemoteAgent,
|
|
621
704
|
isRequestInput,
|
|
622
705
|
isRoutableLlmAgent,
|
|
623
706
|
isRoutedAgent,
|
|
@@ -628,14 +711,19 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
628
711
|
isSessionArtifactService,
|
|
629
712
|
isStateSchemaError,
|
|
630
713
|
isToolNotFound,
|
|
714
|
+
isToolboxTool,
|
|
631
715
|
isWebMCPSupported,
|
|
632
716
|
isWorkflow,
|
|
633
717
|
logger,
|
|
718
|
+
markRestored,
|
|
634
719
|
node,
|
|
635
720
|
normalizeRetryExceptions,
|
|
636
721
|
populateClientFunctionCallId,
|
|
637
722
|
prepareRetryConfig,
|
|
638
723
|
pruneThoughts,
|
|
724
|
+
publicEvent,
|
|
725
|
+
publicMetadata,
|
|
726
|
+
publicSession,
|
|
639
727
|
renameReservedKeywords,
|
|
640
728
|
requestInputTool,
|
|
641
729
|
requireAgent,
|
|
@@ -647,6 +735,8 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
647
735
|
setLogger,
|
|
648
736
|
stringifyContent,
|
|
649
737
|
stripAdkIdentityPreamble,
|
|
738
|
+
toGeminiSchema,
|
|
739
|
+
toJsonSchema,
|
|
650
740
|
toSnakeCaseName,
|
|
651
741
|
toStructuredEvents,
|
|
652
742
|
validateAppName,
|
|
@@ -53,7 +53,7 @@ const _LlmSummarizer = class _LlmSummarizer {
|
|
|
53
53
|
* @throws {Error} If `events` is empty or the LLM returns no content.
|
|
54
54
|
*/
|
|
55
55
|
async summarize(events) {
|
|
56
|
-
var _a, _b
|
|
56
|
+
var _a, _b;
|
|
57
57
|
if (events.length === 0) {
|
|
58
58
|
throw new Error("Cannot summarize an empty list of events.");
|
|
59
59
|
}
|
|
@@ -75,18 +75,20 @@ ${formattedEvents}`;
|
|
|
75
75
|
toolsDict: {},
|
|
76
76
|
liveConnectConfig: {}
|
|
77
77
|
};
|
|
78
|
-
const responseGen = this.llm.generateContentAsync(request, false);
|
|
79
78
|
let compactedContent = "";
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
for await (const response of this.llm.generateContentAsync(
|
|
80
|
+
request,
|
|
81
|
+
false
|
|
82
|
+
)) {
|
|
83
|
+
for (const part of (_b = (_a = response.content) == null ? void 0 : _a.parts) != null ? _b : []) {
|
|
84
|
+
if (part.text && !part.thought) {
|
|
85
|
+
compactedContent += part.text;
|
|
86
|
+
}
|
|
88
87
|
}
|
|
89
88
|
}
|
|
89
|
+
if (!compactedContent) {
|
|
90
|
+
throw new Error("LLM failed to return a valid summary.");
|
|
91
|
+
}
|
|
90
92
|
return (0, import_compacted_event.createCompactedEvent)({
|
|
91
93
|
author: "system",
|
|
92
94
|
content: {
|
|
@@ -109,7 +109,8 @@ let TokenBasedContextCompactor = _TokenBasedContextCompactor;
|
|
|
109
109
|
function latestPromptTokenCount(activeEvents, invocationContext) {
|
|
110
110
|
var _a;
|
|
111
111
|
for (let i = activeEvents.length - 1; i >= 0; i--) {
|
|
112
|
-
const
|
|
112
|
+
const usage = activeEvents[i].usageMetadata;
|
|
113
|
+
const count = (_a = usage == null ? void 0 : usage.initialPromptTokenCount) != null ? _a : usage == null ? void 0 : usage.promptTokenCount;
|
|
113
114
|
if (count !== void 0) {
|
|
114
115
|
return count;
|
|
115
116
|
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var abort_events_exports = {};
|
|
27
|
+
__export(abort_events_exports, {
|
|
28
|
+
ABORT_MESSAGE: () => ABORT_MESSAGE,
|
|
29
|
+
INVOCATION_ABORTED: () => INVOCATION_ABORTED,
|
|
30
|
+
buildAbortEvents: () => buildAbortEvents,
|
|
31
|
+
isAbortEvent: () => isAbortEvent
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(abort_events_exports);
|
|
34
|
+
var import_event = require("./event.js");
|
|
35
|
+
/**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2026 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
39
|
+
*/
|
|
40
|
+
const INVOCATION_ABORTED = "INVOCATION_ABORTED";
|
|
41
|
+
const ABORT_MESSAGE = "Invocation was aborted by client.";
|
|
42
|
+
function isAbortEvent(event) {
|
|
43
|
+
return event.errorCode === INVOCATION_ABORTED;
|
|
44
|
+
}
|
|
45
|
+
__name(isAbortEvent, "isAbortEvent");
|
|
46
|
+
function isPausedTaskReply(event) {
|
|
47
|
+
return Boolean(event.isolationScope) && event.author !== "user" && (0, import_event.isFinalResponse)(event);
|
|
48
|
+
}
|
|
49
|
+
__name(isPausedTaskReply, "isPausedTaskReply");
|
|
50
|
+
function buildAbortEvents({
|
|
51
|
+
events,
|
|
52
|
+
invocationId,
|
|
53
|
+
rootAgentName,
|
|
54
|
+
branch
|
|
55
|
+
}) {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
const invocationEvents = events.filter(
|
|
58
|
+
(e) => e.invocationId === invocationId
|
|
59
|
+
);
|
|
60
|
+
if (invocationEvents.length > 0 && isPausedTaskReply(invocationEvents[invocationEvents.length - 1])) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
const answeredCallIds = /* @__PURE__ */ new Set();
|
|
64
|
+
for (const event of invocationEvents) {
|
|
65
|
+
for (const fr of (0, import_event.getFunctionResponses)(event)) {
|
|
66
|
+
if (fr.id) {
|
|
67
|
+
answeredCallIds.add(fr.id);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const groupedCalls = /* @__PURE__ */ new Map();
|
|
72
|
+
for (const event of invocationEvents) {
|
|
73
|
+
for (const fc of (0, import_event.getFunctionCalls)(event)) {
|
|
74
|
+
if (!fc.id || answeredCallIds.has(fc.id)) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const callBranch = event.branch || branch;
|
|
78
|
+
const key = JSON.stringify([
|
|
79
|
+
(_a = event.author) != null ? _a : null,
|
|
80
|
+
callBranch != null ? callBranch : null,
|
|
81
|
+
(_b = event.isolationScope) != null ? _b : null
|
|
82
|
+
]);
|
|
83
|
+
let group = groupedCalls.get(key);
|
|
84
|
+
if (!group) {
|
|
85
|
+
group = {
|
|
86
|
+
author: event.author,
|
|
87
|
+
branch: callBranch,
|
|
88
|
+
isolationScope: event.isolationScope,
|
|
89
|
+
calls: []
|
|
90
|
+
};
|
|
91
|
+
groupedCalls.set(key, group);
|
|
92
|
+
}
|
|
93
|
+
group.calls.push(fc);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (groupedCalls.size === 0) {
|
|
97
|
+
return [
|
|
98
|
+
(0, import_event.createEvent)({
|
|
99
|
+
invocationId,
|
|
100
|
+
author: rootAgentName,
|
|
101
|
+
branch,
|
|
102
|
+
errorCode: INVOCATION_ABORTED,
|
|
103
|
+
errorMessage: ABORT_MESSAGE
|
|
104
|
+
})
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
return [...groupedCalls.values()].map(
|
|
108
|
+
(group) => (0, import_event.createEvent)({
|
|
109
|
+
invocationId,
|
|
110
|
+
author: group.author,
|
|
111
|
+
branch: group.branch,
|
|
112
|
+
isolationScope: group.isolationScope,
|
|
113
|
+
content: {
|
|
114
|
+
role: "user",
|
|
115
|
+
parts: group.calls.map((fc) => ({
|
|
116
|
+
functionResponse: {
|
|
117
|
+
id: fc.id,
|
|
118
|
+
name: fc.name,
|
|
119
|
+
response: { error: ABORT_MESSAGE }
|
|
120
|
+
}
|
|
121
|
+
}))
|
|
122
|
+
},
|
|
123
|
+
errorCode: INVOCATION_ABORTED,
|
|
124
|
+
errorMessage: ABORT_MESSAGE
|
|
125
|
+
})
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
__name(buildAbortEvents, "buildAbortEvents");
|
|
129
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
130
|
+
0 && (module.exports = {
|
|
131
|
+
ABORT_MESSAGE,
|
|
132
|
+
INVOCATION_ABORTED,
|
|
133
|
+
buildAbortEvents,
|
|
134
|
+
isAbortEvent
|
|
135
|
+
});
|
package/dist/cjs/events/event.js
CHANGED
|
@@ -132,8 +132,10 @@ function stringifyContent(event) {
|
|
|
132
132
|
__name(stringifyContent, "stringifyContent");
|
|
133
133
|
function getEventTokens(event) {
|
|
134
134
|
var _a;
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
const usage = event.usageMetadata;
|
|
136
|
+
const promptTokenCount = (_a = usage == null ? void 0 : usage.initialPromptTokenCount) != null ? _a : usage == null ? void 0 : usage.promptTokenCount;
|
|
137
|
+
if (promptTokenCount !== void 0) {
|
|
138
|
+
return promptTokenCount;
|
|
137
139
|
}
|
|
138
140
|
const contentStr = stringifyContent(event);
|
|
139
141
|
return Math.ceil(contentStr.length / 4);
|