@google/adk 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) 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/functions.js +199 -25
  5. package/dist/cjs/agents/instructions.js +4 -1
  6. package/dist/cjs/agents/invocation_context.js +26 -4
  7. package/dist/cjs/agents/langgraph_agent.js +152 -0
  8. package/dist/cjs/agents/llm_agent.js +175 -101
  9. package/dist/cjs/agents/processors/code_execution_request_processor.js +10 -6
  10. package/dist/cjs/agents/remote_agent.js +187 -0
  11. package/dist/cjs/artifacts/in_memory_artifact_service.js +14 -0
  12. package/dist/cjs/auth/auth_handler.js +37 -5
  13. package/dist/cjs/auth/auth_schemes.js +9 -0
  14. package/dist/cjs/cli/cli_eval.js +532 -0
  15. package/dist/cjs/cli/utils/envs.js +116 -0
  16. package/dist/cjs/cli/utils/evals.js +137 -0
  17. package/dist/cjs/cli/utils/logs.js +150 -0
  18. package/dist/cjs/code_executors/agent_engine_sandbox_code_executor.js +7 -2
  19. package/dist/cjs/code_executors/code_execution_utils.js +48 -16
  20. package/dist/cjs/code_executors/code_executor_context.js +6 -2
  21. package/dist/cjs/common.js +72 -0
  22. package/dist/cjs/context/summarizers/llm_summarizer.js +12 -10
  23. package/dist/cjs/context/token_based_context_compactor.js +2 -1
  24. package/dist/cjs/events/event.js +4 -2
  25. package/dist/cjs/examples/example_util.js +23 -2
  26. package/dist/cjs/flows/llm_flows/audio_transcriber.js +170 -0
  27. package/dist/cjs/index.js +97 -1
  28. package/dist/cjs/integrations/agent_registry/helpers.js +1 -1
  29. package/dist/cjs/models/gemini_llm_connection.js +16 -8
  30. package/dist/cjs/models/google_llm.js +13 -16
  31. package/dist/cjs/models/llm_response.js +9 -1
  32. package/dist/cjs/models/registry.js +1 -1
  33. package/dist/cjs/models/routed_llm.js +9 -8
  34. package/dist/cjs/planners/plan_re_act_planner.js +1 -1
  35. package/dist/cjs/runner/in_memory_runner.js +6 -11
  36. package/dist/cjs/runner/runner.js +105 -33
  37. package/dist/cjs/sessions/db/operations.js +1 -1
  38. package/dist/cjs/sessions/in_memory_session_service.js +3 -1
  39. package/dist/cjs/sessions/state.js +8 -4
  40. package/dist/cjs/sessions/vertex_ai_session_service.js +34 -15
  41. package/dist/cjs/telemetry/tracing.js +97 -66
  42. package/dist/cjs/tools/agent_tool.js +44 -0
  43. package/dist/cjs/tools/apihub_tool/apihub_toolset.js +142 -0
  44. package/dist/cjs/tools/apihub_tool/clients/apihub_client.js +272 -0
  45. package/dist/cjs/tools/apihub_tool/clients/secret_client.js +148 -0
  46. package/dist/cjs/tools/apihub_tool/clients/service_account.js +48 -0
  47. package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +185 -0
  48. package/dist/cjs/tools/application_integration_tool/clients/cloud_request.js +133 -0
  49. package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +603 -0
  50. package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +219 -0
  51. package/dist/cjs/tools/crewai_tool.js +132 -0
  52. package/dist/cjs/tools/example_tool.js +10 -0
  53. package/dist/cjs/tools/function_tool.js +319 -0
  54. package/dist/cjs/tools/google_api_tool/google_api_tool.js +97 -0
  55. package/dist/cjs/tools/google_api_tool/google_api_tool_set.js +226 -0
  56. package/dist/cjs/tools/google_api_tool/google_api_tool_sets.js +58 -0
  57. package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +440 -0
  58. package/dist/cjs/tools/google_api_tool/index.js +64 -0
  59. package/dist/cjs/tools/langchain_tool.js +172 -0
  60. package/dist/cjs/tools/mcp/index.js +12 -0
  61. package/dist/cjs/tools/mcp/mcp_session_manager.js +25 -0
  62. package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +1 -2
  63. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +46 -2
  64. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -1
  65. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +94 -10
  66. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +14 -2
  67. package/dist/cjs/tools/retrieval/base_retrieval_tool.js +18 -3
  68. package/dist/cjs/tools/toolbox_tool.js +108 -0
  69. package/dist/cjs/utils/env_aware_utils.js +6 -8
  70. package/dist/cjs/utils/error_utils.js +11 -11
  71. package/dist/cjs/utils/file_extension_utils.js +11 -0
  72. package/dist/cjs/utils/file_utils.js +2 -24
  73. package/dist/cjs/utils/gemini_schema_util.js +4 -1
  74. package/dist/cjs/utils/json_utils.js +49 -0
  75. package/dist/cjs/utils/live_connection_utils.js +4 -5
  76. package/dist/cjs/utils/logger_node.js +7 -1
  77. package/dist/cjs/utils/object_notation_utils.js +6 -3
  78. package/dist/cjs/utils/streaming_utils.js +12 -12
  79. package/dist/cjs/version.js +1 -1
  80. package/dist/esm/a2a/a2a_remote_agent.js +4 -1
  81. package/dist/esm/a2a/agent_card.js +103 -27
  82. package/dist/esm/a2a/agent_to_a2a.js +5 -2
  83. package/dist/esm/agents/functions.js +198 -25
  84. package/dist/esm/agents/instructions.js +4 -1
  85. package/dist/esm/agents/invocation_context.js +24 -4
  86. package/dist/esm/agents/langgraph_agent.js +123 -0
  87. package/dist/esm/agents/llm_agent.js +185 -104
  88. package/dist/esm/agents/processors/code_execution_request_processor.js +13 -8
  89. package/dist/esm/agents/remote_agent.js +164 -0
  90. package/dist/esm/artifacts/in_memory_artifact_service.js +14 -0
  91. package/dist/esm/auth/auth_handler.js +37 -5
  92. package/dist/esm/auth/auth_schemes.js +8 -0
  93. package/dist/esm/cli/cli_eval.js +510 -0
  94. package/dist/esm/cli/utils/envs.js +78 -0
  95. package/dist/esm/cli/utils/evals.js +109 -0
  96. package/dist/esm/cli/utils/logs.js +111 -0
  97. package/dist/esm/code_executors/agent_engine_sandbox_code_executor.js +7 -2
  98. package/dist/esm/code_executors/code_execution_utils.js +46 -16
  99. package/dist/esm/code_executors/code_executor_context.js +5 -2
  100. package/dist/esm/common.js +67 -3
  101. package/dist/esm/context/summarizers/llm_summarizer.js +12 -10
  102. package/dist/esm/context/token_based_context_compactor.js +2 -1
  103. package/dist/esm/events/event.js +4 -2
  104. package/dist/esm/examples/example_util.js +21 -1
  105. package/dist/esm/flows/llm_flows/audio_transcriber.js +142 -0
  106. package/dist/esm/index.js +99 -1
  107. package/dist/esm/integrations/agent_registry/helpers.js +1 -1
  108. package/dist/esm/models/gemini_llm_connection.js +16 -8
  109. package/dist/esm/models/google_llm.js +14 -17
  110. package/dist/esm/models/llm_response.js +9 -1
  111. package/dist/esm/models/registry.js +1 -1
  112. package/dist/esm/models/routed_llm.js +9 -8
  113. package/dist/esm/planners/plan_re_act_planner.js +1 -1
  114. package/dist/esm/runner/in_memory_runner.js +6 -11
  115. package/dist/esm/runner/runner.js +105 -33
  116. package/dist/esm/sessions/db/operations.js +1 -1
  117. package/dist/esm/sessions/in_memory_session_service.js +3 -1
  118. package/dist/esm/sessions/state.js +8 -4
  119. package/dist/esm/sessions/vertex_ai_session_service.js +34 -15
  120. package/dist/esm/telemetry/tracing.js +97 -66
  121. package/dist/esm/tools/agent_tool.js +44 -0
  122. package/dist/esm/tools/apihub_tool/apihub_toolset.js +106 -0
  123. package/dist/esm/tools/apihub_tool/clients/apihub_client.js +244 -0
  124. package/dist/esm/tools/apihub_tool/clients/secret_client.js +132 -0
  125. package/dist/esm/tools/apihub_tool/clients/service_account.js +21 -0
  126. package/dist/esm/tools/application_integration_tool/application_integration_toolset.js +163 -0
  127. package/dist/esm/tools/application_integration_tool/clients/cloud_request.js +103 -0
  128. package/dist/esm/tools/application_integration_tool/clients/connections_client.js +561 -0
  129. package/dist/esm/tools/application_integration_tool/clients/integration_client.js +215 -0
  130. package/dist/esm/tools/crewai_tool.js +107 -0
  131. package/dist/esm/tools/example_tool.js +13 -1
  132. package/dist/esm/tools/function_tool.js +316 -0
  133. package/dist/esm/tools/google_api_tool/google_api_tool.js +70 -0
  134. package/dist/esm/tools/google_api_tool/google_api_tool_set.js +188 -0
  135. package/dist/esm/tools/google_api_tool/google_api_tool_sets.js +24 -0
  136. package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +393 -0
  137. package/dist/esm/tools/google_api_tool/index.js +33 -0
  138. package/dist/esm/tools/langchain_tool.js +148 -0
  139. package/dist/esm/tools/mcp/index.js +6 -0
  140. package/dist/esm/tools/mcp/mcp_session_manager.js +25 -0
  141. package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +1 -2
  142. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +50 -3
  143. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -1
  144. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +94 -10
  145. package/dist/esm/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +15 -2
  146. package/dist/esm/tools/retrieval/base_retrieval_tool.js +16 -2
  147. package/dist/esm/tools/toolbox_tool.js +80 -0
  148. package/dist/esm/utils/env_aware_utils.js +6 -8
  149. package/dist/esm/utils/error_utils.js +9 -10
  150. package/dist/esm/utils/file_extension_utils.js +11 -0
  151. package/dist/esm/utils/file_utils.js +2 -23
  152. package/dist/esm/utils/gemini_schema_util.js +4 -1
  153. package/dist/esm/utils/json_utils.js +21 -0
  154. package/dist/esm/utils/live_connection_utils.js +4 -5
  155. package/dist/esm/utils/logger_node.js +7 -1
  156. package/dist/esm/utils/object_notation_utils.js +4 -2
  157. package/dist/esm/utils/streaming_utils.js +11 -11
  158. package/dist/esm/version.js +1 -1
  159. package/dist/types/a2a/a2a_remote_agent.d.ts +9 -0
  160. package/dist/types/a2a/agent_card.d.ts +44 -1
  161. package/dist/types/a2a/agent_to_a2a.d.ts +9 -0
  162. package/dist/types/a2a/index.d.ts +1 -0
  163. package/dist/types/agents/functions.d.ts +33 -1
  164. package/dist/types/agents/invocation_context.d.ts +20 -1
  165. package/dist/types/agents/langgraph_agent.d.ts +153 -0
  166. package/dist/types/agents/remote_agent.d.ts +68 -0
  167. package/dist/types/auth/auth_handler.d.ts +28 -1
  168. package/dist/types/auth/auth_schemes.d.ts +13 -0
  169. package/dist/types/cli/cli_eval.d.ts +173 -0
  170. package/dist/types/cli/utils/envs.d.ts +23 -0
  171. package/dist/types/cli/utils/evals.d.ts +47 -0
  172. package/dist/types/cli/utils/logs.d.ts +38 -0
  173. package/dist/types/code_executors/code_execution_utils.d.ts +39 -0
  174. package/dist/types/code_executors/code_executor_context.d.ts +1 -0
  175. package/dist/types/common.d.ts +27 -4
  176. package/dist/types/events/event.d.ts +4 -0
  177. package/dist/types/examples/example_util.d.ts +17 -0
  178. package/dist/types/flows/llm_flows/audio_transcriber.d.ts +85 -0
  179. package/dist/types/index.d.ts +16 -1
  180. package/dist/types/models/gemini_llm_connection.d.ts +6 -7
  181. package/dist/types/models/routed_llm.d.ts +1 -1
  182. package/dist/types/runner/in_memory_runner.d.ts +2 -1
  183. package/dist/types/runner/runner.d.ts +34 -0
  184. package/dist/types/sessions/state.d.ts +5 -1
  185. package/dist/types/sessions/vertex_ai_session_service.d.ts +8 -0
  186. package/dist/types/skills/skill.d.ts +1 -1
  187. package/dist/types/telemetry/tracing.d.ts +4 -2
  188. package/dist/types/tools/apihub_tool/apihub_toolset.d.ts +122 -0
  189. package/dist/types/tools/apihub_tool/clients/apihub_client.d.ts +142 -0
  190. package/dist/types/tools/apihub_tool/clients/secret_client.d.ts +55 -0
  191. package/dist/types/tools/apihub_tool/clients/service_account.d.ts +11 -0
  192. package/dist/types/tools/application_integration_tool/application_integration_toolset.d.ts +86 -0
  193. package/dist/types/tools/application_integration_tool/clients/cloud_request.d.ts +53 -0
  194. package/dist/types/tools/application_integration_tool/clients/connections_client.d.ts +215 -0
  195. package/dist/types/tools/application_integration_tool/clients/integration_client.d.ts +72 -0
  196. package/dist/types/tools/crewai_tool.d.ts +85 -0
  197. package/dist/types/tools/example_tool.d.ts +10 -0
  198. package/dist/types/tools/function_tool.d.ts +32 -0
  199. package/dist/types/tools/google_api_tool/google_api_tool.d.ts +30 -0
  200. package/dist/types/tools/google_api_tool/google_api_tool_set.d.ts +78 -0
  201. package/dist/types/tools/google_api_tool/google_api_tool_sets.d.ts +33 -0
  202. package/dist/types/tools/google_api_tool/googleapi_to_openapi_converter.d.ts +164 -0
  203. package/dist/types/tools/google_api_tool/index.d.ts +11 -0
  204. package/dist/types/tools/langchain_tool.d.ts +103 -0
  205. package/dist/types/tools/mcp/index.d.ts +3 -0
  206. package/dist/types/tools/mcp/mcp_session_manager.d.ts +34 -1
  207. package/dist/types/tools/mcp/mcp_toolset.d.ts +15 -0
  208. package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +19 -0
  209. package/dist/types/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.d.ts +18 -1
  210. package/dist/types/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.d.ts +2 -1
  211. package/dist/types/tools/retrieval/base_retrieval_tool.d.ts +15 -0
  212. package/dist/types/tools/toolbox_tool.d.ts +73 -0
  213. package/dist/types/utils/env_aware_utils.d.ts +18 -2
  214. package/dist/types/utils/error_utils.d.ts +7 -0
  215. package/dist/types/utils/file_utils.d.ts +6 -1
  216. package/dist/types/utils/gemini_schema_util.d.ts +1 -2
  217. package/dist/types/utils/json_utils.d.ts +11 -0
  218. package/dist/types/utils/object_notation_utils.d.ts +7 -0
  219. package/dist/types/utils/streaming_utils.d.ts +11 -4
  220. package/dist/types/version.d.ts +1 -1
  221. package/dist/web/index_web.js +102 -103
  222. package/dist/web/index_web.js.map +4 -4
  223. package/package.json +8 -3
  224. package/dist/cjs/models/gemini_continuation.js +0 -232
  225. package/dist/esm/models/gemini_continuation.js +0 -205
  226. package/dist/types/models/gemini_continuation.d.ts +0 -59
@@ -26,12 +26,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
26
26
  var function_tool_exports = {};
27
27
  __export(function_tool_exports, {
28
28
  FunctionTool: () => FunctionTool,
29
+ buildFunctionDeclarationForLangchain: () => buildFunctionDeclarationForLangchain,
30
+ buildFunctionDeclarationForParamsForCrewai: () => buildFunctionDeclarationForParamsForCrewai,
31
+ buildFunctionDeclarationUtil: () => buildFunctionDeclarationUtil,
29
32
  isFunctionTool: () => isFunctionTool
30
33
  });
31
34
  module.exports = __toCommonJS(function_tool_exports);
32
35
  var import_genai = require("@google/genai");
33
36
  var import_simple_zod_to_json = require("../utils/simple_zod_to_json.js");
34
37
  var import_base_tool = require("./base_tool.js");
38
+ var import_gemini_schema_util = require("../utils/gemini_schema_util.js");
39
+ var import_schema = require("../utils/schema.js");
35
40
  /**
36
41
  * @license
37
42
  * Copyright 2025 Google LLC
@@ -48,6 +53,27 @@ function toSchema(parameters) {
48
53
  return parameters;
49
54
  }
50
55
  __name(toSchema, "toSchema");
56
+ function toResponseSchema(response) {
57
+ var _a2;
58
+ if ((0, import_simple_zod_to_json.isZodObject)(response)) {
59
+ return (0, import_simple_zod_to_json.zodObjectToSchema)(response);
60
+ }
61
+ if (typeof response === "object" && response !== null && "safeParse" in response && typeof response.safeParse === "function") {
62
+ return (_a2 = (0, import_gemini_schema_util.toGeminiSchema)(
63
+ (0, import_schema.toJsonSchema)(response)
64
+ )) != null ? _a2 : { type: import_genai.Type.TYPE_UNSPECIFIED };
65
+ }
66
+ return response;
67
+ }
68
+ __name(toResponseSchema, "toResponseSchema");
69
+ function isPlainRecord(value) {
70
+ return typeof value === "object" && value !== null && !Array.isArray(value);
71
+ }
72
+ __name(isPlainRecord, "isPlainRecord");
73
+ function isAsyncIterable(value) {
74
+ return typeof value === "object" && value !== null && Symbol.asyncIterator in value && typeof value[Symbol.asyncIterator] === "function";
75
+ }
76
+ __name(isAsyncIterable, "isAsyncIterable");
51
77
  const FUNCTION_TOOL_SIGNATURE_SYMBOL = /* @__PURE__ */ Symbol.for("google.adk.functionTool");
52
78
  function isFunctionTool(obj) {
53
79
  return typeof obj === "object" && obj !== null && FUNCTION_TOOL_SIGNATURE_SYMBOL in obj && obj[FUNCTION_TOOL_SIGNATURE_SYMBOL] === true;
@@ -75,6 +101,7 @@ const _FunctionTool = class _FunctionTool extends (_b = import_base_tool.BaseToo
75
101
  this[_a] = true;
76
102
  this.execute = options.execute;
77
103
  this.parameters = options.parameters;
104
+ this.response = options.response;
78
105
  this.requireConfirmation = (_b2 = options.requireConfirmation) != null ? _b2 : false;
79
106
  }
80
107
  /**
@@ -82,6 +109,14 @@ const _FunctionTool = class _FunctionTool extends (_b = import_base_tool.BaseToo
82
109
  * and parameter schema.
83
110
  */
84
111
  _getDeclaration() {
112
+ if (this.response !== void 0) {
113
+ return {
114
+ name: this.name,
115
+ description: this.description,
116
+ parameters: toSchema(this.parameters),
117
+ response: toResponseSchema(this.response)
118
+ };
119
+ }
85
120
  return {
86
121
  name: this.name,
87
122
  description: this.description,
@@ -114,6 +149,41 @@ const _FunctionTool = class _FunctionTool extends (_b = import_base_tool.BaseToo
114
149
  throw new Error(`Error in tool '${this.name}': ${errorMessage}`);
115
150
  }
116
151
  }
152
+ /**
153
+ * Invokes the tool in live streaming mode, injecting any active input stream
154
+ * from the invocation context and yielding items from the returned stream.
155
+ *
156
+ * @param req The live tool invocation request.
157
+ */
158
+ async *_callLive(req) {
159
+ var _a2;
160
+ const validatedArgs = this.validateArgs(req.args);
161
+ const argsToCall = isPlainRecord(validatedArgs) ? { ...validatedArgs } : { ...req.args };
162
+ const activeTool = (_a2 = req.invocationContext.activeStreamingTools) == null ? void 0 : _a2[this.name];
163
+ if (activeTool == null ? void 0 : activeTool.stream) {
164
+ argsToCall["inputStream"] = activeTool.stream;
165
+ }
166
+ const rawResult = this.execute(
167
+ argsToCall,
168
+ req.toolContext
169
+ );
170
+ if (isAsyncIterable(rawResult)) {
171
+ for await (const item of rawResult) {
172
+ yield item;
173
+ }
174
+ return;
175
+ }
176
+ const awaited = await rawResult;
177
+ if (isAsyncIterable(awaited)) {
178
+ for await (const item of awaited) {
179
+ yield item;
180
+ }
181
+ return;
182
+ }
183
+ if (awaited !== void 0) {
184
+ yield awaited;
185
+ }
186
+ }
117
187
  /**
118
188
  * Whether this call is gated on human approval — the static flag, or the
119
189
  * predicate evaluated against the validated arguments.
@@ -175,8 +245,257 @@ const _FunctionTool = class _FunctionTool extends (_b = import_base_tool.BaseToo
175
245
  };
176
246
  __name(_FunctionTool, "FunctionTool");
177
247
  let FunctionTool = _FunctionTool;
248
+ const SCHEMA_TYPE_MAP = {
249
+ str: import_genai.Type.STRING,
250
+ int: import_genai.Type.INTEGER,
251
+ float: import_genai.Type.NUMBER,
252
+ bool: import_genai.Type.BOOLEAN,
253
+ string: import_genai.Type.STRING,
254
+ integer: import_genai.Type.INTEGER,
255
+ number: import_genai.Type.NUMBER,
256
+ boolean: import_genai.Type.BOOLEAN,
257
+ list: import_genai.Type.ARRAY,
258
+ array: import_genai.Type.ARRAY,
259
+ tuple: import_genai.Type.ARRAY,
260
+ object: import_genai.Type.OBJECT,
261
+ Dict: import_genai.Type.OBJECT,
262
+ List: import_genai.Type.ARRAY,
263
+ Tuple: import_genai.Type.ARRAY,
264
+ Any: import_genai.Type.TYPE_UNSPECIFIED,
265
+ STRING: import_genai.Type.STRING,
266
+ INTEGER: import_genai.Type.INTEGER,
267
+ NUMBER: import_genai.Type.NUMBER,
268
+ BOOLEAN: import_genai.Type.BOOLEAN,
269
+ ARRAY: import_genai.Type.ARRAY,
270
+ OBJECT: import_genai.Type.OBJECT,
271
+ NULL: import_genai.Type.NULL,
272
+ null: import_genai.Type.NULL,
273
+ TYPE_UNSPECIFIED: import_genai.Type.TYPE_UNSPECIFIED
274
+ };
275
+ function annotateNullableFields(schema) {
276
+ const properties = schema["properties"];
277
+ if (!isPlainRecord(properties)) {
278
+ return;
279
+ }
280
+ for (const propertySchema of Object.values(properties)) {
281
+ if (!isPlainRecord(propertySchema)) {
282
+ continue;
283
+ }
284
+ const anyOf = propertySchema["anyOf"];
285
+ if (!Array.isArray(anyOf)) {
286
+ continue;
287
+ }
288
+ for (let i = 0; i < anyOf.length; i++) {
289
+ const branch = anyOf[i];
290
+ if (isPlainRecord(branch) && (branch["type"] === "null" || branch["type"] === import_genai.Type.NULL)) {
291
+ propertySchema["nullable"] = true;
292
+ anyOf.splice(i, 1);
293
+ break;
294
+ }
295
+ }
296
+ }
297
+ }
298
+ __name(annotateNullableFields, "annotateNullableFields");
299
+ function annotateRequiredFields(schema) {
300
+ const properties = schema["properties"];
301
+ if (!isPlainRecord(properties)) {
302
+ schema["required"] = [];
303
+ return;
304
+ }
305
+ const required = [];
306
+ for (const [fieldName, fieldSchema] of Object.entries(properties)) {
307
+ if (isPlainRecord(fieldSchema) && !fieldSchema["nullable"] && !("default" in fieldSchema)) {
308
+ required.push(fieldName);
309
+ }
310
+ }
311
+ schema["required"] = required;
312
+ }
313
+ __name(annotateRequiredFields, "annotateRequiredFields");
314
+ function removeAnyOf(schema) {
315
+ const properties = schema["properties"];
316
+ if (!isPlainRecord(properties)) {
317
+ return;
318
+ }
319
+ for (const propertySchema of Object.values(properties)) {
320
+ if (!isPlainRecord(propertySchema)) {
321
+ continue;
322
+ }
323
+ const unionTypes = propertySchema["anyOf"];
324
+ delete propertySchema["anyOf"];
325
+ if (Array.isArray(unionTypes)) {
326
+ for (const branch of unionTypes) {
327
+ if (isPlainRecord(branch) && branch["type"] !== "null" && branch["type"] !== import_genai.Type.NULL) {
328
+ Object.assign(propertySchema, branch);
329
+ break;
330
+ }
331
+ }
332
+ }
333
+ }
334
+ }
335
+ __name(removeAnyOf, "removeAnyOf");
336
+ function removeDefault(schema) {
337
+ const properties = schema["properties"];
338
+ if (!isPlainRecord(properties)) {
339
+ return;
340
+ }
341
+ for (const propertySchema of Object.values(properties)) {
342
+ if (isPlainRecord(propertySchema)) {
343
+ delete propertySchema["default"];
344
+ }
345
+ }
346
+ }
347
+ __name(removeDefault, "removeDefault");
348
+ function removeNullable(schema) {
349
+ const properties = schema["properties"];
350
+ if (!isPlainRecord(properties)) {
351
+ return;
352
+ }
353
+ for (const propertySchema of Object.values(properties)) {
354
+ if (isPlainRecord(propertySchema)) {
355
+ delete propertySchema["nullable"];
356
+ }
357
+ }
358
+ }
359
+ __name(removeNullable, "removeNullable");
360
+ function removeTitle(schema) {
361
+ const properties = schema["properties"];
362
+ if (!isPlainRecord(properties)) {
363
+ return;
364
+ }
365
+ for (const propertySchema of Object.values(properties)) {
366
+ if (isPlainRecord(propertySchema)) {
367
+ delete propertySchema["title"];
368
+ }
369
+ }
370
+ }
371
+ __name(removeTitle, "removeTitle");
372
+ function processParameterSchema(vertexai, schema) {
373
+ annotateNullableFields(schema);
374
+ annotateRequiredFields(schema);
375
+ if (!vertexai) {
376
+ removeAnyOf(schema);
377
+ removeDefault(schema);
378
+ removeNullable(schema);
379
+ removeTitle(schema);
380
+ }
381
+ return schema;
382
+ }
383
+ __name(processParameterSchema, "processParameterSchema");
384
+ function mapPropertySchemaType(propertySchema) {
385
+ var _a2, _b2;
386
+ if (typeof propertySchema["type"] === "string") {
387
+ propertySchema["type"] = (_a2 = SCHEMA_TYPE_MAP[propertySchema["type"]]) != null ? _a2 : import_genai.Type.TYPE_UNSPECIFIED;
388
+ if (propertySchema["type"] === import_genai.Type.ARRAY && isPlainRecord(propertySchema["items"])) {
389
+ mapPropertySchemaType(propertySchema["items"]);
390
+ }
391
+ }
392
+ if (isPlainRecord(propertySchema["properties"])) {
393
+ for (const nestedProp of Object.values(propertySchema["properties"])) {
394
+ if (isPlainRecord(nestedProp)) {
395
+ mapPropertySchemaType(nestedProp);
396
+ }
397
+ }
398
+ }
399
+ if (Array.isArray(propertySchema["anyOf"])) {
400
+ for (const branch of propertySchema["anyOf"]) {
401
+ if (isPlainRecord(branch) && typeof branch["type"] === "string") {
402
+ branch["type"] = (_b2 = SCHEMA_TYPE_MAP[branch["type"]]) != null ? _b2 : import_genai.Type.TYPE_UNSPECIFIED;
403
+ propertySchema["type"] = branch["type"];
404
+ }
405
+ }
406
+ }
407
+ }
408
+ __name(mapPropertySchemaType, "mapPropertySchemaType");
409
+ function mapSchemaTypes(schema) {
410
+ const properties = schema["properties"];
411
+ if (!isPlainRecord(properties)) {
412
+ return;
413
+ }
414
+ for (const propertySchema of Object.values(properties)) {
415
+ if (isPlainRecord(propertySchema)) {
416
+ mapPropertySchemaType(propertySchema);
417
+ }
418
+ }
419
+ }
420
+ __name(mapSchemaTypes, "mapSchemaTypes");
421
+ function resolveReturnSchema(func, beforeParamSchema) {
422
+ var _a2, _b2, _c;
423
+ const funcObj = typeof func === "function" || isPlainRecord(func) ? func : void 0;
424
+ const responseCandidate = (_a2 = funcObj == null ? void 0 : funcObj.response) != null ? _a2 : beforeParamSchema["response"];
425
+ if (responseCandidate !== void 0) {
426
+ return toResponseSchema(responseCandidate);
427
+ }
428
+ const returnTypeCandidate = (_b2 = funcObj == null ? void 0 : funcObj.returnType) != null ? _b2 : typeof beforeParamSchema["returnType"] === "string" ? beforeParamSchema["returnType"] : void 0;
429
+ if (typeof returnTypeCandidate === "string") {
430
+ return {
431
+ type: (_c = SCHEMA_TYPE_MAP[returnTypeCandidate]) != null ? _c : import_genai.Type.TYPE_UNSPECIFIED
432
+ };
433
+ }
434
+ if (typeof func === "function") {
435
+ return { type: import_genai.Type.TYPE_UNSPECIFIED };
436
+ }
437
+ return void 0;
438
+ }
439
+ __name(resolveReturnSchema, "resolveReturnSchema");
440
+ function buildFunctionDeclarationUtil(vertexai, name, description, func, beforeParamSchema) {
441
+ const schemaCopy = structuredClone(beforeParamSchema);
442
+ mapSchemaTypes(schemaCopy);
443
+ const properties = isPlainRecord(schemaCopy["properties"]) ? schemaCopy["properties"] : {};
444
+ const hasProperties = Object.keys(properties).length > 0;
445
+ const declaration = {
446
+ name,
447
+ description
448
+ };
449
+ if (hasProperties) {
450
+ const parameters = {
451
+ type: import_genai.Type.OBJECT,
452
+ properties
453
+ };
454
+ if (Array.isArray(schemaCopy["required"]) && schemaCopy["required"].length > 0) {
455
+ parameters.required = schemaCopy["required"];
456
+ }
457
+ declaration.parameters = parameters;
458
+ }
459
+ if (vertexai) {
460
+ const responseSchema = resolveReturnSchema(func, schemaCopy);
461
+ if (responseSchema !== void 0) {
462
+ declaration.response = responseSchema;
463
+ }
464
+ }
465
+ return declaration;
466
+ }
467
+ __name(buildFunctionDeclarationUtil, "buildFunctionDeclarationUtil");
468
+ function buildFunctionDeclarationForLangchain(vertexai, name, description, func, paramSchema) {
469
+ const rawCopy = structuredClone(paramSchema);
470
+ const explicitRequired = Array.isArray(rawCopy["required"]) ? rawCopy["required"] : void 0;
471
+ delete rawCopy["required"];
472
+ const wrapped = processParameterSchema(vertexai, {
473
+ properties: rawCopy
474
+ });
475
+ const properties = isPlainRecord(wrapped["properties"]) ? { ...wrapped["properties"] } : {};
476
+ const computedRequired = Array.isArray(wrapped["required"]) ? wrapped["required"] : [];
477
+ const requiredFields = explicitRequired !== void 0 ? explicitRequired : computedRequired;
478
+ return buildFunctionDeclarationUtil(vertexai, name, description, func, {
479
+ properties,
480
+ required: requiredFields
481
+ });
482
+ }
483
+ __name(buildFunctionDeclarationForLangchain, "buildFunctionDeclarationForLangchain");
484
+ function buildFunctionDeclarationForParamsForCrewai(vertexai, name, description, func, paramSchema) {
485
+ const processed = processParameterSchema(
486
+ vertexai,
487
+ structuredClone(paramSchema)
488
+ );
489
+ return buildFunctionDeclarationUtil(vertexai, name, description, func, {
490
+ ...processed
491
+ });
492
+ }
493
+ __name(buildFunctionDeclarationForParamsForCrewai, "buildFunctionDeclarationForParamsForCrewai");
178
494
  // Annotate the CommonJS export names for ESM import in node:
179
495
  0 && (module.exports = {
180
496
  FunctionTool,
497
+ buildFunctionDeclarationForLangchain,
498
+ buildFunctionDeclarationForParamsForCrewai,
499
+ buildFunctionDeclarationUtil,
181
500
  isFunctionTool
182
501
  });
@@ -0,0 +1,97 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ "use strict";
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
13
+ var __export = (target, all) => {
14
+ for (var name in all)
15
+ __defProp(target, name, { get: all[name], enumerable: true });
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
24
+ };
25
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
+ var __decorateClass = (decorators, target, key, kind) => {
27
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
28
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
29
+ if (decorator = decorators[i])
30
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
31
+ if (kind && result) __defProp(target, key, result);
32
+ return result;
33
+ };
34
+ var google_api_tool_exports = {};
35
+ __export(google_api_tool_exports, {
36
+ GoogleApiTool: () => GoogleApiTool,
37
+ isGoogleApiTool: () => isGoogleApiTool
38
+ });
39
+ module.exports = __toCommonJS(google_api_tool_exports);
40
+ var import_auth_credential = require("../../auth/auth_credential.js");
41
+ var import_experimental = require("../../utils/experimental.js");
42
+ var import_base_tool = require("../base_tool.js");
43
+ /**
44
+ * @license
45
+ * Copyright 2026 Google LLC
46
+ * SPDX-License-Identifier: Apache-2.0
47
+ */
48
+ var _a, _b;
49
+ const GOOGLE_API_TOOL_SIGNATURE_SYMBOL = /* @__PURE__ */ Symbol.for("google.adk.googleApiTool");
50
+ function isGoogleApiTool(obj) {
51
+ return typeof obj === "object" && obj !== null && GOOGLE_API_TOOL_SIGNATURE_SYMBOL in obj && obj[GOOGLE_API_TOOL_SIGNATURE_SYMBOL] === true;
52
+ }
53
+ __name(isGoogleApiTool, "isGoogleApiTool");
54
+ let GoogleApiTool = class extends (_b = import_base_tool.BaseTool, _a = GOOGLE_API_TOOL_SIGNATURE_SYMBOL, _b) {
55
+ constructor(restApiTool) {
56
+ super({
57
+ name: restApiTool.name,
58
+ description: restApiTool.description,
59
+ isLongRunning: restApiTool.isLongRunning
60
+ });
61
+ this[_a] = true;
62
+ this.restApiTool = restApiTool;
63
+ }
64
+ _getDeclaration() {
65
+ return this.restApiTool._getDeclaration();
66
+ }
67
+ runAsync(request) {
68
+ return this.restApiTool.runAsync(request);
69
+ }
70
+ configureAuth(clientId, clientSecret) {
71
+ this.restApiTool.configureAuthCredential({
72
+ authType: import_auth_credential.AuthCredentialTypes.OPEN_ID_CONNECT,
73
+ oauth2: {
74
+ clientId,
75
+ clientSecret
76
+ }
77
+ });
78
+ }
79
+ };
80
+ __name(GoogleApiTool, "GoogleApiTool");
81
+ __decorateClass([
82
+ import_experimental.experimental
83
+ ], GoogleApiTool.prototype, "_getDeclaration", 1);
84
+ __decorateClass([
85
+ import_experimental.experimental
86
+ ], GoogleApiTool.prototype, "runAsync", 1);
87
+ __decorateClass([
88
+ import_experimental.experimental
89
+ ], GoogleApiTool.prototype, "configureAuth", 1);
90
+ GoogleApiTool = __decorateClass([
91
+ import_experimental.experimental
92
+ ], GoogleApiTool);
93
+ // Annotate the CommonJS export names for ESM import in node:
94
+ 0 && (module.exports = {
95
+ GoogleApiTool,
96
+ isGoogleApiTool
97
+ });
@@ -0,0 +1,226 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ "use strict";
8
+ var __create = Object.create;
9
+ var __defProp = Object.defineProperty;
10
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
+ var __getOwnPropNames = Object.getOwnPropertyNames;
12
+ var __getProtoOf = Object.getPrototypeOf;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
+ // If the importer is in node compatibility mode or this is not an ESM
29
+ // file that has been converted to a CommonJS file using a Babel-
30
+ // compatible transform (i.e. "__esModule" has not been set), then set
31
+ // "default" to the CommonJS "module.exports" for node compatibility.
32
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
+ mod
34
+ ));
35
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
+ var __decorateClass = (decorators, target, key, kind) => {
37
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
38
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
39
+ if (decorator = decorators[i])
40
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
41
+ if (kind && result) __defProp(target, key, result);
42
+ return result;
43
+ };
44
+ var google_api_tool_set_exports = {};
45
+ __export(google_api_tool_set_exports, {
46
+ GoogleApiToolSet: () => GoogleApiToolSet,
47
+ createLazyGoogleApiToolSet: () => createLazyGoogleApiToolSet,
48
+ isGoogleApiToolSet: () => isGoogleApiToolSet
49
+ });
50
+ module.exports = __toCommonJS(google_api_tool_set_exports);
51
+ var fs = __toESM(require("node:fs"), 1);
52
+ var path = __toESM(require("node:path"), 1);
53
+ var import_experimental = require("../../utils/experimental.js");
54
+ var import_base_toolset = require("../base_toolset.js");
55
+ var import_openapi_toolset = require("../openapi_tool/openapi_toolset.js");
56
+ var import_google_api_tool = require("./google_api_tool.js");
57
+ var import_googleapi_to_openapi_converter = require("./googleapi_to_openapi_converter.js");
58
+ /**
59
+ * @license
60
+ * Copyright 2026 Google LLC
61
+ * SPDX-License-Identifier: Apache-2.0
62
+ */
63
+ var _a, _b;
64
+ const GOOGLE_API_TOOL_SET_SIGNATURE_SYMBOL = /* @__PURE__ */ Symbol.for(
65
+ "google.adk.googleApiToolSet"
66
+ );
67
+ const GOOGLE_OIDC_AUTH_ENDPOINT = "https://accounts.google.com/o/oauth2/v2/auth";
68
+ const GOOGLE_OIDC_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token";
69
+ const GOOGLE_OIDC_USERINFO_ENDPOINT = "https://openidconnect.googleapis.com/v1/userinfo";
70
+ const GOOGLE_OIDC_REVOCATION_ENDPOINT = "https://oauth2.googleapis.com/revoke";
71
+ function isGoogleApiToolSet(obj) {
72
+ return typeof obj === "object" && obj !== null && GOOGLE_API_TOOL_SET_SIGNATURE_SYMBOL in obj && obj[GOOGLE_API_TOOL_SET_SIGNATURE_SYMBOL] === true;
73
+ }
74
+ __name(isGoogleApiToolSet, "isGoogleApiToolSet");
75
+ let GoogleApiToolSet = class extends (_b = import_base_toolset.BaseToolset, _a = GOOGLE_API_TOOL_SET_SIGNATURE_SYMBOL, _b) {
76
+ constructor(tools, options = {}) {
77
+ var _a2;
78
+ super((_a2 = options.toolFilter) != null ? _a2 : []);
79
+ this[_a] = true;
80
+ this.apiName = options.apiName;
81
+ this.apiVersion = options.apiVersion;
82
+ if (tools !== void 0) {
83
+ this.tools = tools.map(
84
+ (tool) => (0, import_google_api_tool.isGoogleApiTool)(tool) ? tool : new import_google_api_tool.GoogleApiTool(tool)
85
+ );
86
+ this.toolsLoaded = true;
87
+ } else {
88
+ this.tools = [];
89
+ this.toolsLoaded = false;
90
+ }
91
+ }
92
+ async ensureToolsLoaded() {
93
+ if (this.toolsLoaded || !this.apiName || !this.apiVersion) {
94
+ return;
95
+ }
96
+ if (!this.loadingPromise) {
97
+ const apiName = this.apiName;
98
+ const apiVersion = this.apiVersion;
99
+ this.loadingPromise = (async () => {
100
+ try {
101
+ const loaded = await GoogleApiToolSet.loadToolSet(
102
+ apiName,
103
+ apiVersion
104
+ );
105
+ this.tools = loaded.tools;
106
+ if (this.pendingAuth) {
107
+ for (const tool of this.tools) {
108
+ tool.configureAuth(
109
+ this.pendingAuth.clientId,
110
+ this.pendingAuth.clientSecret
111
+ );
112
+ }
113
+ }
114
+ this.toolsLoaded = true;
115
+ } finally {
116
+ this.loadingPromise = void 0;
117
+ }
118
+ })();
119
+ }
120
+ await this.loadingPromise;
121
+ }
122
+ async getTools(context) {
123
+ await this.ensureToolsLoaded();
124
+ return this.tools.filter(
125
+ (tool) => this.isToolSelected(tool, context)
126
+ );
127
+ }
128
+ async getTool(toolName) {
129
+ await this.ensureToolsLoaded();
130
+ return this.tools.find((tool) => tool.name === toolName);
131
+ }
132
+ configureAuth(clientId, clientSecret) {
133
+ this.pendingAuth = { clientId, clientSecret };
134
+ for (const tool of this.tools) {
135
+ tool.configureAuth(clientId, clientSecret);
136
+ }
137
+ }
138
+ async close() {
139
+ return Promise.resolve();
140
+ }
141
+ static loadToolSetWithOidcAuth(options = {}) {
142
+ var _a2;
143
+ let specStr;
144
+ if (options.specFile) {
145
+ const dir = (_a2 = options.callerDir) != null ? _a2 : process.cwd();
146
+ const yamlPath = path.isAbsolute(options.specFile) ? options.specFile : path.join(dir, options.specFile);
147
+ specStr = fs.readFileSync(yamlPath, "utf-8");
148
+ }
149
+ const authScheme = {
150
+ type: "openIdConnect",
151
+ openIdConnectUrl: "",
152
+ authorizationEndpoint: GOOGLE_OIDC_AUTH_ENDPOINT,
153
+ tokenEndpoint: GOOGLE_OIDC_TOKEN_ENDPOINT,
154
+ userinfoEndpoint: GOOGLE_OIDC_USERINFO_ENDPOINT,
155
+ revocationEndpoint: GOOGLE_OIDC_REVOCATION_ENDPOINT,
156
+ tokenEndpointAuthMethodsSupported: [
157
+ "client_secret_post",
158
+ "client_secret_basic"
159
+ ],
160
+ grantTypesSupported: ["authorization_code"],
161
+ scopes: options.scopes
162
+ };
163
+ return new import_openapi_toolset.OpenAPIToolset({
164
+ specDict: options.specDict,
165
+ specStr,
166
+ specType: "yaml",
167
+ authScheme
168
+ });
169
+ }
170
+ static async loadToolSet(apiName, apiVersion) {
171
+ var _a2, _b2, _c, _d, _e;
172
+ const specDict = await new import_googleapi_to_openapi_converter.GoogleApiToOpenApiConverter(
173
+ apiName,
174
+ apiVersion
175
+ ).convert();
176
+ const oauth2Scheme = (_b2 = (_a2 = specDict.components) == null ? void 0 : _a2.securitySchemes) == null ? void 0 : _b2["oauth2"];
177
+ const scopesMap = (_e = (_d = (_c = oauth2Scheme == null ? void 0 : oauth2Scheme.flows) == null ? void 0 : _c.authorizationCode) == null ? void 0 : _d.scopes) != null ? _e : {};
178
+ const firstScope = Object.keys(scopesMap)[0];
179
+ const scopes = firstScope ? [firstScope] : void 0;
180
+ const openapiToolset = this.loadToolSetWithOidcAuth({
181
+ specDict,
182
+ scopes
183
+ });
184
+ const tools = await openapiToolset.getTools();
185
+ return new this(tools, { apiName, apiVersion });
186
+ }
187
+ };
188
+ __name(GoogleApiToolSet, "GoogleApiToolSet");
189
+ __decorateClass([
190
+ import_experimental.experimental
191
+ ], GoogleApiToolSet.prototype, "getTools", 1);
192
+ __decorateClass([
193
+ import_experimental.experimental
194
+ ], GoogleApiToolSet.prototype, "getTool", 1);
195
+ __decorateClass([
196
+ import_experimental.experimental
197
+ ], GoogleApiToolSet.prototype, "configureAuth", 1);
198
+ __decorateClass([
199
+ import_experimental.experimental
200
+ ], GoogleApiToolSet.prototype, "close", 1);
201
+ __decorateClass([
202
+ import_experimental.experimental
203
+ ], GoogleApiToolSet, "loadToolSetWithOidcAuth", 1);
204
+ __decorateClass([
205
+ import_experimental.experimental
206
+ ], GoogleApiToolSet, "loadToolSet", 1);
207
+ GoogleApiToolSet = __decorateClass([
208
+ import_experimental.experimental
209
+ ], GoogleApiToolSet);
210
+ function createLazyGoogleApiToolSet(apiName, apiVersion) {
211
+ const BaseConstructor = Object.getPrototypeOf(
212
+ GoogleApiToolSet
213
+ );
214
+ return Reflect.construct(
215
+ BaseConstructor,
216
+ [void 0, { apiName, apiVersion }],
217
+ GoogleApiToolSet
218
+ );
219
+ }
220
+ __name(createLazyGoogleApiToolSet, "createLazyGoogleApiToolSet");
221
+ // Annotate the CommonJS export names for ESM import in node:
222
+ 0 && (module.exports = {
223
+ GoogleApiToolSet,
224
+ createLazyGoogleApiToolSet,
225
+ isGoogleApiToolSet
226
+ });