@google/adk 2.2.1 → 2.4.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.
Files changed (298) hide show
  1. package/dist/cjs/a2a/a2a_remote_agent.js +4 -1
  2. package/dist/cjs/a2a/agent_card.js +102 -26
  3. package/dist/cjs/a2a/agent_to_a2a.js +1 -1
  4. package/dist/cjs/agents/agent_engine_client.js +172 -0
  5. package/dist/cjs/agents/base_agent.js +20 -4
  6. package/dist/cjs/agents/functions.js +227 -25
  7. package/dist/cjs/agents/instructions.js +6 -2
  8. package/dist/cjs/agents/invocation_context.js +26 -4
  9. package/dist/cjs/agents/langgraph_agent.js +152 -0
  10. package/dist/cjs/agents/llm_agent.js +194 -107
  11. package/dist/cjs/agents/processors/basic_llm_request_processor.js +1 -1
  12. package/dist/cjs/agents/processors/code_execution_request_processor.js +18 -6
  13. package/dist/cjs/agents/processors/content_processor_utils.js +38 -10
  14. package/dist/cjs/agents/processors/content_request_processor.js +34 -2
  15. package/dist/cjs/agents/processors/instructions_llm_request_processor.js +1 -1
  16. package/dist/cjs/agents/processors/nl_planning_processor.js +12 -3
  17. package/dist/cjs/artifacts/in_memory_artifact_service.js +14 -0
  18. package/dist/cjs/auth/auth_handler.js +37 -5
  19. package/dist/cjs/auth/auth_schemes.js +9 -0
  20. package/dist/cjs/cli/cli_eval.js +532 -0
  21. package/dist/cjs/cli/utils/envs.js +116 -0
  22. package/dist/cjs/cli/utils/evals.js +137 -0
  23. package/dist/cjs/cli/utils/logs.js +150 -0
  24. package/dist/cjs/code_executors/agent_engine_sandbox_code_executor.js +7 -2
  25. package/dist/cjs/code_executors/code_execution_utils.js +48 -16
  26. package/dist/cjs/code_executors/code_executor_context.js +6 -2
  27. package/dist/cjs/code_executors/container_code_executor.js +27 -16
  28. package/dist/cjs/code_executors/unsafe_local_code_executor.js +6 -1
  29. package/dist/cjs/common.js +61 -0
  30. package/dist/cjs/context/summarizers/llm_summarizer.js +12 -10
  31. package/dist/cjs/context/token_based_context_compactor.js +2 -1
  32. package/dist/cjs/errors/input_validation_error.js +3 -2
  33. package/dist/cjs/events/event.js +4 -2
  34. package/dist/cjs/examples/example_util.js +23 -2
  35. package/dist/cjs/flows/llm_flows/audio_transcriber.js +170 -0
  36. package/dist/cjs/index.js +104 -1
  37. package/dist/cjs/integrations/agent_registry/helpers.js +1 -1
  38. package/dist/cjs/models/gemini_llm_connection.js +16 -8
  39. package/dist/cjs/models/google_llm.js +13 -16
  40. package/dist/cjs/models/llm_response.js +9 -1
  41. package/dist/cjs/models/registry.js +1 -1
  42. package/dist/cjs/models/routed_llm.js +9 -8
  43. package/dist/cjs/planners/plan_re_act_planner.js +1 -1
  44. package/dist/cjs/plugins/base_plugin.js +13 -23
  45. package/dist/cjs/runner/in_memory_runner.js +6 -11
  46. package/dist/cjs/runner/runner.js +105 -33
  47. package/dist/cjs/sessions/base_session_service.js +14 -8
  48. package/dist/cjs/sessions/database_session_service.js +50 -28
  49. package/dist/cjs/sessions/db/operations.js +1 -1
  50. package/dist/cjs/sessions/in_memory_session_service.js +3 -1
  51. package/dist/cjs/sessions/stale_session_error.js +59 -0
  52. package/dist/cjs/sessions/state.js +8 -4
  53. package/dist/cjs/sessions/vertex_ai_session_service.js +34 -15
  54. package/dist/cjs/skills/loader.js +52 -18
  55. package/dist/cjs/telemetry/setup.js +0 -1
  56. package/dist/cjs/telemetry/tracing.js +147 -73
  57. package/dist/cjs/tools/agent_tool.js +44 -0
  58. package/dist/cjs/tools/apihub_tool/apihub_toolset.js +137 -0
  59. package/dist/cjs/tools/apihub_tool/clients/apihub_client.js +272 -0
  60. package/dist/cjs/tools/apihub_tool/clients/secret_client.js +148 -0
  61. package/dist/cjs/tools/apihub_tool/clients/service_account.js +48 -0
  62. package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +263 -0
  63. package/dist/cjs/tools/application_integration_tool/clients/cloud_request.js +133 -0
  64. package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +671 -0
  65. package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +223 -0
  66. package/dist/cjs/tools/application_integration_tool/integration_connector_tool.js +184 -0
  67. package/dist/cjs/tools/example_tool.js +10 -0
  68. package/dist/cjs/tools/function_tool.js +319 -0
  69. package/dist/cjs/tools/google_api_tool/google_api_tool.js +100 -0
  70. package/dist/cjs/tools/google_api_tool/google_api_toolset.js +173 -0
  71. package/dist/cjs/tools/google_api_tool/google_api_toolsets.js +124 -0
  72. package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +440 -0
  73. package/dist/cjs/tools/google_api_tool/index.js +61 -0
  74. package/dist/cjs/tools/load_artifacts_tool.js +12 -6
  75. package/dist/cjs/tools/load_memory_tool.js +12 -10
  76. package/dist/cjs/tools/mcp/index.js +12 -0
  77. package/dist/cjs/tools/mcp/mcp_session_manager.js +25 -0
  78. package/dist/cjs/tools/mcp/mcp_toolset.js +1 -14
  79. package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +1 -2
  80. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +46 -2
  81. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +4 -3
  82. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +94 -10
  83. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
  84. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
  85. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +14 -2
  86. package/dist/cjs/tools/openapi_tool/openapi_toolset.js +7 -13
  87. package/dist/cjs/tools/openapi_tool/rest_api_tool.js +17 -1
  88. package/dist/cjs/tools/retrieval/base_retrieval_tool.js +18 -3
  89. package/dist/cjs/tools/toolbox_toolset.js +174 -0
  90. package/dist/cjs/tools/webmcp/webmcp_toolset.js +1 -14
  91. package/dist/cjs/utils/client_labels.js +19 -2
  92. package/dist/cjs/utils/env_aware_utils.js +6 -8
  93. package/dist/cjs/utils/error_utils.js +11 -11
  94. package/dist/cjs/utils/failover_utils.js +1 -1
  95. package/dist/cjs/utils/file_extension_utils.js +11 -0
  96. package/dist/cjs/utils/file_utils.js +2 -24
  97. package/dist/cjs/utils/gemini_schema_util.js +28 -7
  98. package/dist/cjs/utils/json_utils.js +49 -0
  99. package/dist/cjs/utils/live_connection_utils.js +4 -5
  100. package/dist/cjs/utils/logger_node.js +11 -1
  101. package/dist/cjs/utils/object_notation_utils.js +6 -3
  102. package/dist/cjs/utils/output_schema_utils.js +5 -2
  103. package/dist/cjs/utils/streaming_utils.js +12 -12
  104. package/dist/cjs/utils/task.js +1 -1
  105. package/dist/cjs/version.js +1 -1
  106. package/dist/esm/a2a/a2a_remote_agent.js +4 -1
  107. package/dist/esm/a2a/agent_card.js +103 -27
  108. package/dist/esm/a2a/agent_to_a2a.js +5 -2
  109. package/dist/esm/agents/agent_engine_client.js +144 -0
  110. package/dist/esm/agents/base_agent.js +20 -4
  111. package/dist/esm/agents/functions.js +226 -25
  112. package/dist/esm/agents/instructions.js +6 -2
  113. package/dist/esm/agents/invocation_context.js +24 -4
  114. package/dist/esm/agents/langgraph_agent.js +123 -0
  115. package/dist/esm/agents/llm_agent.js +204 -110
  116. package/dist/esm/agents/processors/basic_llm_request_processor.js +1 -1
  117. package/dist/esm/agents/processors/code_execution_request_processor.js +21 -8
  118. package/dist/esm/agents/processors/content_processor_utils.js +38 -10
  119. package/dist/esm/agents/processors/content_request_processor.js +34 -2
  120. package/dist/esm/agents/processors/instructions_llm_request_processor.js +1 -1
  121. package/dist/esm/agents/processors/nl_planning_processor.js +12 -3
  122. package/dist/esm/artifacts/in_memory_artifact_service.js +14 -0
  123. package/dist/esm/auth/auth_handler.js +37 -5
  124. package/dist/esm/auth/auth_schemes.js +8 -0
  125. package/dist/esm/cli/cli_eval.js +510 -0
  126. package/dist/esm/cli/utils/envs.js +78 -0
  127. package/dist/esm/cli/utils/evals.js +109 -0
  128. package/dist/esm/cli/utils/logs.js +111 -0
  129. package/dist/esm/code_executors/agent_engine_sandbox_code_executor.js +7 -2
  130. package/dist/esm/code_executors/code_execution_utils.js +46 -16
  131. package/dist/esm/code_executors/code_executor_context.js +5 -2
  132. package/dist/esm/code_executors/container_code_executor.js +27 -16
  133. package/dist/esm/code_executors/unsafe_local_code_executor.js +6 -1
  134. package/dist/esm/common.js +65 -4
  135. package/dist/esm/context/summarizers/llm_summarizer.js +12 -10
  136. package/dist/esm/context/token_based_context_compactor.js +2 -1
  137. package/dist/esm/errors/input_validation_error.js +3 -2
  138. package/dist/esm/events/event.js +4 -2
  139. package/dist/esm/examples/example_util.js +21 -1
  140. package/dist/esm/flows/llm_flows/audio_transcriber.js +142 -0
  141. package/dist/esm/index.js +114 -2
  142. package/dist/esm/integrations/agent_registry/helpers.js +1 -1
  143. package/dist/esm/models/gemini_llm_connection.js +16 -8
  144. package/dist/esm/models/google_llm.js +14 -17
  145. package/dist/esm/models/llm_response.js +9 -1
  146. package/dist/esm/models/registry.js +1 -1
  147. package/dist/esm/models/routed_llm.js +9 -8
  148. package/dist/esm/planners/plan_re_act_planner.js +1 -1
  149. package/dist/esm/plugins/base_plugin.js +13 -23
  150. package/dist/esm/runner/in_memory_runner.js +6 -11
  151. package/dist/esm/runner/runner.js +105 -33
  152. package/dist/esm/sessions/base_session_service.js +12 -7
  153. package/dist/esm/sessions/database_session_service.js +49 -28
  154. package/dist/esm/sessions/db/operations.js +1 -1
  155. package/dist/esm/sessions/in_memory_session_service.js +3 -1
  156. package/dist/esm/sessions/stale_session_error.js +31 -0
  157. package/dist/esm/sessions/state.js +8 -4
  158. package/dist/esm/sessions/vertex_ai_session_service.js +34 -15
  159. package/dist/esm/skills/loader.js +51 -17
  160. package/dist/esm/telemetry/setup.js +1 -2
  161. package/dist/esm/telemetry/tracing.js +151 -74
  162. package/dist/esm/tools/agent_tool.js +44 -0
  163. package/dist/esm/tools/apihub_tool/apihub_toolset.js +101 -0
  164. package/dist/esm/tools/apihub_tool/clients/apihub_client.js +244 -0
  165. package/dist/esm/tools/apihub_tool/clients/secret_client.js +132 -0
  166. package/dist/esm/tools/apihub_tool/clients/service_account.js +21 -0
  167. package/dist/esm/tools/application_integration_tool/application_integration_toolset.js +245 -0
  168. package/dist/esm/tools/application_integration_tool/clients/cloud_request.js +103 -0
  169. package/dist/esm/tools/application_integration_tool/clients/connections_client.js +629 -0
  170. package/dist/esm/tools/application_integration_tool/clients/integration_client.js +219 -0
  171. package/dist/esm/tools/application_integration_tool/integration_connector_tool.js +158 -0
  172. package/dist/esm/tools/example_tool.js +13 -1
  173. package/dist/esm/tools/function_tool.js +316 -0
  174. package/dist/esm/tools/google_api_tool/google_api_tool.js +73 -0
  175. package/dist/esm/tools/google_api_tool/google_api_toolset.js +146 -0
  176. package/dist/esm/tools/google_api_tool/google_api_toolsets.js +94 -0
  177. package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +393 -0
  178. package/dist/esm/tools/google_api_tool/index.js +31 -0
  179. package/dist/esm/tools/load_artifacts_tool.js +10 -5
  180. package/dist/esm/tools/load_memory_tool.js +12 -10
  181. package/dist/esm/tools/mcp/index.js +6 -0
  182. package/dist/esm/tools/mcp/mcp_session_manager.js +25 -0
  183. package/dist/esm/tools/mcp/mcp_toolset.js +1 -14
  184. package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +1 -2
  185. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +50 -3
  186. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +4 -3
  187. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +94 -10
  188. package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
  189. package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
  190. package/dist/esm/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +15 -2
  191. package/dist/esm/tools/openapi_tool/openapi_toolset.js +6 -12
  192. package/dist/esm/tools/openapi_tool/rest_api_tool.js +17 -1
  193. package/dist/esm/tools/retrieval/base_retrieval_tool.js +16 -2
  194. package/dist/esm/tools/toolbox_toolset.js +148 -0
  195. package/dist/esm/tools/webmcp/webmcp_toolset.js +1 -14
  196. package/dist/esm/utils/client_labels.js +19 -2
  197. package/dist/esm/utils/env_aware_utils.js +6 -8
  198. package/dist/esm/utils/error_utils.js +9 -10
  199. package/dist/esm/utils/failover_utils.js +1 -1
  200. package/dist/esm/utils/file_extension_utils.js +11 -0
  201. package/dist/esm/utils/file_utils.js +2 -23
  202. package/dist/esm/utils/gemini_schema_util.js +27 -7
  203. package/dist/esm/utils/json_utils.js +21 -0
  204. package/dist/esm/utils/live_connection_utils.js +4 -5
  205. package/dist/esm/utils/logger_node.js +11 -1
  206. package/dist/esm/utils/object_notation_utils.js +4 -2
  207. package/dist/esm/utils/output_schema_utils.js +5 -2
  208. package/dist/esm/utils/streaming_utils.js +11 -11
  209. package/dist/esm/utils/task.js +1 -1
  210. package/dist/esm/version.js +1 -1
  211. package/dist/types/a2a/a2a_remote_agent.d.ts +9 -0
  212. package/dist/types/a2a/agent_card.d.ts +44 -1
  213. package/dist/types/a2a/agent_to_a2a.d.ts +9 -0
  214. package/dist/types/a2a/index.d.ts +1 -0
  215. package/dist/types/agents/agent_engine_client.d.ts +37 -0
  216. package/dist/types/agents/base_agent.d.ts +12 -0
  217. package/dist/types/agents/functions.d.ts +33 -1
  218. package/dist/types/agents/invocation_context.d.ts +20 -1
  219. package/dist/types/agents/langgraph_agent.d.ts +153 -0
  220. package/dist/types/agents/llm_agent.d.ts +5 -1
  221. package/dist/types/agents/processors/content_processor_utils.d.ts +4 -2
  222. package/dist/types/agents/processors/nl_planning_processor.d.ts +2 -1
  223. package/dist/types/auth/auth_handler.d.ts +28 -1
  224. package/dist/types/auth/auth_schemes.d.ts +13 -0
  225. package/dist/types/cli/cli_eval.d.ts +173 -0
  226. package/dist/types/cli/utils/envs.d.ts +23 -0
  227. package/dist/types/cli/utils/evals.d.ts +47 -0
  228. package/dist/types/cli/utils/logs.d.ts +38 -0
  229. package/dist/types/code_executors/code_execution_utils.d.ts +39 -0
  230. package/dist/types/code_executors/code_executor_context.d.ts +1 -0
  231. package/dist/types/code_executors/container_code_executor.d.ts +17 -5
  232. package/dist/types/common.d.ts +24 -5
  233. package/dist/types/errors/input_validation_error.d.ts +2 -1
  234. package/dist/types/events/event.d.ts +4 -0
  235. package/dist/types/examples/example_util.d.ts +17 -0
  236. package/dist/types/flows/llm_flows/audio_transcriber.d.ts +85 -0
  237. package/dist/types/index.d.ts +19 -2
  238. package/dist/types/models/gemini_llm_connection.d.ts +6 -7
  239. package/dist/types/models/routed_llm.d.ts +1 -1
  240. package/dist/types/plugins/base_plugin.d.ts +0 -10
  241. package/dist/types/runner/in_memory_runner.d.ts +2 -1
  242. package/dist/types/runner/runner.d.ts +34 -0
  243. package/dist/types/sessions/base_session_service.d.ts +5 -0
  244. package/dist/types/sessions/database_session_service.d.ts +17 -1
  245. package/dist/types/sessions/stale_session_error.d.ts +21 -0
  246. package/dist/types/sessions/state.d.ts +5 -1
  247. package/dist/types/sessions/vertex_ai_session_service.d.ts +8 -0
  248. package/dist/types/skills/loader.d.ts +3 -2
  249. package/dist/types/skills/skill.d.ts +1 -1
  250. package/dist/types/telemetry/tracing.d.ts +20 -4
  251. package/dist/types/tools/apihub_tool/apihub_toolset.d.ts +115 -0
  252. package/dist/types/tools/apihub_tool/clients/apihub_client.d.ts +142 -0
  253. package/dist/types/tools/apihub_tool/clients/secret_client.d.ts +55 -0
  254. package/dist/types/tools/apihub_tool/clients/service_account.d.ts +11 -0
  255. package/dist/types/tools/application_integration_tool/application_integration_toolset.d.ts +109 -0
  256. package/dist/types/tools/application_integration_tool/clients/cloud_request.d.ts +53 -0
  257. package/dist/types/tools/application_integration_tool/clients/connections_client.d.ts +229 -0
  258. package/dist/types/tools/application_integration_tool/clients/integration_client.d.ts +72 -0
  259. package/dist/types/tools/application_integration_tool/integration_connector_tool.d.ts +70 -0
  260. package/dist/types/tools/base_toolset.d.ts +6 -5
  261. package/dist/types/tools/example_tool.d.ts +10 -0
  262. package/dist/types/tools/function_tool.d.ts +32 -0
  263. package/dist/types/tools/google_api_tool/google_api_tool.d.ts +37 -0
  264. package/dist/types/tools/google_api_tool/google_api_toolset.d.ts +55 -0
  265. package/dist/types/tools/google_api_tool/google_api_toolsets.d.ts +48 -0
  266. package/dist/types/tools/google_api_tool/googleapi_to_openapi_converter.d.ts +165 -0
  267. package/dist/types/tools/google_api_tool/index.d.ts +10 -0
  268. package/dist/types/tools/load_artifacts_tool.d.ts +14 -1
  269. package/dist/types/tools/load_memory_tool.d.ts +23 -1
  270. package/dist/types/tools/mcp/index.d.ts +3 -0
  271. package/dist/types/tools/mcp/mcp_session_manager.d.ts +34 -1
  272. package/dist/types/tools/mcp/mcp_toolset.d.ts +15 -0
  273. package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +19 -0
  274. package/dist/types/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.d.ts +18 -1
  275. package/dist/types/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.d.ts +12 -0
  276. package/dist/types/tools/openapi_tool/openapi_spec_parser/operation_parser.d.ts +8 -0
  277. package/dist/types/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.d.ts +2 -1
  278. package/dist/types/tools/openapi_tool/openapi_toolset.d.ts +5 -0
  279. package/dist/types/tools/openapi_tool/rest_api_tool.d.ts +10 -0
  280. package/dist/types/tools/retrieval/base_retrieval_tool.d.ts +15 -0
  281. package/dist/types/tools/toolbox_toolset.d.ts +159 -0
  282. package/dist/types/utils/client_labels.d.ts +2 -1
  283. package/dist/types/utils/env_aware_utils.d.ts +18 -2
  284. package/dist/types/utils/error_utils.d.ts +7 -0
  285. package/dist/types/utils/file_utils.d.ts +6 -1
  286. package/dist/types/utils/gemini_schema_util.d.ts +9 -2
  287. package/dist/types/utils/json_utils.d.ts +11 -0
  288. package/dist/types/utils/object_notation_utils.d.ts +7 -0
  289. package/dist/types/utils/output_schema_utils.d.ts +3 -2
  290. package/dist/types/utils/simple_zod_to_json.d.ts +1 -2
  291. package/dist/types/utils/streaming_utils.d.ts +11 -4
  292. package/dist/types/version.d.ts +1 -1
  293. package/dist/web/index_web.js +117 -110
  294. package/dist/web/index_web.js.map +4 -4
  295. package/package.json +38 -26
  296. package/dist/cjs/models/gemini_continuation.js +0 -232
  297. package/dist/esm/models/gemini_continuation.js +0 -205
  298. package/dist/types/models/gemini_continuation.d.ts +0 -59
@@ -0,0 +1,165 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { OpenAPIV3 } from 'openapi-types';
7
+ /**
8
+ * Scope metadata in a Google API Discovery document.
9
+ */
10
+ export interface GoogleApiOAuth2Scope {
11
+ description?: string;
12
+ }
13
+ /**
14
+ * Parameter metadata in a Google API Discovery document.
15
+ */
16
+ export interface GoogleApiParameter {
17
+ type?: string;
18
+ description?: string;
19
+ required?: boolean;
20
+ location?: string;
21
+ format?: string;
22
+ enum?: string[];
23
+ default?: unknown;
24
+ pattern?: string;
25
+ minimum?: string;
26
+ maximum?: string;
27
+ }
28
+ /**
29
+ * Schema definition in a Google API Discovery document.
30
+ */
31
+ export interface GoogleApiSchema {
32
+ type?: string;
33
+ description?: string;
34
+ format?: string;
35
+ enum?: string[];
36
+ pattern?: string;
37
+ default?: unknown;
38
+ required?: boolean;
39
+ $ref?: string;
40
+ properties?: Record<string, GoogleApiSchema>;
41
+ items?: GoogleApiSchema;
42
+ minimum?: string;
43
+ maximum?: string;
44
+ location?: string;
45
+ }
46
+ /**
47
+ * Method definition in a Google API Discovery document.
48
+ */
49
+ export interface GoogleApiMethod {
50
+ id?: string;
51
+ path?: string;
52
+ flatPath?: string;
53
+ httpMethod?: string;
54
+ description?: string;
55
+ parameters?: Record<string, GoogleApiParameter>;
56
+ request?: {
57
+ $ref?: string;
58
+ };
59
+ response?: {
60
+ $ref?: string;
61
+ };
62
+ scopes?: string[];
63
+ }
64
+ /**
65
+ * Resource definition in a Google API Discovery document.
66
+ */
67
+ export interface GoogleApiResource {
68
+ methods?: Record<string, GoogleApiMethod>;
69
+ resources?: Record<string, GoogleApiResource>;
70
+ }
71
+ /**
72
+ * Root structure of a Google API Discovery REST specification.
73
+ */
74
+ export interface GoogleApiSpec {
75
+ kind?: string;
76
+ id?: string;
77
+ name?: string;
78
+ version?: string;
79
+ title?: string;
80
+ description?: string;
81
+ documentationLink?: string;
82
+ protocol?: string;
83
+ rootUrl?: string;
84
+ servicePath?: string;
85
+ auth?: {
86
+ oauth2?: {
87
+ scopes?: Record<string, GoogleApiOAuth2Scope>;
88
+ };
89
+ };
90
+ schemas?: Record<string, GoogleApiSchema>;
91
+ resources?: Record<string, GoogleApiResource>;
92
+ methods?: Record<string, GoogleApiMethod>;
93
+ }
94
+ /**
95
+ * Converts a Google Discovery schema reference (`#Name` or `Name`) to an
96
+ * OpenAPI v3 component schema reference (`#/components/schemas/Name`).
97
+ */
98
+ export declare function normalizeGoogleSchemaRef(ref: string): string;
99
+ /**
100
+ * Populates the OpenAPI `info` and optional `externalDocs` sections from a
101
+ * Google API Discovery document.
102
+ */
103
+ export declare function convertInfo(googleApiSpec: GoogleApiSpec, openapiSpec: OpenAPIV3.Document, apiName: string, apiVersion: string): void;
104
+ /**
105
+ * Populates the OpenAPI `servers` list from the Google Discovery `rootUrl` and
106
+ * `servicePath`.
107
+ */
108
+ export declare function convertServers(googleApiSpec: GoogleApiSpec, openapiSpec: OpenAPIV3.Document, apiName: string, apiVersion: string): void;
109
+ /**
110
+ * Populates `components.securitySchemes` and top-level `security` from a
111
+ * Google API Discovery document.
112
+ */
113
+ export declare function convertSecuritySchemes(googleApiSpec: GoogleApiSpec, openapiSpec: OpenAPIV3.Document): void;
114
+ /**
115
+ * Recursively converts a Google API Discovery schema object to an OpenAPI v3
116
+ * schema or reference object.
117
+ */
118
+ export declare function convertSchemaObject(schemaDef: GoogleApiSchema): OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject;
119
+ /**
120
+ * Populates `components.schemas` from a Google API Discovery document.
121
+ */
122
+ export declare function convertSchemas(googleApiSpec: GoogleApiSpec, openapiSpec: OpenAPIV3.Document): void;
123
+ /**
124
+ * Extracts `{param}` and `{+param}` placeholder names from a URL path.
125
+ */
126
+ export declare function extractPathParameters(path: string): string[];
127
+ /**
128
+ * Converts a Google API parameter definition into an OpenAPI parameter schema.
129
+ */
130
+ export declare function convertParameterSchema(paramData: GoogleApiParameter): OpenAPIV3.SchemaObject;
131
+ /**
132
+ * Converts a Google API method definition into an OpenAPI operation object.
133
+ */
134
+ export declare function convertOperation(methodData: GoogleApiMethod, pathParams: string[]): OpenAPIV3.OperationObject;
135
+ /**
136
+ * Converts a dictionary of Google API methods into OpenAPI path operations.
137
+ */
138
+ export declare function convertMethods(methods: Record<string, GoogleApiMethod>, _resourcePath: string, openapiSpec: OpenAPIV3.Document): void;
139
+ /**
140
+ * Recursively converts nested Google API resources and their methods into
141
+ * OpenAPI paths.
142
+ */
143
+ export declare function convertResources(resources: Record<string, GoogleApiResource>, openapiSpec: OpenAPIV3.Document, parentPath?: string): void;
144
+ /**
145
+ * Converts Google API Discovery documents into OpenAPI v3.0.0 specifications.
146
+ */
147
+ export declare class GoogleApiToOpenApiConverter {
148
+ private readonly apiName;
149
+ private readonly apiVersion;
150
+ private googleApiSpec;
151
+ private openapiSpec;
152
+ constructor(apiName: string, apiVersion: string);
153
+ /**
154
+ * Fetches the Google API specification from the Google Discovery service.
155
+ */
156
+ fetchGoogleApiSpec(): Promise<void>;
157
+ /**
158
+ * Converts the Google API specification into OpenAPI v3 format.
159
+ */
160
+ convert(): Promise<OpenAPIV3.Document>;
161
+ /**
162
+ * Saves the converted OpenAPI specification to a JSON file.
163
+ */
164
+ saveOpenapiSpec(outputPath: string): void;
165
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export { GoogleApiTool, isGoogleApiTool } from './google_api_tool.js';
7
+ export type { GoogleApiToolOptions } from './google_api_tool.js';
8
+ export { GoogleApiToolset, isGoogleApiToolset } from './google_api_toolset.js';
9
+ export type { GoogleApiToolsetOptions } from './google_api_toolset.js';
10
+ export { BigQueryToolset, CalendarToolset, DocsToolset, GmailToolset, SheetsToolset, SlidesToolset, YoutubeToolset, } from './google_api_toolsets.js';
@@ -3,8 +3,21 @@
3
3
  * Copyright 2026 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { FunctionDeclaration } from '@google/genai';
6
+ import { FunctionDeclaration, Part } from '@google/genai';
7
7
  import { BaseTool, RunAsyncToolRequest, ToolProcessLlmRequest } from './base_tool.js';
8
+ /**
9
+ * Returns a part that the model can read for the given artifact.
10
+ *
11
+ * Parts without inline data, and inline data that Gemini accepts (images,
12
+ * audio, video and PDF), are returned as they are. Other inline data becomes a
13
+ * text part: the decoded content for text-like types, and a placeholder for
14
+ * binary or missing data.
15
+ *
16
+ * @param artifact The artifact to convert.
17
+ * @param artifactName The artifact name used in the placeholder text.
18
+ * @return The artifact itself, or a text part that replaces it.
19
+ */
20
+ export declare function asSafePartForLlm(artifact: Part, artifactName: string): Part;
8
21
  /**
9
22
  * A tool that loads the artifacts and adds them to the session.
10
23
  */
@@ -4,14 +4,36 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { FunctionDeclaration } from '@google/genai';
7
+ import type { MemoryEntry } from '../memory/memory_entry.js';
7
8
  import { BaseTool, RunAsyncToolRequest, ToolProcessLlmRequest } from './base_tool.js';
9
+ /**
10
+ * Configuration options for {@link LoadMemoryTool}.
11
+ */
12
+ export interface LoadMemoryToolOptions {
13
+ /**
14
+ * Whether to flatten memory content into space-separated text strings.
15
+ *
16
+ * @deprecated Set `textOnlyContent: true` only to retain legacy string content. The default is `false`, returning complete {@link MemoryEntry} objects. This option will be removed in a future release.
17
+ */
18
+ readonly textOnlyContent?: boolean;
19
+ }
20
+ /**
21
+ * Response returned by {@link LoadMemoryTool}.
22
+ *
23
+ * When {@link LoadMemoryToolOptions.textOnlyContent} is enabled, entries contain
24
+ * string content instead of a `Content` object.
25
+ */
26
+ export interface LoadMemoryResponse {
27
+ memories: MemoryEntry[];
28
+ }
8
29
  /**
9
30
  * A tool that loads the memory for the current user.
10
31
  *
11
32
  * NOTE: Currently this tool only uses text part from the memory.
12
33
  */
13
34
  export declare class LoadMemoryTool extends BaseTool {
14
- constructor();
35
+ private readonly textOnlyContent;
36
+ constructor(options?: LoadMemoryToolOptions);
15
37
  _getDeclaration(): FunctionDeclaration | undefined;
16
38
  runAsync({ args, toolContext, }: RunAsyncToolRequest): Promise<unknown>;
17
39
  processLlmRequest(request: ToolProcessLlmRequest): Promise<void>;
@@ -7,6 +7,9 @@
7
7
  * `@google/adk/tools/mcp` subpath: the MCP tools only, without the full ADK
8
8
  * barrel. Also re-exported from `@google/adk`.
9
9
  */
10
+ export { toGeminiSchema } from '../../utils/gemini_schema_util.js';
11
+ export type { MCPToolSchema } from '../../utils/gemini_schema_util.js';
12
+ export { genaiSchemaToJsonSchema } from '../../utils/genai_schema_to_json.js';
10
13
  export * from './load_mcp_resource_tool.js';
11
14
  export * from './mcp_session_manager.js';
12
15
  export * from './mcp_tool.js';
@@ -4,6 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
7
+ import type { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
7
8
  import type { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
8
9
  import type { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
9
10
  /**
@@ -40,10 +41,42 @@ export interface StreamableHTTPConnectionParams {
40
41
  terminateOnClose?: boolean;
41
42
  transportOptions?: StreamableHTTPClientTransportOptions;
42
43
  }
44
+ /**
45
+ * Defines the parameters for establishing a connection to an MCP server over
46
+ * the HTTP+SSE transport.
47
+ *
48
+ * Usage:
49
+ * const connectionParams: SseConnectionParams = {
50
+ * type: 'SseConnectionParams',
51
+ * url: 'http://localhost:8090/sse'
52
+ * };
53
+ */
54
+ export interface SseConnectionParams {
55
+ type: 'SseConnectionParams';
56
+ url: string;
57
+ /**
58
+ * @deprecated
59
+ * Use transportOptions.requestInit.headers instead.
60
+ * This field will be ignored if transportOptions is provided even if no headers are specified in transportOptions.
61
+ */
62
+ header?: Record<string, unknown>;
63
+ /**
64
+ * HTTP headers to send with the SSE and POST requests when
65
+ * `transportOptions.requestInit` is not provided.
66
+ */
67
+ headers?: Record<string, unknown>;
68
+ timeout?: number;
69
+ sseReadTimeout?: number;
70
+ transportOptions?: SSEClientTransportOptions;
71
+ }
72
+ /**
73
+ * Alias for {@link SseConnectionParams}.
74
+ */
75
+ export type SseServerParams = SseConnectionParams;
43
76
  /**
44
77
  * A union of all supported MCP connection parameter types.
45
78
  */
46
- export type MCPConnectionParams = StdioConnectionParams | StreamableHTTPConnectionParams;
79
+ export type MCPConnectionParams = StdioConnectionParams | SseConnectionParams | StreamableHTTPConnectionParams;
47
80
  /**
48
81
  * Manages Model Context Protocol (MCP) client sessions.
49
82
  *
@@ -8,6 +8,7 @@ import { ReadonlyContext } from '../../agents/readonly_context.js';
8
8
  import { BaseTool } from '../base_tool.js';
9
9
  import { BaseToolset, ToolPredicate } from '../base_toolset.js';
10
10
  import { MCPConnectionParams } from './mcp_session_manager.js';
11
+ export type { SseConnectionParams, SseServerParams, } from './mcp_session_manager.js';
11
12
  /**
12
13
  * A toolset that dynamically discovers and provides tools from a Model Context
13
14
  * Protocol (MCP) server.
@@ -37,6 +38,20 @@ import { MCPConnectionParams } from './mcp_session_manager.js';
37
38
  * const mcpToolset = new MCPToolset(connectionParams);
38
39
  * const tools = await mcpToolset.getTools();
39
40
  * ```
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * import {MCPToolset} from '@google/adk';
45
+ * import type {SseConnectionParams} from '@google/adk';
46
+ *
47
+ * const sseParams: SseConnectionParams = {
48
+ * type: 'SseConnectionParams',
49
+ * url: 'http://localhost:8090/sse',
50
+ * };
51
+ *
52
+ * const sseToolset = new MCPToolset(sseParams);
53
+ * const sseTools = await sseToolset.getTools();
54
+ * ```
40
55
  */
41
56
  export declare class MCPToolset extends BaseToolset {
42
57
  private readonly mcpSessionManager;
@@ -12,6 +12,25 @@ import { ApiParameter } from '../openapi_spec_parser/operation_parser.js';
12
12
  * model-supplied.
13
13
  */
14
14
  export declare const INTERNAL_AUTH_PREFIX = "_auth_prefix_vaf_";
15
+ /**
16
+ * The client settings an application registers with an OpenID Connect
17
+ * provider.
18
+ */
19
+ export interface OpenIdConfig {
20
+ /** The client ID the provider issued to the application. */
21
+ clientId: string;
22
+ /** The provider's authorization endpoint. */
23
+ authUri: string;
24
+ /** The provider's token endpoint. */
25
+ tokenUri: string;
26
+ /** The client secret the provider issued to the application. */
27
+ clientSecret: string;
28
+ /**
29
+ * Where the provider sends the user after sign-in. When unset, the provider
30
+ * uses the redirect URI registered for the client.
31
+ */
32
+ redirectUri?: string;
33
+ }
15
34
  /**
16
35
  * Applies the given credential to the request headers and URL.
17
36
  *
@@ -31,13 +31,30 @@ export type CustomCredentialExchangers = Partial<Record<AuthCredentialTypes, Bas
31
31
  * });
32
32
  */
33
33
  export declare class AutoAuthCredentialExchanger implements BaseCredentialExchanger {
34
- private exchangers;
34
+ /**
35
+ * The exchanger used for each auth credential type.
36
+ *
37
+ * By default `OAUTH2` and `OPEN_ID_CONNECT` run
38
+ * {@link OAuth2CredentialExchanger} and convert any access token with
39
+ * {@link generateAuthToken}, and `SERVICE_ACCOUNT` maps to a
40
+ * {@link ServiceAccountCredentialExchanger}, with any custom exchangers from
41
+ * the constructor merged over them. The map is live: an entry added or
42
+ * replaced after construction is used by the next {@link exchange} call.
43
+ */
44
+ readonly exchangers: Map<AuthCredentialTypes, BaseCredentialExchanger>;
35
45
  /**
36
46
  * @param customExchangers - Optional exchangers that add to or override the
37
47
  * built-in ones. The key is the auth credential type; the value is the
38
48
  * exchanger instance to use for that type.
39
49
  */
40
50
  constructor(customExchangers?: CustomCredentialExchangers);
51
+ /**
52
+ * Exchanges the credential with the exchanger registered for its type.
53
+ *
54
+ * @returns The credential unchanged, with `wasExchanged: false`, when no
55
+ * exchanger is registered for its type. Otherwise the delegate's result,
56
+ * or `null` when there is no credential at all.
57
+ */
41
58
  exchange(params: {
42
59
  authScheme?: AuthScheme;
43
60
  authCredential: AuthCredential;
@@ -28,8 +28,20 @@ export interface ParsedOperation {
28
28
  }
29
29
  export declare class OpenApiSpecParser {
30
30
  private preservePropertyNames;
31
+ private unconstrainedObjectBodyAsParameter;
32
+ /**
33
+ * @param options.preservePropertyNames Keeps the original parameter and
34
+ * function names instead of converting them to snake_case.
35
+ * @param options.unconstrainedObjectBodyAsParameter Emits a whole-body
36
+ * parameter named `body` when an object request body schema has no
37
+ * properties. Defaults to `false`.
38
+ * @deprecated Retained for backwards compatibility; empty object schemas
39
+ * produce no parameters by default. This option will be removed in a
40
+ * future release.
41
+ */
31
42
  constructor(options?: {
32
43
  preservePropertyNames?: boolean;
44
+ unconstrainedObjectBodyAsParameter?: boolean;
33
45
  });
34
46
  /**
35
47
  * Parses an OpenAPI specification document and extracts a list of operations.
@@ -22,6 +22,7 @@ export declare class OperationParser {
22
22
  private params;
23
23
  private returnValue?;
24
24
  private preservePropertyNames;
25
+ private unconstrainedObjectBodyAsParameter;
25
26
  private readonly operation;
26
27
  /**
27
28
  * @param operation The operation to parse. A string is parsed as JSON, and a
@@ -30,10 +31,17 @@ export declare class OperationParser {
30
31
  * function names instead of converting them to snake_case.
31
32
  * @param options.shouldParse Whether to parse the operation during
32
33
  * construction. Defaults to `true`.
34
+ * @param options.unconstrainedObjectBodyAsParameter Emits a whole-body
35
+ * parameter named `body` when an object request body schema has no
36
+ * properties. Defaults to `false`.
37
+ * @deprecated Retained for backwards compatibility; empty object schemas
38
+ * produce no parameters by default. This option will be removed in a
39
+ * future release.
33
40
  */
34
41
  constructor(operation: OpenAPIV3.OperationObject | Record<string, unknown> | string, options?: {
35
42
  preservePropertyNames?: boolean;
36
43
  shouldParse?: boolean;
44
+ unconstrainedObjectBodyAsParameter?: boolean;
37
45
  });
38
46
  /**
39
47
  * Builds a parser from parameters that were already parsed, without walking
@@ -71,7 +71,8 @@ export declare class ToolAuthHandler {
71
71
  static fromToolContext(context: Context, authScheme?: AuthScheme, authCredential?: AuthCredential, options?: ToolAuthHandlerOptions): ToolAuthHandler;
72
72
  prepareAuthCredentials(): Promise<AuthPreparationResult>;
73
73
  /**
74
- * Exchanges `credential`, or returns `undefined` when the exchange failed.
74
+ * Exchanges `credential`, or returns `undefined` when the exchange failed or
75
+ * produced an interactive credential that still holds no token.
75
76
  *
76
77
  * An exchange failure is transient far more often than it is fatal, so it
77
78
  * becomes a `pending` result the client can resume from rather than an
@@ -22,6 +22,11 @@ export declare class OpenAPIToolset extends BaseToolset {
22
22
  authCredential?: AuthCredential;
23
23
  credentialKey?: string;
24
24
  headerProvider?: (context: ReadonlyContext) => Record<string, string>;
25
+ /**
26
+ * @deprecated Emits a whole-body parameter for unconstrained object schemas.
27
+ * Will be removed in a future release.
28
+ */
29
+ unconstrainedObjectBodyAsParameter?: boolean;
25
30
  });
26
31
  getTools(context?: ReadonlyContext): Promise<BaseTool[]>;
27
32
  /**
@@ -41,6 +41,11 @@ export declare class RestApiTool extends BaseTool {
41
41
  headerProvider?: (context: ReadonlyContext) => Record<string, string>;
42
42
  credentialKey?: string;
43
43
  operationParser?: OperationParser;
44
+ /**
45
+ * @deprecated Emits a whole-body parameter for unconstrained object schemas.
46
+ * Will be removed in a future release.
47
+ */
48
+ unconstrainedObjectBodyAsParameter?: boolean;
44
49
  });
45
50
  configureAuthScheme(authScheme: OpenAPIV3.SecuritySchemeObject): void;
46
51
  configureAuthCredential(authCredential: AuthCredential): void;
@@ -69,6 +74,11 @@ export declare function createRestApiTool(parsed: ParsedOperationInput, options?
69
74
  preservePropertyNames?: boolean;
70
75
  headerProvider?: (context: ReadonlyContext) => Record<string, string>;
71
76
  credentialKey?: string;
77
+ /**
78
+ * @deprecated Emits a whole-body parameter for unconstrained object schemas.
79
+ * Will be removed in a future release.
80
+ */
81
+ unconstrainedObjectBodyAsParameter?: boolean;
72
82
  }): RestApiTool;
73
83
  /**
74
84
  * Builds a `RestApiTool` from the JSON string form of a parsed operation.
@@ -5,6 +5,18 @@
5
5
  */
6
6
  import { FunctionDeclaration } from '@google/genai';
7
7
  import { BaseTool } from '../base_tool.js';
8
+ /**
9
+ * Unique symbol to identify `BaseRetrievalTool` classes.
10
+ * Defined once and shared by all `BaseRetrievalTool` instances.
11
+ */
12
+ declare const BASE_RETRIEVAL_TOOL_SIGNATURE_SYMBOL: unique symbol;
13
+ /**
14
+ * Type guard to check if an object is an instance of `BaseRetrievalTool`.
15
+ *
16
+ * @param obj The object to check.
17
+ * @returns True if the object is an instance of `BaseRetrievalTool`, false otherwise.
18
+ */
19
+ export declare function isBaseRetrievalTool(obj: unknown): obj is BaseRetrievalTool;
8
20
  /**
9
21
  * The base class for tools that answer a single natural-language query by
10
22
  * retrieving text the framework fetches itself.
@@ -17,5 +29,8 @@ import { BaseTool } from '../base_tool.js';
17
29
  * `src/google/adk/tools/retrieval/base_retrieval_tool.py` at ref `v0.1.0`.
18
30
  */
19
31
  export declare abstract class BaseRetrievalTool extends BaseTool {
32
+ /** Unique symbol to identify `BaseRetrievalTool` class. */
33
+ readonly [BASE_RETRIEVAL_TOOL_SIGNATURE_SYMBOL] = true;
20
34
  _getDeclaration(): FunctionDeclaration;
21
35
  }
36
+ export {};
@@ -0,0 +1,159 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { ReadonlyContext } from '../agents/readonly_context.js';
7
+ import { BaseTool } from './base_tool.js';
8
+ import { BaseToolset, ToolPredicate } from './base_toolset.js';
9
+ import { ToolInputParameters } from './function_tool.js';
10
+ /**
11
+ * Structural interface for a tool loaded from a Toolbox client.
12
+ */
13
+ export interface ToolboxToolLike {
14
+ /**
15
+ * The name of the tool.
16
+ */
17
+ name?: string;
18
+ /**
19
+ * The description of the tool.
20
+ */
21
+ description?: string;
22
+ /**
23
+ * Optional parameter schema for the tool.
24
+ */
25
+ parameters?: ToolInputParameters;
26
+ /**
27
+ * Executes the tool with the given arguments.
28
+ */
29
+ execute?(...args: never[]): unknown | Promise<unknown>;
30
+ }
31
+ /**
32
+ * Options forwarded to a Toolbox client when loading a tool or toolset.
33
+ */
34
+ export interface ToolboxLoadOptions {
35
+ /**
36
+ * Mapping of authentication service names to callables that return the
37
+ * corresponding authentication token.
38
+ */
39
+ authTokenGetters?: Record<string, () => string | Promise<string>>;
40
+ /**
41
+ * Mapping of parameter names to bind to fixed values or callables that
42
+ * produce values as needed.
43
+ */
44
+ boundParams?: Record<string, unknown>;
45
+ }
46
+ /**
47
+ * Structural interface for an asynchronous or synchronous Toolbox client
48
+ * instance used by {@link ToolboxToolset}.
49
+ */
50
+ export interface ToolboxToolsetClientLike {
51
+ /**
52
+ * Loads a single tool by name (camelCase convention).
53
+ */
54
+ loadTool?: (toolName: string, options?: ToolboxLoadOptions) => BaseTool | ToolboxToolLike | ((...args: never[]) => unknown) | Promise<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>;
55
+ /**
56
+ * Loads a single tool by name (snake_case convention).
57
+ */
58
+ load_tool?: (toolName: string, options?: ToolboxLoadOptions) => BaseTool | ToolboxToolLike | ((...args: never[]) => unknown) | Promise<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>;
59
+ /**
60
+ * Loads a toolset by name (camelCase convention).
61
+ */
62
+ loadToolset?: (toolsetName: string, options?: ToolboxLoadOptions) => Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)> | Promise<Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>>;
63
+ /**
64
+ * Loads a toolset by name (snake_case convention).
65
+ */
66
+ load_toolset?: (toolsetName: string, options?: ToolboxLoadOptions) => Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)> | Promise<Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>>;
67
+ /**
68
+ * Closes the underlying client resources.
69
+ */
70
+ close?: () => void | Promise<void>;
71
+ }
72
+ /**
73
+ * Configuration options for {@link ToolboxToolset}.
74
+ */
75
+ export interface ToolboxToolsetOptions {
76
+ /**
77
+ * The URL of the Toolbox server.
78
+ */
79
+ serverUrl: string;
80
+ /**
81
+ * The name of the Toolbox toolset to load.
82
+ */
83
+ toolsetName?: string;
84
+ /**
85
+ * The names of the individual tools to load.
86
+ */
87
+ toolNames?: readonly string[];
88
+ /**
89
+ * Mapping of authentication service names to callables that return the
90
+ * corresponding authentication token.
91
+ */
92
+ authTokenGetters?: Record<string, () => string | Promise<string>>;
93
+ /**
94
+ * Mapping of parameter names to bind to fixed values or callables that
95
+ * produce values as needed.
96
+ */
97
+ boundParams?: Record<string, unknown>;
98
+ /**
99
+ * Optional pre-configured Toolbox client instance.
100
+ */
101
+ client?: ToolboxToolsetClientLike;
102
+ /**
103
+ * Optional filter to select which tools are exposed to the LLM.
104
+ */
105
+ toolFilter?: ToolPredicate | string[];
106
+ /**
107
+ * Optional prefix prepended (`${prefix}_`) to loaded tool names.
108
+ */
109
+ prefix?: string;
110
+ }
111
+ declare const TOOLBOX_TOOLSET_SIGNATURE_SYMBOL: unique symbol;
112
+ /**
113
+ * Type guard to check if an object is an instance of {@link ToolboxToolset}.
114
+ */
115
+ export declare function isToolboxToolset(obj: unknown): obj is ToolboxToolset;
116
+ /**
117
+ * Provides asynchronous access to Toolbox tools and toolsets as a
118
+ * {@link BaseToolset}.
119
+ */
120
+ export declare class ToolboxToolset extends BaseToolset {
121
+ /** A unique symbol to identify ADK ToolboxToolset class. */
122
+ readonly [TOOLBOX_TOOLSET_SIGNATURE_SYMBOL] = true;
123
+ /**
124
+ * The URL of the Toolbox server.
125
+ */
126
+ readonly serverUrl: string;
127
+ /**
128
+ * The name of the Toolbox toolset to load, if configured.
129
+ */
130
+ readonly toolsetName?: string;
131
+ /**
132
+ * The names of the individual tools to load, if configured.
133
+ */
134
+ readonly toolNames?: readonly string[];
135
+ /**
136
+ * Mapping of authentication service names to token getters.
137
+ */
138
+ readonly authTokenGetters: Record<string, () => string | Promise<string>>;
139
+ /**
140
+ * Mapping of parameter names to bound values or value getters.
141
+ */
142
+ readonly boundParams: Record<string, unknown>;
143
+ /**
144
+ * The underlying Toolbox client instance.
145
+ */
146
+ readonly toolboxClient: ToolboxToolsetClientLike;
147
+ constructor(options: ToolboxToolsetOptions);
148
+ constructor(serverUrl: string, options: Omit<ToolboxToolsetOptions, 'serverUrl'>);
149
+ /**
150
+ * Loads the configured toolset and/or individual tools from the Toolbox
151
+ * client and returns the selected {@link BaseTool} instances.
152
+ */
153
+ getTools(context?: ReadonlyContext): Promise<BaseTool[]>;
154
+ /**
155
+ * Closes the underlying Toolbox client.
156
+ */
157
+ close(): Promise<void>;
158
+ }
159
+ export {};