@google/adk 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/dist/cjs/a2a/a2a_remote_agent.js +17 -2
  2. package/dist/cjs/a2a/a2a_remote_agent_utils.js +8 -4
  3. package/dist/cjs/a2a/agent_card.js +5 -81
  4. package/dist/cjs/a2a/agent_to_a2a.js +7 -0
  5. package/dist/cjs/a2a/event_converter_utils.js +10 -3
  6. package/dist/cjs/agents/agent_engine_client.js +399 -0
  7. package/dist/cjs/agents/base_agent.js +127 -68
  8. package/dist/cjs/agents/functions.js +64 -59
  9. package/dist/cjs/agents/instructions.js +8 -6
  10. package/dist/cjs/agents/invocation_context.js +2 -2
  11. package/dist/cjs/agents/llm_agent.js +124 -101
  12. package/dist/cjs/agents/processors/basic_llm_request_processor.js +1 -1
  13. package/dist/cjs/agents/processors/code_execution_request_processor.js +8 -0
  14. package/dist/cjs/agents/processors/content_processor_utils.js +72 -17
  15. package/dist/cjs/agents/processors/content_request_processor.js +51 -2
  16. package/dist/cjs/agents/processors/context_compactor_request_processor.js +5 -1
  17. package/dist/cjs/agents/processors/instructions_llm_request_processor.js +1 -1
  18. package/dist/cjs/agents/processors/nl_planning_processor.js +13 -3
  19. package/dist/cjs/artifacts/file_artifact_service.js +1 -1
  20. package/dist/cjs/cli/cli_eval.js +884 -17
  21. package/dist/cjs/cli/utils/cleanup.js +84 -0
  22. package/dist/cjs/cli/utils/envs.js +33 -2
  23. package/dist/cjs/cli/utils/evals.js +75 -8
  24. package/dist/cjs/cli/utils/logs.js +134 -15
  25. package/dist/cjs/cli/utils/path_validation.js +83 -0
  26. package/dist/cjs/code_executors/container_code_executor.js +171 -38
  27. package/dist/cjs/code_executors/unsafe_local_code_executor.js +6 -1
  28. package/dist/cjs/common.js +59 -32
  29. package/dist/cjs/context/compaction_utils.js +19 -0
  30. package/dist/cjs/errors/input_validation_error.js +3 -2
  31. package/dist/cjs/events/event.js +7 -3
  32. package/dist/cjs/features/feature_registry.js +5 -0
  33. package/dist/cjs/index.js +34 -12
  34. package/dist/cjs/models/google_llm.js +33 -2
  35. package/dist/cjs/models/interactions_utils.js +3 -0
  36. package/dist/cjs/plugins/base_plugin.js +54 -40
  37. package/dist/cjs/plugins/plugin_manager.js +27 -0
  38. package/dist/cjs/runner/runner.js +306 -189
  39. package/dist/cjs/sessions/base_session_service.js +15 -12
  40. package/dist/cjs/sessions/database_session_service.js +232 -38
  41. package/dist/cjs/sessions/db/operations.js +70 -1
  42. package/dist/cjs/sessions/db/schema.js +4 -0
  43. package/dist/cjs/sessions/in_memory_session_service.js +2 -2
  44. package/dist/cjs/sessions/stale_session_error.js +59 -0
  45. package/dist/cjs/sessions/vertex_ai_session_service.js +11 -3
  46. package/dist/cjs/skills/loader.js +76 -41
  47. package/dist/cjs/telemetry/api/instrumentation.js +632 -0
  48. package/dist/cjs/telemetry/api/internal/common/accumulators.js +169 -0
  49. package/dist/cjs/telemetry/api/internal/common/attributes.js +131 -0
  50. package/dist/cjs/telemetry/api/internal/common/config.js +159 -0
  51. package/dist/cjs/telemetry/api/internal/common/error.js +98 -0
  52. package/dist/cjs/telemetry/api/internal/common/finish_reason.js +63 -0
  53. package/dist/cjs/telemetry/api/internal/common/genai_messages.js +217 -0
  54. package/dist/cjs/telemetry/api/internal/common/http_exchange.js +169 -0
  55. package/dist/cjs/telemetry/api/internal/common/provider_name.js +87 -0
  56. package/dist/cjs/telemetry/api/internal/common/redaction.js +148 -0
  57. package/dist/cjs/telemetry/api/internal/common/serialization.js +58 -0
  58. package/dist/cjs/telemetry/api/internal/common/token_usage.js +118 -0
  59. package/dist/cjs/telemetry/api/internal/logs/inference.js +50 -0
  60. package/dist/cjs/telemetry/api/internal/logs/logger.js +46 -0
  61. package/dist/cjs/telemetry/api/internal/logs/mcp.js +141 -0
  62. package/dist/cjs/telemetry/api/internal/metrics/agent.js +128 -0
  63. package/dist/cjs/telemetry/api/internal/metrics/inference_start_hook.js +56 -0
  64. package/dist/cjs/telemetry/api/internal/metrics/meters.js +189 -0
  65. package/dist/cjs/telemetry/api/internal/metrics/tool.js +147 -0
  66. package/dist/cjs/telemetry/api/internal/metrics/workflow.js +132 -0
  67. package/dist/cjs/telemetry/api/internal/trace/agent.js +52 -0
  68. package/dist/cjs/telemetry/api/internal/trace/compaction.js +78 -0
  69. package/dist/cjs/telemetry/api/internal/trace/inference.js +132 -0
  70. package/dist/cjs/telemetry/api/internal/trace/live.js +52 -0
  71. package/dist/cjs/telemetry/api/internal/trace/node.js +73 -0
  72. package/dist/cjs/telemetry/api/internal/trace/propagation.js +67 -0
  73. package/dist/cjs/telemetry/api/internal/trace/tool.js +122 -0
  74. package/dist/cjs/telemetry/api/internal/trace/tracer.js +77 -0
  75. package/dist/cjs/telemetry/api/internal/trace/workflow.js +77 -0
  76. package/dist/cjs/telemetry/export/agent_engine.js +90 -0
  77. package/dist/cjs/telemetry/export/agent_runtime.js +73 -0
  78. package/dist/cjs/telemetry/export/google_cloud.js +763 -0
  79. package/dist/cjs/telemetry/export/request_driven_metric_reader.js +303 -0
  80. package/dist/cjs/telemetry/{setup.js → export/setup.js} +72 -6
  81. package/dist/cjs/tools/agent_tool.js +9 -1
  82. package/dist/cjs/tools/apihub_tool/apihub_toolset.js +18 -23
  83. package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +109 -43
  84. package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +222 -114
  85. package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +34 -14
  86. package/dist/cjs/tools/application_integration_tool/integration_connector_tool.js +175 -0
  87. package/dist/cjs/tools/base_toolset.js +1 -1
  88. package/dist/cjs/tools/computer_use/base_computer.js +125 -0
  89. package/dist/cjs/tools/computer_use/computer_use_actions.js +502 -0
  90. package/dist/cjs/tools/computer_use/computer_use_tool.js +244 -0
  91. package/dist/cjs/tools/computer_use/computer_use_toolset.js +360 -0
  92. package/dist/cjs/tools/function_tool.js +15 -5
  93. package/dist/cjs/tools/google_api_tool/google_api_tool.js +4 -1
  94. package/dist/cjs/tools/google_api_tool/google_api_toolset.js +174 -0
  95. package/dist/cjs/tools/google_api_tool/google_api_toolsets.js +124 -0
  96. package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +5 -3
  97. package/dist/cjs/tools/google_api_tool/index.js +20 -23
  98. package/dist/cjs/tools/load_artifacts_tool.js +27 -11
  99. package/dist/cjs/tools/load_memory_tool.js +14 -15
  100. package/dist/cjs/tools/mcp/mcp_session_manager.js +23 -3
  101. package/dist/cjs/tools/mcp/mcp_tool.js +7 -3
  102. package/dist/cjs/tools/mcp/mcp_toolset.js +19 -20
  103. package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +30 -29
  104. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +4 -4
  105. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
  106. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
  107. package/dist/cjs/tools/openapi_tool/openapi_toolset.js +7 -13
  108. package/dist/cjs/tools/openapi_tool/rest_api_tool.js +57 -10
  109. package/dist/cjs/tools/skill/load_skill_resource_tool.js +7 -0
  110. package/dist/cjs/tools/skill/load_skill_tool.js +3 -0
  111. package/dist/cjs/tools/skill/run_skill_script_tool.js +12 -2
  112. package/dist/cjs/tools/toolbox_toolset.js +193 -0
  113. package/dist/cjs/tools/webmcp/webmcp_toolset.js +1 -14
  114. package/dist/cjs/utils/async_queue.js +37 -3
  115. package/dist/cjs/utils/client_labels.js +17 -2
  116. package/dist/cjs/utils/env_aware_utils.js +13 -7
  117. package/dist/cjs/utils/error_utils.js +40 -2
  118. package/dist/cjs/utils/failover_utils.js +11 -10
  119. package/dist/cjs/utils/gemini_schema_util.js +145 -14
  120. package/dist/cjs/utils/id_provider.js +63 -0
  121. package/dist/cjs/utils/logger_node.js +4 -0
  122. package/dist/cjs/utils/model_name.js +15 -0
  123. package/dist/cjs/utils/output_schema_utils.js +5 -2
  124. package/dist/cjs/utils/simple_zod_to_json.js +13 -31
  125. package/dist/cjs/utils/ssrf_guard.js +46 -16
  126. package/dist/cjs/utils/task.js +1 -1
  127. package/dist/cjs/version.js +1 -1
  128. package/dist/cjs/workflow/index.js +2 -0
  129. package/dist/cjs/workflow/node_runner.js +24 -80
  130. package/dist/cjs/workflow/nodes/parallel_worker.js +18 -7
  131. package/dist/cjs/workflow/run_llm_agent_as_node.js +19 -14
  132. package/dist/cjs/workflow/utils/retry_utils.js +2 -2
  133. package/dist/cjs/workflow/workflow.js +12 -12
  134. package/dist/esm/a2a/a2a_remote_agent.js +23 -3
  135. package/dist/esm/a2a/a2a_remote_agent_utils.js +8 -4
  136. package/dist/esm/a2a/agent_card.js +5 -83
  137. package/dist/esm/a2a/agent_to_a2a.js +7 -0
  138. package/dist/esm/a2a/event_converter_utils.js +10 -3
  139. package/dist/esm/agents/agent_engine_client.js +382 -0
  140. package/dist/esm/agents/base_agent.js +127 -72
  141. package/dist/esm/agents/functions.js +69 -63
  142. package/dist/esm/agents/instructions.js +8 -6
  143. package/dist/esm/agents/invocation_context.js +2 -2
  144. package/dist/esm/agents/llm_agent.js +130 -106
  145. package/dist/esm/agents/processors/basic_llm_request_processor.js +1 -1
  146. package/dist/esm/agents/processors/code_execution_request_processor.js +8 -0
  147. package/dist/esm/agents/processors/content_processor_utils.js +72 -17
  148. package/dist/esm/agents/processors/content_request_processor.js +51 -2
  149. package/dist/esm/agents/processors/context_compactor_request_processor.js +5 -1
  150. package/dist/esm/agents/processors/instructions_llm_request_processor.js +1 -1
  151. package/dist/esm/agents/processors/nl_planning_processor.js +13 -3
  152. package/dist/esm/artifacts/file_artifact_service.js +1 -1
  153. package/dist/esm/cli/cli_eval.js +880 -17
  154. package/dist/esm/cli/utils/cleanup.js +56 -0
  155. package/dist/esm/cli/utils/envs.js +33 -2
  156. package/dist/esm/cli/utils/evals.js +74 -8
  157. package/dist/esm/cli/utils/logs.js +132 -13
  158. package/dist/esm/cli/utils/path_validation.js +45 -0
  159. package/dist/esm/code_executors/container_code_executor.js +171 -38
  160. package/dist/esm/code_executors/unsafe_local_code_executor.js +6 -1
  161. package/dist/esm/common.js +59 -19
  162. package/dist/esm/context/compaction_utils.js +19 -0
  163. package/dist/esm/errors/input_validation_error.js +3 -2
  164. package/dist/esm/events/event.js +7 -3
  165. package/dist/esm/features/feature_registry.js +5 -0
  166. package/dist/esm/index.js +36 -10
  167. package/dist/esm/models/google_llm.js +33 -2
  168. package/dist/esm/models/interactions_utils.js +3 -0
  169. package/dist/esm/plugins/base_plugin.js +54 -40
  170. package/dist/esm/plugins/plugin_manager.js +27 -0
  171. package/dist/esm/runner/runner.js +310 -192
  172. package/dist/esm/sessions/base_session_service.js +13 -11
  173. package/dist/esm/sessions/database_session_service.js +231 -38
  174. package/dist/esm/sessions/db/operations.js +70 -1
  175. package/dist/esm/sessions/db/schema.js +4 -0
  176. package/dist/esm/sessions/in_memory_session_service.js +2 -2
  177. package/dist/esm/sessions/stale_session_error.js +31 -0
  178. package/dist/esm/sessions/vertex_ai_session_service.js +11 -3
  179. package/dist/esm/skills/loader.js +76 -41
  180. package/dist/esm/telemetry/api/instrumentation.js +655 -0
  181. package/dist/esm/telemetry/api/internal/common/accumulators.js +139 -0
  182. package/dist/esm/telemetry/api/internal/common/attributes.js +94 -0
  183. package/dist/esm/telemetry/api/internal/common/config.js +128 -0
  184. package/dist/esm/telemetry/api/internal/common/error.js +69 -0
  185. package/dist/esm/telemetry/api/internal/common/finish_reason.js +35 -0
  186. package/dist/esm/telemetry/api/internal/common/genai_messages.js +188 -0
  187. package/dist/esm/telemetry/api/internal/common/http_exchange.js +142 -0
  188. package/dist/esm/telemetry/api/internal/common/provider_name.js +59 -0
  189. package/dist/esm/telemetry/api/internal/common/redaction.js +121 -0
  190. package/dist/esm/telemetry/api/internal/common/serialization.js +30 -0
  191. package/dist/esm/telemetry/api/internal/common/token_usage.js +85 -0
  192. package/dist/esm/telemetry/api/internal/logs/inference.js +23 -0
  193. package/dist/esm/telemetry/api/internal/logs/logger.js +19 -0
  194. package/dist/esm/telemetry/api/internal/logs/mcp.js +113 -0
  195. package/dist/esm/telemetry/api/internal/metrics/agent.js +107 -0
  196. package/dist/esm/telemetry/api/internal/metrics/inference_start_hook.js +29 -0
  197. package/dist/esm/telemetry/api/internal/metrics/meters.js +165 -0
  198. package/dist/esm/telemetry/api/internal/metrics/tool.js +119 -0
  199. package/dist/esm/telemetry/api/internal/metrics/workflow.js +112 -0
  200. package/dist/esm/telemetry/api/internal/trace/agent.js +25 -0
  201. package/dist/esm/telemetry/api/internal/trace/compaction.js +50 -0
  202. package/dist/esm/telemetry/api/internal/trace/inference.js +107 -0
  203. package/dist/esm/telemetry/api/internal/trace/live.js +28 -0
  204. package/dist/esm/telemetry/api/internal/trace/node.js +44 -0
  205. package/dist/esm/telemetry/api/internal/trace/propagation.js +39 -0
  206. package/dist/esm/telemetry/api/internal/trace/tool.js +96 -0
  207. package/dist/esm/telemetry/api/internal/trace/tracer.js +52 -0
  208. package/dist/esm/telemetry/api/internal/trace/workflow.js +54 -0
  209. package/dist/esm/telemetry/export/agent_engine.js +67 -0
  210. package/dist/esm/telemetry/export/agent_runtime.js +46 -0
  211. package/dist/esm/telemetry/export/google_cloud.js +733 -0
  212. package/dist/esm/telemetry/export/request_driven_metric_reader.js +276 -0
  213. package/dist/esm/telemetry/export/setup.js +160 -0
  214. package/dist/esm/tools/agent_tool.js +9 -1
  215. package/dist/esm/tools/apihub_tool/apihub_toolset.js +17 -22
  216. package/dist/esm/tools/application_integration_tool/application_integration_toolset.js +114 -44
  217. package/dist/esm/tools/application_integration_tool/clients/connections_client.js +226 -115
  218. package/dist/esm/tools/application_integration_tool/clients/integration_client.js +34 -14
  219. package/dist/esm/tools/application_integration_tool/integration_connector_tool.js +149 -0
  220. package/dist/esm/tools/base_toolset.js +1 -1
  221. package/dist/esm/tools/computer_use/base_computer.js +99 -0
  222. package/dist/esm/tools/computer_use/computer_use_actions.js +477 -0
  223. package/dist/esm/tools/computer_use/computer_use_tool.js +217 -0
  224. package/dist/esm/tools/computer_use/computer_use_toolset.js +344 -0
  225. package/dist/esm/tools/function_tool.js +15 -5
  226. package/dist/esm/tools/google_api_tool/google_api_tool.js +4 -1
  227. package/dist/esm/tools/google_api_tool/google_api_toolset.js +147 -0
  228. package/dist/esm/tools/google_api_tool/google_api_toolsets.js +94 -0
  229. package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +5 -3
  230. package/dist/esm/tools/google_api_tool/index.js +18 -20
  231. package/dist/esm/tools/load_artifacts_tool.js +25 -10
  232. package/dist/esm/tools/load_memory_tool.js +14 -15
  233. package/dist/esm/tools/mcp/mcp_session_manager.js +23 -3
  234. package/dist/esm/tools/mcp/mcp_tool.js +7 -3
  235. package/dist/esm/tools/mcp/mcp_toolset.js +19 -20
  236. package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +27 -26
  237. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +4 -4
  238. package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
  239. package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
  240. package/dist/esm/tools/openapi_tool/openapi_toolset.js +6 -12
  241. package/dist/esm/tools/openapi_tool/rest_api_tool.js +57 -10
  242. package/dist/esm/tools/skill/load_skill_resource_tool.js +7 -0
  243. package/dist/esm/tools/skill/load_skill_tool.js +3 -0
  244. package/dist/esm/tools/skill/run_skill_script_tool.js +12 -2
  245. package/dist/esm/tools/toolbox_toolset.js +167 -0
  246. package/dist/esm/tools/webmcp/webmcp_toolset.js +1 -14
  247. package/dist/esm/utils/async_queue.js +37 -3
  248. package/dist/esm/utils/client_labels.js +17 -2
  249. package/dist/esm/utils/env_aware_utils.js +12 -7
  250. package/dist/esm/utils/error_utils.js +37 -1
  251. package/dist/esm/utils/failover_utils.js +11 -10
  252. package/dist/esm/utils/gemini_schema_util.js +144 -14
  253. package/dist/esm/utils/id_provider.js +33 -0
  254. package/dist/esm/utils/logger_node.js +4 -0
  255. package/dist/esm/utils/model_name.js +14 -0
  256. package/dist/esm/utils/output_schema_utils.js +5 -2
  257. package/dist/esm/utils/simple_zod_to_json.js +13 -31
  258. package/dist/esm/utils/ssrf_guard.js +55 -15
  259. package/dist/esm/utils/task.js +1 -1
  260. package/dist/esm/version.js +1 -1
  261. package/dist/esm/workflow/index.js +2 -1
  262. package/dist/esm/workflow/node_runner.js +26 -80
  263. package/dist/esm/workflow/nodes/parallel_worker.js +16 -6
  264. package/dist/esm/workflow/run_llm_agent_as_node.js +19 -14
  265. package/dist/esm/workflow/utils/retry_utils.js +2 -2
  266. package/dist/esm/workflow/workflow.js +12 -12
  267. package/dist/types/a2a/a2a_remote_agent.d.ts +6 -0
  268. package/dist/types/a2a/a2a_remote_agent_utils.d.ts +3 -2
  269. package/dist/types/agents/agent_engine_client.d.ts +155 -0
  270. package/dist/types/agents/base_agent.d.ts +14 -0
  271. package/dist/types/agents/llm_agent.d.ts +5 -1
  272. package/dist/types/agents/processors/content_processor_utils.d.ts +12 -10
  273. package/dist/types/agents/processors/nl_planning_processor.d.ts +2 -1
  274. package/dist/types/agents/run_config.d.ts +14 -0
  275. package/dist/types/cli/cli_eval.d.ts +172 -9
  276. package/dist/types/cli/utils/cleanup.d.ts +18 -0
  277. package/dist/types/cli/utils/envs.d.ts +13 -3
  278. package/dist/types/cli/utils/evals.d.ts +64 -1
  279. package/dist/types/cli/utils/logs.d.ts +20 -3
  280. package/dist/types/cli/utils/path_validation.d.ts +30 -0
  281. package/dist/types/code_executors/container_code_executor.d.ts +62 -9
  282. package/dist/types/common.d.ts +21 -18
  283. package/dist/types/context/compaction_utils.d.ts +13 -1
  284. package/dist/types/errors/input_validation_error.d.ts +2 -1
  285. package/dist/types/events/event.d.ts +3 -0
  286. package/dist/types/features/feature_registry.d.ts +1 -0
  287. package/dist/types/index.d.ts +11 -6
  288. package/dist/types/plugins/base_plugin.d.ts +50 -31
  289. package/dist/types/plugins/plugin_manager.d.ts +13 -0
  290. package/dist/types/runner/runner.d.ts +11 -0
  291. package/dist/types/sessions/base_session_service.d.ts +5 -2
  292. package/dist/types/sessions/database_session_service.d.ts +17 -1
  293. package/dist/types/sessions/db/operations.d.ts +2 -1
  294. package/dist/types/sessions/db/schema.d.ts +5 -3
  295. package/dist/types/sessions/stale_session_error.d.ts +21 -0
  296. package/dist/types/skills/loader.d.ts +3 -2
  297. package/dist/types/telemetry/api/instrumentation.d.ts +259 -0
  298. package/dist/types/telemetry/api/internal/common/accumulators.d.ts +91 -0
  299. package/dist/types/telemetry/api/internal/common/attributes.d.ts +90 -0
  300. package/dist/types/telemetry/api/internal/common/config.d.ts +61 -0
  301. package/dist/types/telemetry/api/internal/common/error.d.ts +29 -0
  302. package/dist/types/telemetry/api/internal/common/finish_reason.d.ts +18 -0
  303. package/dist/types/telemetry/api/internal/common/genai_messages.d.ts +26 -0
  304. package/dist/types/telemetry/api/internal/common/http_exchange.d.ts +50 -0
  305. package/dist/types/telemetry/api/internal/common/provider_name.d.ts +16 -0
  306. package/dist/types/telemetry/api/internal/common/redaction.d.ts +14 -0
  307. package/dist/types/telemetry/api/internal/common/serialization.d.ts +18 -0
  308. package/dist/types/telemetry/api/internal/common/token_usage.d.ts +47 -0
  309. package/dist/types/telemetry/api/internal/logs/inference.d.ts +15 -0
  310. package/dist/types/telemetry/api/internal/logs/logger.d.ts +13 -0
  311. package/dist/types/telemetry/api/internal/logs/mcp.d.ts +31 -0
  312. package/dist/types/telemetry/api/internal/metrics/agent.d.ts +28 -0
  313. package/dist/types/telemetry/api/internal/metrics/inference_start_hook.d.ts +12 -0
  314. package/dist/types/telemetry/api/internal/metrics/meters.d.ts +57 -0
  315. package/dist/types/telemetry/api/internal/metrics/tool.d.ts +44 -0
  316. package/dist/types/telemetry/api/internal/metrics/workflow.d.ts +32 -0
  317. package/dist/types/telemetry/api/internal/trace/agent.d.ts +14 -0
  318. package/dist/types/telemetry/api/internal/trace/compaction.d.ts +20 -0
  319. package/dist/types/telemetry/api/internal/trace/inference.d.ts +31 -0
  320. package/dist/types/telemetry/api/internal/trace/live.d.ts +21 -0
  321. package/dist/types/telemetry/api/internal/trace/node.d.ts +22 -0
  322. package/dist/types/telemetry/api/internal/trace/propagation.d.ts +22 -0
  323. package/dist/types/telemetry/api/internal/trace/tool.d.ts +57 -0
  324. package/dist/types/telemetry/api/internal/trace/tracer.d.ts +31 -0
  325. package/dist/types/telemetry/api/internal/trace/workflow.d.ts +21 -0
  326. package/dist/types/telemetry/export/agent_engine.d.ts +23 -0
  327. package/dist/types/telemetry/export/agent_runtime.d.ts +40 -0
  328. package/dist/types/telemetry/export/google_cloud.d.ts +189 -0
  329. package/dist/types/telemetry/export/request_driven_metric_reader.d.ts +144 -0
  330. package/dist/types/telemetry/{setup.d.ts → export/setup.d.ts} +3 -0
  331. package/dist/types/tools/agent_tool.d.ts +1 -1
  332. package/dist/types/tools/apihub_tool/apihub_toolset.d.ts +14 -21
  333. package/dist/types/tools/application_integration_tool/application_integration_toolset.d.ts +32 -9
  334. package/dist/types/tools/application_integration_tool/clients/connections_client.d.ts +35 -12
  335. package/dist/types/tools/application_integration_tool/clients/integration_client.d.ts +3 -3
  336. package/dist/types/tools/application_integration_tool/integration_connector_tool.d.ts +70 -0
  337. package/dist/types/tools/base_toolset.d.ts +7 -6
  338. package/dist/types/tools/computer_use/base_computer.d.ts +281 -0
  339. package/dist/types/tools/computer_use/computer_use_actions.d.ts +53 -0
  340. package/dist/types/tools/computer_use/computer_use_tool.d.ts +108 -0
  341. package/dist/types/tools/computer_use/computer_use_toolset.d.ts +132 -0
  342. package/dist/types/tools/google_api_tool/google_api_tool.d.ts +10 -3
  343. package/dist/types/tools/google_api_tool/google_api_toolset.d.ts +57 -0
  344. package/dist/types/tools/google_api_tool/google_api_toolsets.d.ts +48 -0
  345. package/dist/types/tools/google_api_tool/googleapi_to_openapi_converter.d.ts +5 -4
  346. package/dist/types/tools/google_api_tool/index.d.ts +4 -5
  347. package/dist/types/tools/load_artifacts_tool.d.ts +18 -1
  348. package/dist/types/tools/load_memory_tool.d.ts +32 -4
  349. package/dist/types/tools/mcp/mcp_session_manager.d.ts +16 -0
  350. package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +8 -8
  351. package/dist/types/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.d.ts +12 -0
  352. package/dist/types/tools/openapi_tool/openapi_spec_parser/operation_parser.d.ts +15 -3
  353. package/dist/types/tools/openapi_tool/openapi_toolset.d.ts +5 -0
  354. package/dist/types/tools/openapi_tool/rest_api_tool.d.ts +10 -0
  355. package/dist/types/tools/toolbox_toolset.d.ts +154 -0
  356. package/dist/types/utils/async_queue.d.ts +14 -0
  357. package/dist/types/utils/client_labels.d.ts +2 -1
  358. package/dist/types/utils/env_aware_utils.d.ts +11 -0
  359. package/dist/types/utils/error_utils.d.ts +4 -0
  360. package/dist/types/utils/gemini_schema_util.d.ts +29 -0
  361. package/dist/types/utils/id_provider.d.ts +43 -0
  362. package/dist/types/utils/model_name.d.ts +8 -0
  363. package/dist/types/utils/output_schema_utils.d.ts +3 -2
  364. package/dist/types/utils/simple_zod_to_json.d.ts +1 -2
  365. package/dist/types/utils/ssrf_guard.d.ts +2 -0
  366. package/dist/types/version.d.ts +1 -1
  367. package/dist/types/workflow/index.d.ts +1 -1
  368. package/dist/types/workflow/nodes/parallel_worker.d.ts +8 -1
  369. package/dist/web/index_web.js +94 -88
  370. package/dist/web/index_web.js.map +4 -4
  371. package/package.json +43 -38
  372. package/dist/cjs/agents/remote_agent.js +0 -187
  373. package/dist/cjs/telemetry/google_cloud.js +0 -116
  374. package/dist/cjs/telemetry/tracing.js +0 -350
  375. package/dist/cjs/tools/crewai_tool.js +0 -132
  376. package/dist/cjs/tools/google_api_tool/google_api_tool_set.js +0 -226
  377. package/dist/cjs/tools/google_api_tool/google_api_tool_sets.js +0 -58
  378. package/dist/cjs/tools/langchain_tool.js +0 -172
  379. package/dist/cjs/tools/toolbox_tool.js +0 -108
  380. package/dist/esm/agents/remote_agent.js +0 -164
  381. package/dist/esm/telemetry/google_cloud.js +0 -99
  382. package/dist/esm/telemetry/setup.js +0 -89
  383. package/dist/esm/telemetry/tracing.js +0 -315
  384. package/dist/esm/tools/crewai_tool.js +0 -107
  385. package/dist/esm/tools/google_api_tool/google_api_tool_set.js +0 -188
  386. package/dist/esm/tools/google_api_tool/google_api_tool_sets.js +0 -24
  387. package/dist/esm/tools/langchain_tool.js +0 -148
  388. package/dist/esm/tools/toolbox_tool.js +0 -80
  389. package/dist/types/agents/remote_agent.d.ts +0 -68
  390. package/dist/types/telemetry/google_cloud.d.ts +0 -9
  391. package/dist/types/telemetry/tracing.d.ts +0 -129
  392. package/dist/types/tools/crewai_tool.d.ts +0 -85
  393. package/dist/types/tools/google_api_tool/google_api_tool_set.d.ts +0 -78
  394. package/dist/types/tools/google_api_tool/google_api_tool_sets.d.ts +0 -33
  395. package/dist/types/tools/langchain_tool.d.ts +0 -103
  396. package/dist/types/tools/toolbox_tool.d.ts +0 -73
@@ -7,6 +7,13 @@ import { FunctionDeclaration } from '@google/genai';
7
7
  import { BaseTool, RunAsyncToolRequest } from '../base_tool.js';
8
8
  import { RestApiTool } from '../openapi_tool/rest_api_tool.js';
9
9
  declare const GOOGLE_API_TOOL_SIGNATURE_SYMBOL: unique symbol;
10
+ /**
11
+ * Options for constructing a {@link GoogleApiTool}.
12
+ */
13
+ export interface GoogleApiToolOptions {
14
+ clientId?: string;
15
+ clientSecret?: string;
16
+ }
10
17
  /**
11
18
  * Type guard to check if an object is an instance of {@link GoogleApiTool}.
12
19
  */
@@ -17,14 +24,14 @@ export declare function isGoogleApiTool(obj: unknown): obj is GoogleApiTool;
17
24
  */
18
25
  export declare class GoogleApiTool extends BaseTool {
19
26
  readonly [GOOGLE_API_TOOL_SIGNATURE_SYMBOL] = true;
20
- readonly restApiTool: RestApiTool;
21
- constructor(restApiTool: RestApiTool);
27
+ private readonly restApiTool;
28
+ constructor(restApiTool: RestApiTool, options?: GoogleApiToolOptions);
22
29
  _getDeclaration(): FunctionDeclaration;
23
30
  runAsync(request: RunAsyncToolRequest): Promise<unknown>;
24
31
  /**
25
32
  * Configures OpenID Connect OAuth2 client credentials on the underlying
26
33
  * {@link RestApiTool}.
27
34
  */
28
- configureAuth(clientId: string, clientSecret: string): void;
35
+ configureAuth(clientId?: string, clientSecret?: string): void;
29
36
  }
30
37
  export {};
@@ -0,0 +1,57 @@
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 { BaseToolset, ToolPredicate } from '../base_toolset.js';
8
+ import { GoogleApiTool } from './google_api_tool.js';
9
+ declare const GOOGLE_API_TOOLSET_SIGNATURE_SYMBOL: unique symbol;
10
+ /**
11
+ * Options for constructing a {@link GoogleApiToolset}.
12
+ */
13
+ export interface GoogleApiToolsetOptions {
14
+ apiName?: string;
15
+ apiVersion?: string;
16
+ clientId?: string;
17
+ clientSecret?: string;
18
+ toolFilter?: ToolPredicate | string[];
19
+ scopes?: string[];
20
+ }
21
+ /**
22
+ * Type guard to check if an object is an instance of {@link GoogleApiToolset}.
23
+ */
24
+ export declare function isGoogleApiToolset(obj: unknown): obj is GoogleApiToolset;
25
+ /**
26
+ * Toolset that wraps Google Discovery API operations as {@link GoogleApiTool}
27
+ * instances configured for Google OpenID Connect authentication.
28
+ */
29
+ export declare class GoogleApiToolset extends BaseToolset {
30
+ readonly [GOOGLE_API_TOOLSET_SIGNATURE_SYMBOL] = true;
31
+ toolFilter: ToolPredicate | string[];
32
+ readonly apiName?: string;
33
+ readonly apiVersion?: string;
34
+ readonly scopes?: string[];
35
+ private clientId?;
36
+ private clientSecret?;
37
+ private openapiToolset?;
38
+ private loadingPromise?;
39
+ private tools;
40
+ constructor(options?: GoogleApiToolsetOptions);
41
+ private loadToolsetWithOidcAuth;
42
+ private ensureToolsLoaded;
43
+ /**
44
+ * Returns all tools in the toolset matching the active `toolFilter`.
45
+ */
46
+ getTools(context?: ReadonlyContext): Promise<GoogleApiTool[]>;
47
+ /**
48
+ * Updates the tool filter used by {@link getTools}.
49
+ */
50
+ setToolFilter(toolFilter: ToolPredicate | string[]): void;
51
+ /**
52
+ * Configures OAuth2 client ID and secret across all tools in the toolset.
53
+ */
54
+ configureAuth(clientId?: string, clientSecret?: string): void;
55
+ close(): Promise<void>;
56
+ }
57
+ export {};
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GoogleApiToolset, type GoogleApiToolsetOptions } from './google_api_toolset.js';
7
+ /**
8
+ * Toolset for the Google BigQuery v2 API.
9
+ */
10
+ export declare class BigQueryToolset extends GoogleApiToolset {
11
+ constructor(options?: GoogleApiToolsetOptions);
12
+ }
13
+ /**
14
+ * Toolset for the Google Calendar v3 API.
15
+ */
16
+ export declare class CalendarToolset extends GoogleApiToolset {
17
+ constructor(options?: GoogleApiToolsetOptions);
18
+ }
19
+ /**
20
+ * Toolset for the Gmail v1 API.
21
+ */
22
+ export declare class GmailToolset extends GoogleApiToolset {
23
+ constructor(options?: GoogleApiToolsetOptions);
24
+ }
25
+ /**
26
+ * Toolset for the YouTube Data v3 API.
27
+ */
28
+ export declare class YoutubeToolset extends GoogleApiToolset {
29
+ constructor(options?: GoogleApiToolsetOptions);
30
+ }
31
+ /**
32
+ * Toolset for the Google Slides v1 API.
33
+ */
34
+ export declare class SlidesToolset extends GoogleApiToolset {
35
+ constructor(options?: GoogleApiToolsetOptions);
36
+ }
37
+ /**
38
+ * Toolset for the Google Sheets v4 API.
39
+ */
40
+ export declare class SheetsToolset extends GoogleApiToolset {
41
+ constructor(options?: GoogleApiToolsetOptions);
42
+ }
43
+ /**
44
+ * Toolset for the Google Docs v1 API.
45
+ */
46
+ export declare class DocsToolset extends GoogleApiToolset {
47
+ constructor(options?: GoogleApiToolsetOptions);
48
+ }
@@ -49,6 +49,7 @@ export interface GoogleApiSchema {
49
49
  export interface GoogleApiMethod {
50
50
  id?: string;
51
51
  path?: string;
52
+ flatPath?: string;
52
53
  httpMethod?: string;
53
54
  description?: string;
54
55
  parameters?: Record<string, GoogleApiParameter>;
@@ -144,10 +145,10 @@ export declare function convertResources(resources: Record<string, GoogleApiReso
144
145
  * Converts Google API Discovery documents into OpenAPI v3.0.0 specifications.
145
146
  */
146
147
  export declare class GoogleApiToOpenApiConverter {
147
- readonly apiName: string;
148
- readonly apiVersion: string;
149
- googleApiSpec: GoogleApiSpec | null;
150
- openapiSpec: OpenAPIV3.Document;
148
+ private readonly apiName;
149
+ private readonly apiVersion;
150
+ private googleApiSpec;
151
+ private openapiSpec;
151
152
  constructor(apiName: string, apiVersion: string);
152
153
  /**
153
154
  * Fetches the Google API specification from the Google Discovery service.
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  export { GoogleApiTool, isGoogleApiTool } from './google_api_tool.js';
7
- export { GoogleApiToolSet, isGoogleApiToolSet } from './google_api_tool_set.js';
8
- export type { GoogleApiToolSetOptions, LoadToolSetWithOidcAuthOptions, } from './google_api_tool_set.js';
9
- export { bigqueryToolSet, calendarToolSet, docsToolSet, gmailToolSet, sheetsToolSet, slidesToolSet, youtubeToolSet, } from './google_api_tool_sets.js';
10
- export { GoogleApiToOpenApiConverter } from './googleapi_to_openapi_converter.js';
11
- export type { GoogleApiMethod, GoogleApiOAuth2Scope, GoogleApiParameter, GoogleApiResource, GoogleApiSchema, GoogleApiSpec, } from './googleapi_to_openapi_converter.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,25 @@
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
+ * @param options Optional settings controlling how inline media and file
19
+ * references are formatted.
20
+ * @return The artifact itself, or a text part that replaces it.
21
+ */
22
+ export declare function asSafePartForLlm(artifact: Part, artifactName: string, options?: {
23
+ inlineMediaAsPlaceholder?: boolean;
24
+ }): Part;
8
25
  /**
9
26
  * A tool that loads the artifacts and adds them to the session.
10
27
  */
@@ -4,16 +4,44 @@
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';
8
9
  /**
9
- * A tool that loads the memory for the current user.
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
+ * By default, `memories` contains complete {@link MemoryEntry} objects.
24
+ * When {@link LoadMemoryToolOptions.textOnlyContent} is `true`, each entry
25
+ * contains a flattened `string` in `content` alongside `author` and
26
+ * `timestamp`.
27
+ */
28
+ export interface LoadMemoryResponse<T = MemoryEntry> {
29
+ memories: T[];
30
+ }
31
+ /**
32
+ * A tool that loads memory entries for the current user.
10
33
  *
11
- * NOTE: Currently this tool only uses text part from the memory.
34
+ * By default, returns complete {@link MemoryEntry} objects.
12
35
  */
13
36
  export declare class LoadMemoryTool extends BaseTool {
14
- constructor();
37
+ private readonly textOnlyContent;
38
+ constructor(options?: LoadMemoryToolOptions);
15
39
  _getDeclaration(): FunctionDeclaration | undefined;
16
- runAsync({ args, toolContext, }: RunAsyncToolRequest): Promise<unknown>;
40
+ runAsync({ args, toolContext }: RunAsyncToolRequest): Promise<LoadMemoryResponse<MemoryEntry | {
41
+ content: string;
42
+ author?: string;
43
+ timestamp?: string;
44
+ }>>;
17
45
  processLlmRequest(request: ToolProcessLlmRequest): Promise<void>;
18
46
  }
19
47
  /**
@@ -7,6 +7,7 @@ import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
7
7
  import type { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
8
8
  import type { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
9
9
  import type { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
10
+ import type { RequestOptions } from '@modelcontextprotocol/sdk/shared/protocol.js';
10
11
  /**
11
12
  * Defines the parameters for establishing a connection to an MCP server using
12
13
  * standard input/output (stdio). This is typically used for running MCP servers
@@ -15,6 +16,10 @@ import type { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol
15
16
  export interface StdioConnectionParams {
16
17
  type: 'StdioConnectionParams';
17
18
  serverParams: StdioServerParameters;
19
+ /**
20
+ * Request timeout in seconds for stdio MCP operations. When unset, the MCP
21
+ * SDK applies its own default request timeout.
22
+ */
18
23
  timeout?: number;
19
24
  }
20
25
  /**
@@ -94,6 +99,17 @@ export declare class MCPSessionManager {
94
99
  private readonly connectionParams;
95
100
  private readonly activeSessions;
96
101
  constructor(connectionParams: MCPConnectionParams);
102
+ /**
103
+ * Builds per-request options for MCP client operations.
104
+ *
105
+ * For a stdio connection with a configured `timeout`, the timeout is
106
+ * converted from seconds to milliseconds. Otherwise the MCP SDK applies its
107
+ * own default request timeout.
108
+ *
109
+ * @param signal Optional abort signal to attach to the request.
110
+ * @return The request options for the MCP SDK client.
111
+ */
112
+ getRequestOptions(signal?: AbortSignal): RequestOptions;
97
113
  createSession(): Promise<Client>;
98
114
  closeSession(client: Client): Promise<void>;
99
115
  getActiveSessions(): Client[];
@@ -86,7 +86,7 @@ export declare function tokenToSchemeCredential(tokenType: 'apikey' | 'oauth2Tok
86
86
  * @param scopes The scopes to request.
87
87
  * @returns A `[scheme, credential]` pair.
88
88
  */
89
- export declare function serviceAccountDictToSchemeCredential(config: Record<string, unknown>, scopes: string[]): [AuthScheme, AuthCredential];
89
+ export declare function serviceAccountRecordToSchemeCredential(config: Record<string, unknown>, scopes: string[]): [AuthScheme, AuthCredential];
90
90
  /**
91
91
  * Creates a bearer scheme and a service-account credential from an already
92
92
  * built `ServiceAccount`.
@@ -99,16 +99,16 @@ export declare function serviceAccountSchemeCredential(config: ServiceAccount):
99
99
  * Builds an OpenID Connect scheme and credential from a configuration object
100
100
  * and a client-secret object.
101
101
  *
102
- * @param configDict An OpenID Connect configuration. Snake_case keys, as a
102
+ * @param configRecord An OpenID Connect configuration. Snake_case keys, as a
103
103
  * discovery document delivers them, are accepted and normalized.
104
104
  * @param scopes The scopes to request.
105
- * @param credentialDict The Google OAuth client secret. Its keys stay
105
+ * @param credentialRecord The Google OAuth client secret. Its keys stay
106
106
  * snake_case, because it is an on-disk wire format. A `{web: {…}}` or
107
107
  * `{installed: {…}}` wrapper is unwrapped.
108
108
  * @returns A `[scheme, credential]` pair.
109
109
  * @throws Error When the configuration or the client secret is incomplete.
110
110
  */
111
- export declare function openidDictToSchemeCredential(configDict: Record<string, unknown>, scopes: string[], credentialDict: Record<string, unknown>): [OpenIdConnectWithConfig, AuthCredential];
111
+ export declare function openidRecordToSchemeCredential(configRecord: Record<string, unknown>, scopes: string[], credentialRecord: Record<string, unknown>): [OpenIdConnectWithConfig, AuthCredential];
112
112
  /**
113
113
  * Fetches an OpenID Connect discovery document and pairs it with a client
114
114
  * secret.
@@ -118,12 +118,12 @@ export declare function openidDictToSchemeCredential(configDict: Record<string,
118
118
  *
119
119
  * @param openidUrl The OpenID Connect discovery URL.
120
120
  * @param scopes The scopes to request.
121
- * @param credentialDict The Google OAuth client secret, keyed snake_case.
121
+ * @param credentialRecord The Google OAuth client secret, keyed snake_case.
122
122
  * @returns A `[scheme, credential]` pair.
123
123
  * @throws Error When the request fails, the body is not a JSON object, or the
124
124
  * configuration is incomplete.
125
125
  */
126
- export declare function openidUrlToSchemeCredential(openidUrl: string, scopes: string[], credentialDict: Record<string, unknown>): Promise<[OpenIdConnectWithConfig, AuthCredential]>;
126
+ export declare function openidUrlToSchemeCredential(openidUrl: string, scopes: string[], credentialRecord: Record<string, unknown>): Promise<[OpenIdConnectWithConfig, AuthCredential]>;
127
127
  /**
128
128
  * Converts a scheme and credential into the tool parameter that carries the
129
129
  * credential, plus the value to send for it.
@@ -144,7 +144,7 @@ export declare function credentialToParam(authScheme: AuthScheme, authCredential
144
144
  * `AuthScheme`.
145
145
  *
146
146
  * @example
147
- * const scheme = dictToAuthScheme({
147
+ * const scheme = recordToAuthScheme({
148
148
  * type: 'apiKey',
149
149
  * in: 'header',
150
150
  * name: 'X-API-Key',
@@ -155,4 +155,4 @@ export declare function credentialToParam(authScheme: AuthScheme, authCredential
155
155
  * @throws Error When `type` is missing or unrecognised, or the rest of the
156
156
  * object does not match the shape that type requires.
157
157
  */
158
- export declare function dictToAuthScheme(data: Record<string, unknown>): AuthScheme;
158
+ export declare function recordToAuthScheme(data: Record<string, unknown>): AuthScheme;
@@ -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
@@ -96,6 +104,9 @@ export declare class OperationParser {
96
104
  /**
97
105
  * Gets the Python-style type hint of the return value.
98
106
  *
107
+ * @deprecated Legacy Python type-hint helper retained for compatibility. In
108
+ * `adk-js`, tool declarations pass the JSON schema from
109
+ * {@link OperationParser.getJsonSchema} directly to the model.
99
110
  * @returns A type name such as `str`, or `Any` when the operation declares
100
111
  * no typed 2xx response.
101
112
  */
@@ -104,9 +115,10 @@ export declare class OperationParser {
104
115
  * Generates a Python-style docstring describing the operation, every
105
116
  * parameter and the return value.
106
117
  *
107
- * The type names inside it are Python's, because the artifact is a docstring
108
- * in adk-python's format and the same text reaches the model in both SDKs.
109
- *
118
+ * @deprecated Legacy Python docstring helper retained for compatibility. In
119
+ * `adk-js`, tool declarations use {@link OperationParser.getDescription}
120
+ * and {@link OperationParser.getJsonSchema} rather than sending a Python
121
+ * docstring to the model.
110
122
  * @returns The generated docstring.
111
123
  */
112
124
  getPydocString(): string;
@@ -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.
@@ -0,0 +1,154 @@
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 functions 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 functions 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.
53
+ */
54
+ loadTool?: (toolName: string, authTokenGetters?: Record<string, () => string | Promise<string>>, boundParams?: Record<string, unknown>) => BaseTool | ToolboxToolLike | ((...args: never[]) => unknown) | Promise<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>;
55
+ /**
56
+ * Loads a toolset by name.
57
+ */
58
+ loadToolset?: (toolsetName: string, authTokenGetters?: Record<string, () => string | Promise<string>>, boundParams?: Record<string, unknown>) => Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)> | Promise<Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>>;
59
+ /**
60
+ * Closes the underlying client resources.
61
+ */
62
+ close?: () => void | Promise<void>;
63
+ }
64
+ /**
65
+ * Configuration options for {@link ToolboxToolset}.
66
+ */
67
+ export interface ToolboxToolsetOptions {
68
+ /**
69
+ * The URL of the Toolbox server. Required when `client` is not provided.
70
+ */
71
+ serverUrl?: string;
72
+ /**
73
+ * The name of the Toolbox toolset to load.
74
+ */
75
+ toolsetName?: string;
76
+ /**
77
+ * The names of the individual tools to load.
78
+ */
79
+ toolNames?: readonly string[];
80
+ /**
81
+ * Mapping of authentication service names to functions that return the
82
+ * corresponding authentication token.
83
+ */
84
+ authTokenGetters?: Record<string, () => string | Promise<string>>;
85
+ /**
86
+ * Mapping of parameter names to bind to fixed values or functions that
87
+ * produce values as needed.
88
+ */
89
+ boundParams?: Record<string, unknown>;
90
+ /**
91
+ * Optional pre-configured Toolbox client instance.
92
+ */
93
+ client?: ToolboxToolsetClientLike;
94
+ /**
95
+ * Optional filter to select which tools are exposed to the LLM.
96
+ */
97
+ toolFilter?: ToolPredicate | string[];
98
+ /**
99
+ * Optional prefix prepended (`${prefix}_`) to loaded tool names.
100
+ */
101
+ prefix?: string;
102
+ }
103
+ declare const TOOLBOX_TOOLSET_SIGNATURE_SYMBOL: unique symbol;
104
+ /**
105
+ * Type guard to check if an object is an instance of {@link ToolboxToolset}.
106
+ */
107
+ export declare function isToolboxToolset(obj: unknown): obj is ToolboxToolset;
108
+ /**
109
+ * Provides asynchronous access to Toolbox tools and toolsets as a
110
+ * {@link BaseToolset}.
111
+ */
112
+ export declare class ToolboxToolset extends BaseToolset {
113
+ /** A unique symbol to identify ADK ToolboxToolset class. */
114
+ readonly [TOOLBOX_TOOLSET_SIGNATURE_SYMBOL] = true;
115
+ /**
116
+ * The URL of the Toolbox server, if configured.
117
+ */
118
+ readonly serverUrl?: string;
119
+ /**
120
+ * The name of the Toolbox toolset to load, if configured.
121
+ */
122
+ readonly toolsetName?: string;
123
+ /**
124
+ * The names of the individual tools to load, if configured.
125
+ */
126
+ readonly toolNames?: readonly string[];
127
+ /**
128
+ * Mapping of authentication service names to token getters.
129
+ */
130
+ readonly authTokenGetters: Record<string, () => string | Promise<string>>;
131
+ /**
132
+ * Mapping of parameter names to bound values or value getters.
133
+ */
134
+ readonly boundParams: Record<string, unknown>;
135
+ /**
136
+ * The underlying Toolbox client instance.
137
+ */
138
+ readonly toolboxClient: ToolboxToolsetClientLike;
139
+ constructor(options: ToolboxToolsetOptions);
140
+ /**
141
+ * @deprecated Use `new ToolboxToolset({serverUrl, ...options})` instead.
142
+ */
143
+ constructor(serverUrl: string, options: Omit<ToolboxToolsetOptions, 'serverUrl'>);
144
+ /**
145
+ * Loads the configured toolset and/or individual tools from the Toolbox
146
+ * client and returns the selected {@link BaseTool} instances.
147
+ */
148
+ getTools(context?: ReadonlyContext): Promise<BaseTool[]>;
149
+ /**
150
+ * Closes the underlying Toolbox client.
151
+ */
152
+ close(): Promise<void>;
153
+ }
154
+ export {};
@@ -18,12 +18,16 @@
18
18
  * queue, so a later `close()` can't discard the error.
19
19
  * - {@link push} after close/fail is ignored (the producer has already
20
20
  * signalled completion).
21
+ * - {@link pushAndWait} resolves once the consumer has finished with the item:
22
+ * when it asks for the next one, or when the queue closes or fails.
21
23
  */
22
24
  export declare class AsyncQueue<T> implements AsyncIterable<T> {
23
25
  private queue;
24
26
  private resolvers;
25
27
  private closed;
26
28
  private failure?;
29
+ /** Releases the producer of the item the consumer currently holds. */
30
+ private deliveredAck?;
27
31
  /** Whether the queue has been closed or failed. */
28
32
  get isClosed(): boolean;
29
33
  /** Number of items buffered and not yet consumed. */
@@ -33,6 +37,16 @@ export declare class AsyncQueue<T> implements AsyncIterable<T> {
33
37
  * immediately; otherwise the value is buffered. No-op once closed/failed.
34
38
  */
35
39
  push(value: T): void;
40
+ /**
41
+ * Enqueues a value like {@link push}, and resolves once the consumer has
42
+ * finished with it: when it asks for the next item, or when the queue closes
43
+ * or fails. Resolves at once if the queue is already closed.
44
+ */
45
+ pushAndWait(value: T): Promise<void>;
46
+ private enqueue;
47
+ /** Releases every producer still waiting in {@link pushAndWait}. */
48
+ private releaseAll;
49
+ private releaseDelivered;
36
50
  /**
37
51
  * Signals that production failed. Buffered items are still delivered first;
38
52
  * once the buffer drains, the consumer's next `next()` rejects with `error`.
@@ -41,7 +41,8 @@ export declare function getTrackingHeaders(): Record<string, string>;
41
41
  * single space, so the two differ only for values with repeated or non-space
42
42
  * whitespace. Commas are not treated as separators, so a `Headers` object that
43
43
  * joined two values of one header with `, ` keeps the comma on the first
44
- * token. All other headers keep the caller's name and value.
44
+ * token. Other repeated header names use the platform `Headers` semantics;
45
+ * for example, repeated `Cookie` values are joined with `; `.
45
46
  *
46
47
  * The input is never mutated.
47
48
  *