@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
@@ -0,0 +1,532 @@
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 cli_eval_exports = {};
37
+ __export(cli_eval_exports, {
38
+ DEFAULT_CRITERIA: () => DEFAULT_CRITERIA,
39
+ EVAL_SESSION_ID_PREFIX: () => EVAL_SESSION_ID_PREFIX,
40
+ EvalStatus: () => EvalStatus,
41
+ MISSING_EVAL_DEPENDENCIES_MESSAGE: () => MISSING_EVAL_DEPENDENCIES_MESSAGE,
42
+ RESPONSE_EVALUATION_SCORE_KEY: () => RESPONSE_EVALUATION_SCORE_KEY,
43
+ RESPONSE_MATCH_SCORE_KEY: () => RESPONSE_MATCH_SCORE_KEY,
44
+ TOOL_TRAJECTORY_SCORE_KEY: () => TOOL_TRAJECTORY_SCORE_KEY,
45
+ getEvaluationCriteriaOrDefault: () => getEvaluationCriteriaOrDefault,
46
+ getRootAgent: () => getRootAgent,
47
+ parseAndGetEvalsToRun: () => parseAndGetEvalsToRun,
48
+ runEvals: () => runEvals,
49
+ tryGetResetFunc: () => tryGetResetFunc
50
+ });
51
+ module.exports = __toCommonJS(cli_eval_exports);
52
+ var import_node_crypto = require("node:crypto");
53
+ var fs = __toESM(require("node:fs"), 1);
54
+ var path = __toESM(require("node:path"), 1);
55
+ var import_node_url = require("node:url");
56
+ var import_base_agent = require("../agents/base_agent.js");
57
+ var import_llm_agent = require("../agents/llm_agent.js");
58
+ var import_in_memory_artifact_service = require("../artifacts/in_memory_artifact_service.js");
59
+ var import_runner = require("../runner/runner.js");
60
+ var import_in_memory_session_service = require("../sessions/in_memory_session_service.js");
61
+ var import_logger = require("../utils/logger.js");
62
+ var import_evals = require("./utils/evals.js");
63
+ /**
64
+ * @license
65
+ * Copyright 2026 Google LLC
66
+ * SPDX-License-Identifier: Apache-2.0
67
+ */
68
+ const MISSING_EVAL_DEPENDENCIES_MESSAGE = "Eval module is not installed, please install via `pip install google-adk[eval]`.";
69
+ const TOOL_TRAJECTORY_SCORE_KEY = "tool_trajectory_avg_score";
70
+ const RESPONSE_MATCH_SCORE_KEY = "response_match_score";
71
+ const RESPONSE_EVALUATION_SCORE_KEY = "response_evaluation_score";
72
+ const EVAL_SESSION_ID_PREFIX = "___eval___session___";
73
+ const DEFAULT_CRITERIA = {
74
+ [TOOL_TRAJECTORY_SCORE_KEY]: 1,
75
+ [RESPONSE_MATCH_SCORE_KEY]: 0.8
76
+ };
77
+ var EvalStatus = /* @__PURE__ */ ((EvalStatus2) => {
78
+ EvalStatus2[EvalStatus2["PASSED"] = 1] = "PASSED";
79
+ EvalStatus2[EvalStatus2["FAILED"] = 2] = "FAILED";
80
+ EvalStatus2[EvalStatus2["NOT_EVALUATED"] = 3] = "NOT_EVALUATED";
81
+ return EvalStatus2;
82
+ })(EvalStatus || {});
83
+ function getEvaluationCriteriaOrDefault(evalConfigFilePath) {
84
+ if (evalConfigFilePath) {
85
+ const content = fs.readFileSync(evalConfigFilePath, "utf-8");
86
+ const configData = JSON.parse(content);
87
+ if (typeof configData === "object" && configData !== null && "criteria" in configData && typeof configData.criteria === "object" && configData.criteria !== null && !Array.isArray(configData.criteria)) {
88
+ return configData.criteria;
89
+ }
90
+ throw new Error(
91
+ `Invalid format for test_config.json at ${evalConfigFilePath}. Expected a 'criteria' dictionary.`
92
+ );
93
+ }
94
+ import_logger.logger.info("No config file supplied. Using default criteria.");
95
+ return { ...DEFAULT_CRITERIA };
96
+ }
97
+ __name(getEvaluationCriteriaOrDefault, "getEvaluationCriteriaOrDefault");
98
+ function resolveAgentModulePath(agentModuleFilePath) {
99
+ const resolved = path.resolve(agentModuleFilePath);
100
+ if (fs.existsSync(resolved) && fs.statSync(resolved).isDirectory()) {
101
+ const candidates = ["agent.js", "agent.ts", "index.js", "index.ts"];
102
+ for (const candidate of candidates) {
103
+ const candidatePath = path.join(resolved, candidate);
104
+ if (fs.existsSync(candidatePath) && fs.statSync(candidatePath).isFile()) {
105
+ return candidatePath;
106
+ }
107
+ }
108
+ }
109
+ return resolved;
110
+ }
111
+ __name(resolveAgentModulePath, "resolveAgentModulePath");
112
+ async function getRootAgent(agentModuleFilePath) {
113
+ var _a, _b, _c, _d;
114
+ const resolvedPath = resolveAgentModulePath(agentModuleFilePath);
115
+ const moduleUrl = (0, import_node_url.pathToFileURL)(resolvedPath).href;
116
+ const mod = await Promise.resolve().then(() => __toESM(require(moduleUrl)));
117
+ const nestedAgent = typeof mod.agent === "object" && mod.agent !== null ? mod.agent : void 0;
118
+ const candidate = (_d = (_c = (_b = (_a = mod.rootAgent) != null ? _a : mod.root_agent) != null ? _b : mod.default) != null ? _c : nestedAgent == null ? void 0 : nestedAgent.rootAgent) != null ? _d : nestedAgent == null ? void 0 : nestedAgent.root_agent;
119
+ if ((0, import_base_agent.isBaseAgent)(candidate)) {
120
+ return candidate;
121
+ }
122
+ throw new Error(
123
+ `No rootAgent found in module ${agentModuleFilePath}. Export a BaseAgent as 'rootAgent'.`
124
+ );
125
+ }
126
+ __name(getRootAgent, "getRootAgent");
127
+ async function tryGetResetFunc(agentModuleFilePath) {
128
+ var _a, _b, _c;
129
+ try {
130
+ const resolvedPath = resolveAgentModulePath(agentModuleFilePath);
131
+ const moduleUrl = (0, import_node_url.pathToFileURL)(resolvedPath).href;
132
+ const mod = await Promise.resolve().then(() => __toESM(require(moduleUrl)));
133
+ const nestedAgent = typeof mod.agent === "object" && mod.agent !== null ? mod.agent : void 0;
134
+ const resetCandidate = (_c = (_b = (_a = mod.reset_data) != null ? _a : mod.resetData) != null ? _b : nestedAgent == null ? void 0 : nestedAgent.reset_data) != null ? _c : nestedAgent == null ? void 0 : nestedAgent.resetData;
135
+ if (typeof resetCandidate === "function") {
136
+ return resetCandidate;
137
+ }
138
+ } catch {
139
+ }
140
+ return void 0;
141
+ }
142
+ __name(tryGetResetFunc, "tryGetResetFunc");
143
+ function parseAndGetEvalsToRun(evalSetFilePaths) {
144
+ const evalSetToEvals = {};
145
+ for (const inputEvalSet of evalSetFilePaths) {
146
+ let evalSetFile;
147
+ let evals = [];
148
+ if (inputEvalSet.includes(":")) {
149
+ const colonIndex = inputEvalSet.indexOf(":");
150
+ evalSetFile = inputEvalSet.slice(0, colonIndex);
151
+ evals = inputEvalSet.slice(colonIndex + 1).split(",").filter((s) => s.length > 0);
152
+ } else {
153
+ evalSetFile = inputEvalSet;
154
+ }
155
+ if (!Object.prototype.hasOwnProperty.call(evalSetToEvals, evalSetFile)) {
156
+ evalSetToEvals[evalSetFile] = [];
157
+ }
158
+ evalSetToEvals[evalSetFile].push(...evals);
159
+ }
160
+ return evalSetToEvals;
161
+ }
162
+ __name(parseAndGetEvalsToRun, "parseAndGetEvalsToRun");
163
+ function deepEqual(a, b) {
164
+ if (Object.is(a, b)) {
165
+ return true;
166
+ }
167
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
168
+ return false;
169
+ }
170
+ if (Array.isArray(a) !== Array.isArray(b)) {
171
+ return false;
172
+ }
173
+ if (Array.isArray(a) && Array.isArray(b)) {
174
+ if (a.length !== b.length) {
175
+ return false;
176
+ }
177
+ for (let i = 0; i < a.length; i++) {
178
+ if (!deepEqual(a[i], b[i])) {
179
+ return false;
180
+ }
181
+ }
182
+ return true;
183
+ }
184
+ const keysA = Object.keys(a);
185
+ const keysB = Object.keys(b);
186
+ if (keysA.length !== keysB.length) {
187
+ return false;
188
+ }
189
+ for (const key of keysA) {
190
+ if (!Object.prototype.hasOwnProperty.call(b, key) || !deepEqual(
191
+ a[key],
192
+ b[key]
193
+ )) {
194
+ return false;
195
+ }
196
+ }
197
+ return true;
198
+ }
199
+ __name(deepEqual, "deepEqual");
200
+ function toolUsesEqual(actual, expected) {
201
+ if (actual.length !== expected.length) {
202
+ return false;
203
+ }
204
+ for (let i = 0; i < actual.length; i++) {
205
+ if (actual[i].tool_name !== expected[i].tool_name || !deepEqual(actual[i].tool_input, expected[i].tool_input)) {
206
+ return false;
207
+ }
208
+ }
209
+ return true;
210
+ }
211
+ __name(toolUsesEqual, "toolUsesEqual");
212
+ function computeRouge1FMeasure(target, prediction) {
213
+ var _a, _b, _c, _d;
214
+ const targetTokens = (_a = target.toLowerCase().match(/[a-z0-9]+/g)) != null ? _a : [];
215
+ const predictionTokens = (_b = prediction.toLowerCase().match(/[a-z0-9]+/g)) != null ? _b : [];
216
+ if (targetTokens.length === 0 && predictionTokens.length === 0) {
217
+ return 1;
218
+ }
219
+ if (targetTokens.length === 0 || predictionTokens.length === 0) {
220
+ return 0;
221
+ }
222
+ const targetCounts = /* @__PURE__ */ new Map();
223
+ for (const token of targetTokens) {
224
+ targetCounts.set(token, ((_c = targetCounts.get(token)) != null ? _c : 0) + 1);
225
+ }
226
+ let overlap = 0;
227
+ for (const token of predictionTokens) {
228
+ const remaining = (_d = targetCounts.get(token)) != null ? _d : 0;
229
+ if (remaining > 0) {
230
+ overlap += 1;
231
+ targetCounts.set(token, remaining - 1);
232
+ }
233
+ }
234
+ const precision = overlap / predictionTokens.length;
235
+ const recall = overlap / targetTokens.length;
236
+ if (precision + recall === 0) {
237
+ return 0;
238
+ }
239
+ return 2 * precision * recall / (precision + recall);
240
+ }
241
+ __name(computeRouge1FMeasure, "computeRouge1FMeasure");
242
+ function evaluateSingleMetric(metric, actualInvocations, expectedInvocations) {
243
+ var _a, _b, _c, _d;
244
+ const numInvocations = Math.min(
245
+ actualInvocations.length,
246
+ expectedInvocations.length
247
+ );
248
+ if (numInvocations === 0) {
249
+ return {
250
+ overall: {
251
+ metric_name: metric.metric_name,
252
+ threshold: metric.threshold,
253
+ score: void 0,
254
+ eval_status: 3 /* NOT_EVALUATED */
255
+ },
256
+ perInvocation: []
257
+ };
258
+ }
259
+ const perInvocation = [];
260
+ let totalScore = 0;
261
+ for (let i = 0; i < numInvocations; i++) {
262
+ const actual = actualInvocations[i];
263
+ const expected = expectedInvocations[i];
264
+ let score = 0;
265
+ if (metric.metric_name === TOOL_TRAJECTORY_SCORE_KEY) {
266
+ score = toolUsesEqual(
267
+ (_a = actual.expected_tool_use) != null ? _a : [],
268
+ (_b = expected.expected_tool_use) != null ? _b : []
269
+ ) ? 1 : 0;
270
+ } else if (metric.metric_name === RESPONSE_MATCH_SCORE_KEY || metric.metric_name === RESPONSE_EVALUATION_SCORE_KEY) {
271
+ score = computeRouge1FMeasure(
272
+ (_c = expected.reference) != null ? _c : "",
273
+ (_d = actual.reference) != null ? _d : ""
274
+ );
275
+ }
276
+ totalScore += score;
277
+ perInvocation.push({
278
+ metric_name: metric.metric_name,
279
+ threshold: metric.threshold,
280
+ score,
281
+ eval_status: score >= metric.threshold ? 1 /* PASSED */ : 2 /* FAILED */
282
+ });
283
+ }
284
+ const avgScore = totalScore / numInvocations;
285
+ return {
286
+ overall: {
287
+ metric_name: metric.metric_name,
288
+ threshold: metric.threshold,
289
+ score: avgScore,
290
+ eval_status: avgScore >= metric.threshold ? 1 /* PASSED */ : 2 /* FAILED */
291
+ },
292
+ perInvocation
293
+ };
294
+ }
295
+ __name(evaluateSingleMetric, "evaluateSingleMetric");
296
+ function installMockToolOutputCallbacks(agent, interceptor, savedCallbacks) {
297
+ if ((0, import_llm_agent.isLlmAgent)(agent) && !savedCallbacks.has(agent)) {
298
+ savedCallbacks.set(agent, agent.beforeToolCallback);
299
+ const existing = agent.beforeToolCallback;
300
+ agent.beforeToolCallback = existing ? [interceptor, ...Array.isArray(existing) ? existing : [existing]] : interceptor;
301
+ }
302
+ for (const subAgent of agent.subAgents) {
303
+ installMockToolOutputCallbacks(subAgent, interceptor, savedCallbacks);
304
+ }
305
+ }
306
+ __name(installMockToolOutputCallbacks, "installMockToolOutputCallbacks");
307
+ async function generateActualInvocations(rootAgent, evalCase, resetFunc, sessionService, artifactService) {
308
+ var _a, _b, _c, _d, _e, _f, _g;
309
+ if (resetFunc) {
310
+ await resetFunc();
311
+ }
312
+ const appName = (_b = (_a = evalCase.initial_session) == null ? void 0 : _a.app_name) != null ? _b : "EvaluationGenerator";
313
+ const userId = (_d = (_c = evalCase.initial_session) == null ? void 0 : _c.user_id) != null ? _d : "test_user_id";
314
+ const sessionId = `${EVAL_SESSION_ID_PREFIX}${(0, import_node_crypto.randomUUID)()}`;
315
+ const activeSessionService = sessionService != null ? sessionService : new import_in_memory_session_service.InMemorySessionService();
316
+ const activeArtifactService = artifactService != null ? artifactService : new import_in_memory_artifact_service.InMemoryArtifactService();
317
+ const initialState = (0, import_evals.createEmptyState)(
318
+ rootAgent,
319
+ (_f = (_e = evalCase.initial_session) == null ? void 0 : _e.state) != null ? _f : {}
320
+ );
321
+ await activeSessionService.createSession({
322
+ appName,
323
+ userId,
324
+ sessionId,
325
+ state: initialState
326
+ });
327
+ const pendingMockToolUses = [];
328
+ for (const turn of evalCase.data) {
329
+ for (const expectedTool of (_g = turn.expected_tool_use) != null ? _g : []) {
330
+ if (expectedTool.mock_tool_output !== void 0) {
331
+ pendingMockToolUses.push({ ...expectedTool });
332
+ }
333
+ }
334
+ }
335
+ const savedCallbacks = /* @__PURE__ */ new Map();
336
+ if (pendingMockToolUses.length > 0) {
337
+ const interceptor = /* @__PURE__ */ __name(({ tool, args }) => {
338
+ const idx = pendingMockToolUses.findIndex(
339
+ (expected) => {
340
+ var _a2;
341
+ return expected.mock_tool_output !== void 0 && tool.name === expected.tool_name && deepEqual(args, (_a2 = expected.tool_input) != null ? _a2 : {});
342
+ }
343
+ );
344
+ if (idx !== -1) {
345
+ const [matched] = pendingMockToolUses.splice(idx, 1);
346
+ return { result: matched.mock_tool_output };
347
+ }
348
+ return void 0;
349
+ }, "interceptor");
350
+ installMockToolOutputCallbacks(rootAgent, interceptor, savedCallbacks);
351
+ }
352
+ const runner = new import_runner.Runner({
353
+ appName,
354
+ agent: rootAgent,
355
+ sessionService: activeSessionService,
356
+ artifactService: activeArtifactService
357
+ });
358
+ try {
359
+ for (const turn of evalCase.data) {
360
+ for await (const _event of runner.runAsync({
361
+ userId,
362
+ sessionId,
363
+ newMessage: {
364
+ role: "user",
365
+ parts: [{ text: turn.query }]
366
+ }
367
+ })) {
368
+ }
369
+ }
370
+ } finally {
371
+ for (const [llmAgent, originalCallback] of savedCallbacks.entries()) {
372
+ llmAgent.beforeToolCallback = originalCallback;
373
+ }
374
+ }
375
+ const recordedSession = await activeSessionService.getSession({
376
+ appName,
377
+ userId,
378
+ sessionId
379
+ });
380
+ const actualInvocations = (0, import_evals.convertSessionToEvalFormat)(recordedSession);
381
+ while (actualInvocations.length < evalCase.data.length) {
382
+ const idx = actualInvocations.length;
383
+ actualInvocations.push({
384
+ query: evalCase.data[idx].query,
385
+ expected_tool_use: [],
386
+ expected_intermediate_agent_responses: [],
387
+ reference: ""
388
+ });
389
+ }
390
+ return { actualInvocations, sessionId, userId };
391
+ }
392
+ __name(generateActualInvocations, "generateActualInvocations");
393
+ function resolveEvalCasesForSet(evalSetId, entries) {
394
+ if (entries.length > 0 && typeof entries[0] === "string") {
395
+ const filterNames = entries;
396
+ const fileData = JSON.parse(
397
+ fs.readFileSync(evalSetId, "utf-8")
398
+ );
399
+ return fileData.filter((e) => filterNames.includes(e.name));
400
+ }
401
+ if (entries.length === 0 && fs.existsSync(evalSetId) && fs.statSync(evalSetId).isFile()) {
402
+ return JSON.parse(fs.readFileSync(evalSetId, "utf-8"));
403
+ }
404
+ return entries;
405
+ }
406
+ __name(resolveEvalCasesForSet, "resolveEvalCasesForSet");
407
+ function printCaseDetailedResults(result) {
408
+ var _a;
409
+ import_logger.logger.info(
410
+ `Eval result for ${result.eval_set_file}:${result.eval_id}: ${EvalStatus[result.final_eval_status]}`
411
+ );
412
+ for (const metricResult of result.overall_eval_metric_results) {
413
+ import_logger.logger.info(
414
+ ` Metric ${metricResult.metric_name}: score=${(_a = metricResult.score) != null ? _a : "N/A"} threshold=${metricResult.threshold} status=${EvalStatus[metricResult.eval_status]}`
415
+ );
416
+ }
417
+ }
418
+ __name(printCaseDetailedResults, "printCaseDetailedResults");
419
+ async function* runEvals(optionsOrMap, rootAgentArg, resetFuncArg, evalMetricsArg, printDetailedResultsArg = false, sessionServiceArg, artifactServiceArg) {
420
+ var _a, _b;
421
+ let evalCasesByEvalSetId;
422
+ let rootAgent;
423
+ let resetFunc;
424
+ let evalMetrics;
425
+ let printDetailedResults;
426
+ let sessionService;
427
+ let artifactService;
428
+ if (rootAgentArg === void 0 && "evalCasesByEvalSetId" in optionsOrMap && "rootAgent" in optionsOrMap && (0, import_base_agent.isBaseAgent)(optionsOrMap.rootAgent)) {
429
+ const opts = optionsOrMap;
430
+ evalCasesByEvalSetId = opts.evalCasesByEvalSetId;
431
+ rootAgent = opts.rootAgent;
432
+ resetFunc = opts.resetFunc;
433
+ evalMetrics = (_a = opts.evalMetrics) != null ? _a : Object.entries(DEFAULT_CRITERIA).map(([metric_name, threshold]) => ({
434
+ metric_name,
435
+ threshold
436
+ }));
437
+ printDetailedResults = (_b = opts.printDetailedResults) != null ? _b : false;
438
+ sessionService = opts.sessionService;
439
+ artifactService = opts.artifactService;
440
+ } else {
441
+ evalCasesByEvalSetId = optionsOrMap;
442
+ if (!rootAgentArg) {
443
+ throw new Error("rootAgent is required to run evaluations.");
444
+ }
445
+ rootAgent = rootAgentArg;
446
+ resetFunc = resetFuncArg;
447
+ evalMetrics = evalMetricsArg != null ? evalMetricsArg : Object.entries(DEFAULT_CRITERIA).map(([metric_name, threshold]) => ({
448
+ metric_name,
449
+ threshold
450
+ }));
451
+ printDetailedResults = printDetailedResultsArg;
452
+ sessionService = sessionServiceArg;
453
+ artifactService = artifactServiceArg;
454
+ }
455
+ for (const [evalSetId, rawEntries] of Object.entries(evalCasesByEvalSetId)) {
456
+ const evalCases = resolveEvalCasesForSet(evalSetId, rawEntries);
457
+ for (const evalCase of evalCases) {
458
+ const evalName = evalCase.name;
459
+ const { actualInvocations, sessionId, userId } = await generateActualInvocations(
460
+ rootAgent,
461
+ evalCase,
462
+ resetFunc,
463
+ sessionService,
464
+ artifactService
465
+ );
466
+ const overallEvalMetricResults = [];
467
+ const evalMetricResultsPairs = [];
468
+ const perInvocationMap = evalCase.data.map(
469
+ (expectedInvocation, idx) => ({
470
+ actual_invocation: actualInvocations[idx],
471
+ expected_invocation: expectedInvocation,
472
+ eval_metric_results: []
473
+ })
474
+ );
475
+ for (const metric of evalMetrics) {
476
+ const { overall, perInvocation } = evaluateSingleMetric(
477
+ metric,
478
+ actualInvocations,
479
+ evalCase.data
480
+ );
481
+ overallEvalMetricResults.push(overall);
482
+ evalMetricResultsPairs.push([metric, overall]);
483
+ for (let i = 0; i < perInvocation.length; i++) {
484
+ if (perInvocationMap[i]) {
485
+ perInvocationMap[i].eval_metric_results.push(perInvocation[i]);
486
+ }
487
+ }
488
+ }
489
+ let finalEvalStatus = 3 /* NOT_EVALUATED */;
490
+ for (const overallMetricResult of overallEvalMetricResults) {
491
+ if (overallMetricResult.eval_status === 1 /* PASSED */) {
492
+ if (finalEvalStatus === 3 /* NOT_EVALUATED */) {
493
+ finalEvalStatus = 1 /* PASSED */;
494
+ }
495
+ } else if (overallMetricResult.eval_status === 2 /* FAILED */) {
496
+ finalEvalStatus = 2 /* FAILED */;
497
+ break;
498
+ }
499
+ }
500
+ const result = {
501
+ eval_set_file: evalSetId,
502
+ eval_id: evalName,
503
+ final_eval_status: finalEvalStatus,
504
+ eval_metric_results: evalMetricResultsPairs,
505
+ overall_eval_metric_results: overallEvalMetricResults,
506
+ eval_metric_result_per_invocation: perInvocationMap,
507
+ session_id: sessionId,
508
+ user_id: userId
509
+ };
510
+ if (printDetailedResults) {
511
+ printCaseDetailedResults(result);
512
+ }
513
+ yield result;
514
+ }
515
+ }
516
+ }
517
+ __name(runEvals, "runEvals");
518
+ // Annotate the CommonJS export names for ESM import in node:
519
+ 0 && (module.exports = {
520
+ DEFAULT_CRITERIA,
521
+ EVAL_SESSION_ID_PREFIX,
522
+ EvalStatus,
523
+ MISSING_EVAL_DEPENDENCIES_MESSAGE,
524
+ RESPONSE_EVALUATION_SCORE_KEY,
525
+ RESPONSE_MATCH_SCORE_KEY,
526
+ TOOL_TRAJECTORY_SCORE_KEY,
527
+ getEvaluationCriteriaOrDefault,
528
+ getRootAgent,
529
+ parseAndGetEvalsToRun,
530
+ runEvals,
531
+ tryGetResetFunc
532
+ });
@@ -0,0 +1,116 @@
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 envs_exports = {};
37
+ __export(envs_exports, {
38
+ loadDotenvForAgent: () => loadDotenvForAgent,
39
+ walkToRootUntilFound: () => walkToRootUntilFound
40
+ });
41
+ module.exports = __toCommonJS(envs_exports);
42
+ var fs = __toESM(require("node:fs"), 1);
43
+ var path = __toESM(require("node:path"), 1);
44
+ var import_logger = require("../../utils/logger.js");
45
+ /**
46
+ * @license
47
+ * Copyright 2026 Google LLC
48
+ * SPDX-License-Identifier: Apache-2.0
49
+ */
50
+ function walkToRootUntilFound(folder, filename = ".env") {
51
+ const checkpath = path.join(folder, filename);
52
+ if (fs.existsSync(checkpath) && fs.statSync(checkpath).isFile()) {
53
+ return path.resolve(checkpath);
54
+ }
55
+ const parentFolder = path.dirname(folder);
56
+ if (parentFolder === folder) {
57
+ return "";
58
+ }
59
+ return walkToRootUntilFound(parentFolder, filename);
60
+ }
61
+ __name(walkToRootUntilFound, "walkToRootUntilFound");
62
+ function parseAndLoadDotenv(content) {
63
+ const lines = content.split(/\r?\n/);
64
+ for (const rawLine of lines) {
65
+ const trimmed = rawLine.trim();
66
+ if (!trimmed || trimmed.startsWith("#")) {
67
+ continue;
68
+ }
69
+ const stripped = trimmed.replace(/^export\s+/, "");
70
+ const eqIndex = stripped.indexOf("=");
71
+ if (eqIndex <= 0) {
72
+ continue;
73
+ }
74
+ const key = stripped.slice(0, eqIndex).trim();
75
+ if (!key) {
76
+ continue;
77
+ }
78
+ let value = stripped.slice(eqIndex + 1).trim();
79
+ if (value.length >= 2 && (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'"))) {
80
+ const quote = value[0];
81
+ value = value.slice(1, -1);
82
+ if (quote === '"') {
83
+ value = value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
84
+ }
85
+ } else {
86
+ const commentIndex = value.search(/\s+#/);
87
+ if (commentIndex !== -1) {
88
+ value = value.slice(0, commentIndex).trimEnd();
89
+ }
90
+ }
91
+ process.env[key] = value;
92
+ }
93
+ }
94
+ __name(parseAndLoadDotenv, "parseAndLoadDotenv");
95
+ function loadDotenvForAgent(agentName, agentParentFolder = ".", filename = ".env") {
96
+ let startingFolder = path.resolve(agentParentFolder, agentName);
97
+ if (fs.existsSync(startingFolder) && fs.statSync(startingFolder).isFile()) {
98
+ startingFolder = path.dirname(startingFolder);
99
+ }
100
+ const dotenvFilePath = walkToRootUntilFound(startingFolder, filename);
101
+ if (dotenvFilePath) {
102
+ const content = fs.readFileSync(dotenvFilePath, "utf-8");
103
+ parseAndLoadDotenv(content);
104
+ import_logger.logger.info(
105
+ `Loaded ${filename} file for ${agentName} at ${dotenvFilePath}`
106
+ );
107
+ } else {
108
+ import_logger.logger.info(`No ${filename} file found for ${agentName}`);
109
+ }
110
+ }
111
+ __name(loadDotenvForAgent, "loadDotenvForAgent");
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
114
+ loadDotenvForAgent,
115
+ walkToRootUntilFound
116
+ });