@google/adk 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/agents/agent_engine_client.js +172 -0
- package/dist/cjs/agents/base_agent.js +20 -4
- package/dist/cjs/agents/functions.js +28 -0
- package/dist/cjs/agents/instructions.js +2 -1
- package/dist/cjs/agents/llm_agent.js +19 -6
- package/dist/cjs/agents/processors/basic_llm_request_processor.js +1 -1
- package/dist/cjs/agents/processors/code_execution_request_processor.js +8 -0
- package/dist/cjs/agents/processors/content_processor_utils.js +38 -10
- package/dist/cjs/agents/processors/content_request_processor.js +34 -2
- package/dist/cjs/agents/processors/instructions_llm_request_processor.js +1 -1
- package/dist/cjs/agents/processors/nl_planning_processor.js +12 -3
- package/dist/cjs/cli/utils/logs.js +6 -6
- package/dist/cjs/code_executors/container_code_executor.js +27 -16
- package/dist/cjs/code_executors/unsafe_local_code_executor.js +6 -1
- package/dist/cjs/common.js +9 -20
- package/dist/cjs/errors/input_validation_error.js +3 -2
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/plugins/base_plugin.js +13 -23
- package/dist/cjs/sessions/base_session_service.js +14 -8
- package/dist/cjs/sessions/database_session_service.js +50 -28
- package/dist/cjs/sessions/stale_session_error.js +59 -0
- package/dist/cjs/skills/loader.js +52 -18
- package/dist/cjs/telemetry/setup.js +0 -1
- package/dist/cjs/telemetry/tracing.js +53 -10
- package/dist/cjs/tools/apihub_tool/apihub_toolset.js +18 -23
- package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +120 -42
- package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +163 -95
- package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +13 -9
- package/dist/cjs/tools/application_integration_tool/integration_connector_tool.js +184 -0
- package/dist/cjs/tools/google_api_tool/google_api_tool.js +4 -1
- package/dist/cjs/tools/google_api_tool/google_api_toolset.js +173 -0
- package/dist/cjs/tools/google_api_tool/google_api_toolsets.js +124 -0
- package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +2 -2
- package/dist/cjs/tools/google_api_tool/index.js +20 -23
- package/dist/cjs/tools/load_artifacts_tool.js +12 -6
- package/dist/cjs/tools/load_memory_tool.js +12 -10
- package/dist/cjs/tools/mcp/mcp_toolset.js +1 -14
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -2
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
- package/dist/cjs/tools/openapi_tool/openapi_toolset.js +7 -13
- package/dist/cjs/tools/openapi_tool/rest_api_tool.js +17 -1
- package/dist/cjs/tools/toolbox_toolset.js +174 -0
- package/dist/cjs/tools/webmcp/webmcp_toolset.js +1 -14
- package/dist/cjs/utils/client_labels.js +19 -2
- package/dist/cjs/utils/failover_utils.js +1 -1
- package/dist/cjs/utils/gemini_schema_util.js +24 -6
- package/dist/cjs/utils/logger_node.js +4 -0
- package/dist/cjs/utils/output_schema_utils.js +5 -2
- package/dist/cjs/utils/task.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/agents/agent_engine_client.js +144 -0
- package/dist/esm/agents/base_agent.js +20 -4
- package/dist/esm/agents/functions.js +28 -0
- package/dist/esm/agents/instructions.js +2 -1
- package/dist/esm/agents/llm_agent.js +19 -6
- package/dist/esm/agents/processors/basic_llm_request_processor.js +1 -1
- package/dist/esm/agents/processors/code_execution_request_processor.js +8 -0
- package/dist/esm/agents/processors/content_processor_utils.js +38 -10
- package/dist/esm/agents/processors/content_request_processor.js +34 -2
- package/dist/esm/agents/processors/instructions_llm_request_processor.js +1 -1
- package/dist/esm/agents/processors/nl_planning_processor.js +12 -3
- package/dist/esm/cli/utils/logs.js +4 -4
- package/dist/esm/code_executors/container_code_executor.js +27 -16
- package/dist/esm/code_executors/unsafe_local_code_executor.js +6 -1
- package/dist/esm/common.js +10 -13
- package/dist/esm/errors/input_validation_error.js +3 -2
- package/dist/esm/index.js +17 -3
- package/dist/esm/plugins/base_plugin.js +13 -23
- package/dist/esm/sessions/base_session_service.js +12 -7
- package/dist/esm/sessions/database_session_service.js +49 -28
- package/dist/esm/sessions/stale_session_error.js +31 -0
- package/dist/esm/skills/loader.js +51 -17
- package/dist/esm/telemetry/setup.js +1 -2
- package/dist/esm/telemetry/tracing.js +57 -11
- package/dist/esm/tools/apihub_tool/apihub_toolset.js +17 -22
- package/dist/esm/tools/application_integration_tool/application_integration_toolset.js +124 -42
- package/dist/esm/tools/application_integration_tool/clients/connections_client.js +163 -95
- package/dist/esm/tools/application_integration_tool/clients/integration_client.js +13 -9
- package/dist/esm/tools/application_integration_tool/integration_connector_tool.js +158 -0
- package/dist/esm/tools/google_api_tool/google_api_tool.js +4 -1
- package/dist/esm/tools/google_api_tool/google_api_toolset.js +146 -0
- package/dist/esm/tools/google_api_tool/google_api_toolsets.js +94 -0
- package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +2 -2
- package/dist/esm/tools/google_api_tool/index.js +18 -20
- package/dist/esm/tools/load_artifacts_tool.js +10 -5
- package/dist/esm/tools/load_memory_tool.js +12 -10
- package/dist/esm/tools/mcp/mcp_toolset.js +1 -14
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -2
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
- package/dist/esm/tools/openapi_tool/openapi_toolset.js +6 -12
- package/dist/esm/tools/openapi_tool/rest_api_tool.js +17 -1
- package/dist/esm/tools/toolbox_toolset.js +148 -0
- package/dist/esm/tools/webmcp/webmcp_toolset.js +1 -14
- package/dist/esm/utils/client_labels.js +19 -2
- package/dist/esm/utils/failover_utils.js +1 -1
- package/dist/esm/utils/gemini_schema_util.js +23 -6
- package/dist/esm/utils/logger_node.js +4 -0
- package/dist/esm/utils/output_schema_utils.js +5 -2
- package/dist/esm/utils/task.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/agents/agent_engine_client.d.ts +37 -0
- package/dist/types/agents/base_agent.d.ts +12 -0
- package/dist/types/agents/llm_agent.d.ts +5 -1
- package/dist/types/agents/processors/content_processor_utils.d.ts +4 -2
- package/dist/types/agents/processors/nl_planning_processor.d.ts +2 -1
- package/dist/types/cli/utils/logs.d.ts +1 -1
- package/dist/types/code_executors/container_code_executor.d.ts +17 -5
- package/dist/types/common.d.ts +5 -9
- package/dist/types/errors/input_validation_error.d.ts +2 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/plugins/base_plugin.d.ts +0 -10
- package/dist/types/sessions/base_session_service.d.ts +5 -0
- package/dist/types/sessions/database_session_service.d.ts +17 -1
- package/dist/types/sessions/stale_session_error.d.ts +21 -0
- package/dist/types/skills/loader.d.ts +3 -2
- package/dist/types/telemetry/tracing.d.ts +17 -3
- package/dist/types/tools/apihub_tool/apihub_toolset.d.ts +14 -21
- package/dist/types/tools/application_integration_tool/application_integration_toolset.d.ts +32 -9
- package/dist/types/tools/application_integration_tool/clients/connections_client.d.ts +22 -8
- package/dist/types/tools/application_integration_tool/clients/integration_client.d.ts +3 -3
- package/dist/types/tools/application_integration_tool/integration_connector_tool.d.ts +70 -0
- package/dist/types/tools/base_toolset.d.ts +6 -5
- package/dist/types/tools/google_api_tool/google_api_tool.d.ts +10 -3
- package/dist/types/tools/google_api_tool/google_api_toolset.d.ts +55 -0
- package/dist/types/tools/google_api_tool/google_api_toolsets.d.ts +48 -0
- package/dist/types/tools/google_api_tool/googleapi_to_openapi_converter.d.ts +5 -4
- package/dist/types/tools/google_api_tool/index.d.ts +4 -5
- package/dist/types/tools/load_artifacts_tool.d.ts +14 -1
- package/dist/types/tools/load_memory_tool.d.ts +23 -1
- package/dist/types/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.d.ts +12 -0
- package/dist/types/tools/openapi_tool/openapi_spec_parser/operation_parser.d.ts +8 -0
- package/dist/types/tools/openapi_tool/openapi_toolset.d.ts +5 -0
- package/dist/types/tools/openapi_tool/rest_api_tool.d.ts +10 -0
- package/dist/types/tools/toolbox_toolset.d.ts +159 -0
- package/dist/types/utils/client_labels.d.ts +2 -1
- package/dist/types/utils/gemini_schema_util.d.ts +8 -0
- package/dist/types/utils/output_schema_utils.d.ts +3 -2
- package/dist/types/utils/simple_zod_to_json.d.ts +1 -2
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index_web.js +74 -66
- package/dist/web/index_web.js.map +4 -4
- package/package.json +34 -27
- package/dist/cjs/agents/remote_agent.js +0 -187
- package/dist/cjs/tools/crewai_tool.js +0 -132
- package/dist/cjs/tools/google_api_tool/google_api_tool_set.js +0 -226
- package/dist/cjs/tools/google_api_tool/google_api_tool_sets.js +0 -58
- package/dist/cjs/tools/langchain_tool.js +0 -172
- package/dist/cjs/tools/toolbox_tool.js +0 -108
- package/dist/esm/agents/remote_agent.js +0 -164
- package/dist/esm/tools/crewai_tool.js +0 -107
- package/dist/esm/tools/google_api_tool/google_api_tool_set.js +0 -188
- package/dist/esm/tools/google_api_tool/google_api_tool_sets.js +0 -24
- package/dist/esm/tools/langchain_tool.js +0 -148
- package/dist/esm/tools/toolbox_tool.js +0 -80
- package/dist/types/agents/remote_agent.d.ts +0 -68
- package/dist/types/tools/crewai_tool.d.ts +0 -85
- package/dist/types/tools/google_api_tool/google_api_tool_set.d.ts +0 -78
- package/dist/types/tools/google_api_tool/google_api_tool_sets.d.ts +0 -33
- package/dist/types/tools/langchain_tool.d.ts +0 -103
- package/dist/types/tools/toolbox_tool.d.ts +0 -73
|
@@ -152,21 +152,49 @@ async function callToolAsync(tool, args, toolContext) {
|
|
|
152
152
|
traceToolCall({
|
|
153
153
|
tool,
|
|
154
154
|
args,
|
|
155
|
+
span,
|
|
155
156
|
functionResponseEvent: buildResponseEvent(
|
|
156
157
|
tool,
|
|
157
158
|
result,
|
|
158
159
|
toolContext,
|
|
159
160
|
toolContext.invocationContext
|
|
160
161
|
),
|
|
162
|
+
errorType: getToolResponseErrorType(result),
|
|
161
163
|
invocationContext: toolContext.invocationContext
|
|
162
164
|
});
|
|
163
165
|
return result;
|
|
166
|
+
} catch (error) {
|
|
167
|
+
traceToolCall({
|
|
168
|
+
tool,
|
|
169
|
+
args,
|
|
170
|
+
span,
|
|
171
|
+
error,
|
|
172
|
+
invocationContext: toolContext.invocationContext
|
|
173
|
+
});
|
|
174
|
+
throw error;
|
|
164
175
|
} finally {
|
|
165
176
|
span.end();
|
|
166
177
|
}
|
|
167
178
|
});
|
|
168
179
|
}
|
|
169
180
|
__name(callToolAsync, "callToolAsync");
|
|
181
|
+
function getToolResponseErrorType(result) {
|
|
182
|
+
var _a2;
|
|
183
|
+
if (result === null || typeof result !== "object" || Array.isArray(result)) {
|
|
184
|
+
return void 0;
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
if (!Object.hasOwn(result, "error")) {
|
|
188
|
+
return void 0;
|
|
189
|
+
}
|
|
190
|
+
const response = result;
|
|
191
|
+
const errorType = (_a2 = response.errorType) != null ? _a2 : response.error_type;
|
|
192
|
+
return typeof errorType === "string" ? errorType : void 0;
|
|
193
|
+
} catch {
|
|
194
|
+
return void 0;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
__name(getToolResponseErrorType, "getToolResponseErrorType");
|
|
170
198
|
function buildResponseEvent(tool, functionResult, toolContext, invocationContext) {
|
|
171
199
|
let responseResult;
|
|
172
200
|
if (typeof functionResult !== "object" || functionResult == null) {
|
|
@@ -8,6 +8,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
8
8
|
* SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
*/
|
|
10
10
|
import { State } from "../sessions/state.js";
|
|
11
|
+
import { asSafePartForLlm } from "../tools/load_artifacts_tool.js";
|
|
11
12
|
const ARTIFACT_PREFIX = "artifact.";
|
|
12
13
|
const WORKFLOW_FIELD_KEY = /^[A-Za-z_]\w*\.[A-Za-z_]\w*$/;
|
|
13
14
|
const SOURCE_NODE_PLACEHOLDER = /<\s*[A-Za-z_]\w*\.([A-Za-z_]\w*)\s+from\s+([A-Za-z_]\w*)\s*>/g;
|
|
@@ -36,7 +37,7 @@ async function resolveKey(key, isOptional, rawMatch, readonlyContext) {
|
|
|
36
37
|
}
|
|
37
38
|
throw new Error(`Artifact ${fileName} not found.`);
|
|
38
39
|
}
|
|
39
|
-
return formatValue(artifact, true);
|
|
40
|
+
return formatValue(asSafePartForLlm(artifact, fileName), true);
|
|
40
41
|
}
|
|
41
42
|
if (isValidStateName(key)) {
|
|
42
43
|
if (key in invocationContext.session.state) {
|
|
@@ -31,6 +31,7 @@ import { isBaseLlm } from "../models/base_llm.js";
|
|
|
31
31
|
import { LLMRegistry } from "../models/registry.js";
|
|
32
32
|
import { isBuiltInPlanner } from "../planners/built_in_planner.js";
|
|
33
33
|
import { isBaseTool } from "../tools/base_tool.js";
|
|
34
|
+
import { isBaseToolset } from "../tools/base_toolset.js";
|
|
34
35
|
import { logger } from "../utils/logger.js";
|
|
35
36
|
import { canUseOutputSchemaWithTools } from "../utils/output_schema_utils.js";
|
|
36
37
|
import { Context } from "./context.js";
|
|
@@ -657,7 +658,7 @@ const _LlmAgent = class _LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNAT
|
|
|
657
658
|
}
|
|
658
659
|
}
|
|
659
660
|
async *runLivePreprocess(invocationContext, llmRequest) {
|
|
660
|
-
var _a2, _b2;
|
|
661
|
+
var _a2, _b2, _c;
|
|
661
662
|
for (const processor of this.requestProcessors) {
|
|
662
663
|
for await (const event of processor.runAsync(
|
|
663
664
|
invocationContext,
|
|
@@ -671,6 +672,12 @@ const _LlmAgent = class _LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNAT
|
|
|
671
672
|
}
|
|
672
673
|
for (const toolUnion of this.tools) {
|
|
673
674
|
const toolContext = new Context({ invocationContext });
|
|
675
|
+
if (isBaseToolset(toolUnion)) {
|
|
676
|
+
await toolUnion.processLlmRequest(toolContext, llmRequest);
|
|
677
|
+
if ((_b2 = invocationContext.abortSignal) == null ? void 0 : _b2.aborted) {
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
674
681
|
const tools = (await convertToolUnionToTools(
|
|
675
682
|
toolUnion,
|
|
676
683
|
new ReadonlyContext(invocationContext)
|
|
@@ -679,7 +686,7 @@ const _LlmAgent = class _LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNAT
|
|
|
679
686
|
);
|
|
680
687
|
for (const tool of tools) {
|
|
681
688
|
await tool.processLlmRequest({ toolContext, llmRequest });
|
|
682
|
-
if ((
|
|
689
|
+
if ((_c = invocationContext.abortSignal) == null ? void 0 : _c.aborted) {
|
|
683
690
|
return;
|
|
684
691
|
}
|
|
685
692
|
}
|
|
@@ -902,7 +909,7 @@ const _LlmAgent = class _LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNAT
|
|
|
902
909
|
yield functionResponseEvent;
|
|
903
910
|
}
|
|
904
911
|
async *runOneStepAsync(invocationContext) {
|
|
905
|
-
var _a2, _b2, _c;
|
|
912
|
+
var _a2, _b2, _c, _d;
|
|
906
913
|
const llmRequest = {
|
|
907
914
|
contents: [],
|
|
908
915
|
toolsDict: {},
|
|
@@ -922,7 +929,7 @@ const _LlmAgent = class _LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNAT
|
|
|
922
929
|
const allTools = [...this.tools];
|
|
923
930
|
if (this.mode === "task") {
|
|
924
931
|
allTools.push(this.finishTaskTool);
|
|
925
|
-
} else if (this.outputSchema && allTools.length > 0 && !canUseOutputSchemaWithTools(this.canonicalModel
|
|
932
|
+
} else if (this.outputSchema && allTools.length > 0 && !canUseOutputSchemaWithTools(this.canonicalModel)) {
|
|
926
933
|
const setModelResponseTool = new FunctionTool({
|
|
927
934
|
name: "set_model_response",
|
|
928
935
|
description: "Call this tool to submit your final response conforming to the output schema. Use this tool only when you have collected all the information and are ready to return the final answer.",
|
|
@@ -946,6 +953,12 @@ const _LlmAgent = class _LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNAT
|
|
|
946
953
|
invocationContext,
|
|
947
954
|
eventActions: modelResponseEvent.actions
|
|
948
955
|
});
|
|
956
|
+
if (isBaseToolset(toolUnion)) {
|
|
957
|
+
await toolUnion.processLlmRequest(toolContext, llmRequest);
|
|
958
|
+
if ((_b2 = invocationContext.abortSignal) == null ? void 0 : _b2.aborted) {
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
949
962
|
const tools = (await convertToolUnionToTools(
|
|
950
963
|
toolUnion,
|
|
951
964
|
new ReadonlyContext(invocationContext)
|
|
@@ -954,12 +967,12 @@ const _LlmAgent = class _LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNAT
|
|
|
954
967
|
});
|
|
955
968
|
for (const tool of tools) {
|
|
956
969
|
await tool.processLlmRequest({ toolContext, llmRequest });
|
|
957
|
-
if ((
|
|
970
|
+
if ((_c = invocationContext.abortSignal) == null ? void 0 : _c.aborted) {
|
|
958
971
|
return;
|
|
959
972
|
}
|
|
960
973
|
}
|
|
961
974
|
}
|
|
962
|
-
if (invocationContext.endInvocation || ((
|
|
975
|
+
if (invocationContext.endInvocation || ((_d = invocationContext.abortSignal) == null ? void 0 : _d.aborted)) {
|
|
963
976
|
return;
|
|
964
977
|
}
|
|
965
978
|
const span = tracer.startSpan("call_llm");
|
|
@@ -28,7 +28,7 @@ const _BasicLlmRequestProcessor = class _BasicLlmRequestProcessor extends BaseLl
|
|
|
28
28
|
}
|
|
29
29
|
llmRequest.model = agent.canonicalModel.model;
|
|
30
30
|
llmRequest.config = { ...(_a = agent.generateContentConfig) != null ? _a : {} };
|
|
31
|
-
if (agent.outputSchema && agent.mode !== "task" && (!((_b = agent.tools) == null ? void 0 : _b.length) || canUseOutputSchemaWithTools(agent.canonicalModel
|
|
31
|
+
if (agent.outputSchema && agent.mode !== "task" && (!((_b = agent.tools) == null ? void 0 : _b.length) || canUseOutputSchemaWithTools(agent.canonicalModel))) {
|
|
32
32
|
setOutputSchema(llmRequest, agent.outputSchema);
|
|
33
33
|
}
|
|
34
34
|
if (invocationContext.runConfig) {
|
|
@@ -63,6 +63,14 @@ const DATA_FILE_UTIL_MAP = {
|
|
|
63
63
|
const DATA_FILE_HELPER_LIB = `
|
|
64
64
|
import pandas as pd
|
|
65
65
|
|
|
66
|
+
def crop(s: str, max_chars: int = 64) -> str:
|
|
67
|
+
"""Crops a string to max_chars characters."""
|
|
68
|
+
if len(s) <= max_chars:
|
|
69
|
+
return s
|
|
70
|
+
if max_chars >= 3:
|
|
71
|
+
return s[:max_chars - 3] + '...'
|
|
72
|
+
return s[:max_chars]
|
|
73
|
+
|
|
66
74
|
def explore_df(df: pd.DataFrame) -> None:
|
|
67
75
|
"""Prints some information about a pandas DataFrame."""
|
|
68
76
|
|
|
@@ -38,7 +38,7 @@ function removeClientFunctionCallId(content) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
__name(removeClientFunctionCallId, "removeClientFunctionCallId");
|
|
41
|
-
function getContents(events, agentName, currentBranch, currentIsolationScope) {
|
|
41
|
+
function getContents(events, agentName, currentBranch, currentIsolationScope, preserveFunctionCallIds = false) {
|
|
42
42
|
const filteredEvents = [];
|
|
43
43
|
for (const event of events) {
|
|
44
44
|
if (!isEventVisibleInIsolationScope(event, currentIsolationScope)) {
|
|
@@ -51,16 +51,23 @@ function getContents(events, agentName, currentBranch, currentIsolationScope) {
|
|
|
51
51
|
if (!shouldIncludeEventInContext(event, currentBranch, currentIsolationScope)) {
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
if (isEventFromAnotherAgent(agentName, event)) {
|
|
55
|
+
const converted = convertForeignEvent(event);
|
|
56
|
+
if (converted) {
|
|
57
|
+
filteredEvents.push(converted);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
filteredEvents.push(event);
|
|
61
|
+
}
|
|
57
62
|
}
|
|
58
63
|
let resultEvents = rearrangeEventsForLatestFunctionResponse(filteredEvents);
|
|
59
64
|
resultEvents = rearrangeEventsForAsyncFunctionResponsesInHistory(resultEvents);
|
|
60
65
|
const contents = [];
|
|
61
66
|
for (const event of resultEvents) {
|
|
62
67
|
const content = cloneDeep(event.content);
|
|
63
|
-
|
|
68
|
+
if (!preserveFunctionCallIds) {
|
|
69
|
+
removeClientFunctionCallId(content);
|
|
70
|
+
}
|
|
64
71
|
contents.push(content);
|
|
65
72
|
}
|
|
66
73
|
return contents;
|
|
@@ -93,18 +100,20 @@ function isRequestInputEvent(event) {
|
|
|
93
100
|
return false;
|
|
94
101
|
}
|
|
95
102
|
__name(isRequestInputEvent, "isRequestInputEvent");
|
|
96
|
-
function getCurrentTurnContents(events, agentName, currentBranch, currentIsolationScope) {
|
|
103
|
+
function getCurrentTurnContents(events, agentName, currentBranch, currentIsolationScope, preserveFunctionCallIds = false) {
|
|
104
|
+
var _a;
|
|
97
105
|
for (let i = events.length - 1; i >= 0; i--) {
|
|
98
106
|
const event = events[i];
|
|
99
107
|
if (!shouldIncludeEventInContext(event, currentBranch, currentIsolationScope)) {
|
|
100
108
|
continue;
|
|
101
109
|
}
|
|
102
|
-
if (event.author === "user" || isEventFromAnotherAgent(agentName, event)) {
|
|
110
|
+
if (event.author === "user" || isEventFromAnotherAgent(agentName, event) && ((_a = event.content.parts) == null ? void 0 : _a.some(isVisibleForeignPart))) {
|
|
103
111
|
return getContents(
|
|
104
112
|
events.slice(turnStart(events, i)),
|
|
105
113
|
agentName,
|
|
106
114
|
currentBranch,
|
|
107
|
-
currentIsolationScope
|
|
115
|
+
currentIsolationScope,
|
|
116
|
+
preserveFunctionCallIds
|
|
108
117
|
);
|
|
109
118
|
}
|
|
110
119
|
}
|
|
@@ -169,6 +178,13 @@ function isEventFromAnotherAgent(agentName, event) {
|
|
|
169
178
|
return !!agentName && event.author !== agentName && event.author !== "user";
|
|
170
179
|
}
|
|
171
180
|
__name(isEventFromAnotherAgent, "isEventFromAnotherAgent");
|
|
181
|
+
function isVisibleForeignPart(part) {
|
|
182
|
+
if (part.functionCall || part.functionResponse) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
return !part.thought && part.text !== "";
|
|
186
|
+
}
|
|
187
|
+
__name(isVisibleForeignPart, "isVisibleForeignPart");
|
|
172
188
|
function convertForeignEvent(event) {
|
|
173
189
|
var _a, _b, _c, _d, _e, _f;
|
|
174
190
|
if (!((_b = (_a = event.content) == null ? void 0 : _a.parts) == null ? void 0 : _b.length)) {
|
|
@@ -183,7 +199,10 @@ function convertForeignEvent(event) {
|
|
|
183
199
|
]
|
|
184
200
|
};
|
|
185
201
|
for (const part of event.content.parts) {
|
|
186
|
-
if (
|
|
202
|
+
if (!isVisibleForeignPart(part)) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (part.text) {
|
|
187
206
|
(_c = content.parts) == null ? void 0 : _c.push({
|
|
188
207
|
text: `[${event.author}] said: ${part.text}`
|
|
189
208
|
});
|
|
@@ -200,9 +219,18 @@ function convertForeignEvent(event) {
|
|
|
200
219
|
)}`
|
|
201
220
|
});
|
|
202
221
|
} else {
|
|
203
|
-
|
|
222
|
+
const {
|
|
223
|
+
thought: _thought,
|
|
224
|
+
thoughtSignature: _thoughtSignature,
|
|
225
|
+
...rest
|
|
226
|
+
} = part;
|
|
227
|
+
(_f = content.parts) == null ? void 0 : _f.push(cloneDeep(rest));
|
|
204
228
|
}
|
|
205
229
|
}
|
|
230
|
+
const preambleOnly = content.parts.length === 1;
|
|
231
|
+
if (preambleOnly) {
|
|
232
|
+
return void 0;
|
|
233
|
+
}
|
|
206
234
|
return createEvent({
|
|
207
235
|
invocationId: event.invocationId,
|
|
208
236
|
author: "user",
|
|
@@ -8,11 +8,37 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
8
8
|
* SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
*/
|
|
10
10
|
import { getActiveEvents } from "../../context/compaction_utils.js";
|
|
11
|
+
import { isBaseLlm } from "../../models/base_llm.js";
|
|
11
12
|
import { isLlmAgent } from "../llm_agent.js";
|
|
12
13
|
import {
|
|
13
14
|
getContents,
|
|
14
15
|
getCurrentTurnContents
|
|
15
16
|
} from "./content_processor_utils.js";
|
|
17
|
+
const CLAUDE_MODEL_SYMBOL = /* @__PURE__ */ Symbol.for("google.adk.claudeModel");
|
|
18
|
+
const CLAUDE_MODEL_NAME_PATTERN = /^claude-/i;
|
|
19
|
+
function isClaudeModelInstance(model) {
|
|
20
|
+
return CLAUDE_MODEL_SYMBOL in model && model[CLAUDE_MODEL_SYMBOL] === true || CLAUDE_MODEL_NAME_PATTERN.test(model.model);
|
|
21
|
+
}
|
|
22
|
+
__name(isClaudeModelInstance, "isClaudeModelInstance");
|
|
23
|
+
function shouldPreserveFunctionCallIds(agent, llmRequest) {
|
|
24
|
+
if (llmRequest.model && CLAUDE_MODEL_NAME_PATTERN.test(llmRequest.model)) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
let current = agent;
|
|
28
|
+
while (current) {
|
|
29
|
+
if (isLlmAgent(current)) {
|
|
30
|
+
if (isBaseLlm(current.model)) {
|
|
31
|
+
return isClaudeModelInstance(current.model);
|
|
32
|
+
}
|
|
33
|
+
if (typeof current.model === "string" && current.model.length > 0) {
|
|
34
|
+
return CLAUDE_MODEL_NAME_PATTERN.test(current.model);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
current = current.parentAgent;
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
__name(shouldPreserveFunctionCallIds, "shouldPreserveFunctionCallIds");
|
|
16
42
|
const _ContentRequestProcessor = class _ContentRequestProcessor {
|
|
17
43
|
/**
|
|
18
44
|
* Fills {@link LlmRequest.contents} based on the session event history and
|
|
@@ -31,19 +57,25 @@ const _ContentRequestProcessor = class _ContentRequestProcessor {
|
|
|
31
57
|
invocationContext.session.events,
|
|
32
58
|
invocationContext.isolationScope
|
|
33
59
|
);
|
|
60
|
+
const preserveFunctionCallIds = shouldPreserveFunctionCallIds(
|
|
61
|
+
agent,
|
|
62
|
+
llmRequest
|
|
63
|
+
);
|
|
34
64
|
if (agent.includeContents === "default") {
|
|
35
65
|
llmRequest.contents = getContents(
|
|
36
66
|
events,
|
|
37
67
|
agent.name,
|
|
38
68
|
invocationContext.branch,
|
|
39
|
-
invocationContext.isolationScope
|
|
69
|
+
invocationContext.isolationScope,
|
|
70
|
+
preserveFunctionCallIds
|
|
40
71
|
);
|
|
41
72
|
} else {
|
|
42
73
|
llmRequest.contents = getCurrentTurnContents(
|
|
43
74
|
events,
|
|
44
75
|
agent.name,
|
|
45
76
|
invocationContext.branch,
|
|
46
|
-
invocationContext.isolationScope
|
|
77
|
+
invocationContext.isolationScope,
|
|
78
|
+
preserveFunctionCallIds
|
|
47
79
|
);
|
|
48
80
|
}
|
|
49
81
|
return;
|
|
@@ -51,7 +51,7 @@ const _InstructionsLlmRequestProcessor = class _InstructionsLlmRequestProcessor
|
|
|
51
51
|
}
|
|
52
52
|
appendInstructions(llmRequest, [instructionWithState]);
|
|
53
53
|
}
|
|
54
|
-
if (agent.outputSchema && ((_a = agent.tools) == null ? void 0 : _a.length) && !canUseOutputSchemaWithTools(agent.canonicalModel
|
|
54
|
+
if (agent.outputSchema && ((_a = agent.tools) == null ? void 0 : _a.length) && !canUseOutputSchemaWithTools(agent.canonicalModel)) {
|
|
55
55
|
appendInstructions(llmRequest, [
|
|
56
56
|
'To output the final result, you must call the "set_model_response" function with the appropriate values. Do not output anything else.'
|
|
57
57
|
]);
|
|
@@ -7,6 +7,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
7
7
|
* Copyright 2026 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
*/
|
|
10
|
+
import { createEvent } from "../../events/event.js";
|
|
10
11
|
import { appendInstructions } from "../../models/llm_request.js";
|
|
11
12
|
import { isBasePlanner } from "../../planners/base_planner.js";
|
|
12
13
|
import { isBuiltInPlanner } from "../../planners/built_in_planner.js";
|
|
@@ -59,20 +60,28 @@ const _NlPlanningRequestProcessor = class _NlPlanningRequestProcessor extends Ba
|
|
|
59
60
|
__name(_NlPlanningRequestProcessor, "NlPlanningRequestProcessor");
|
|
60
61
|
let NlPlanningRequestProcessor = _NlPlanningRequestProcessor;
|
|
61
62
|
const _NlPlanningResponseProcessor = class _NlPlanningResponseProcessor extends BaseLlmResponseProcessor {
|
|
62
|
-
// eslint-disable-next-line require-yield -- this processor only rewrites the response and has no event to emit
|
|
63
63
|
async *runAsync(invocationContext, llmResponse) {
|
|
64
|
-
var _a, _b;
|
|
64
|
+
var _a, _b, _c;
|
|
65
65
|
const planner = getPlanner(invocationContext);
|
|
66
66
|
if (!planner || !((_b = (_a = llmResponse.content) == null ? void 0 : _a.parts) == null ? void 0 : _b.length)) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
+
const callbackContext = new Context({ invocationContext });
|
|
69
70
|
const processedParts = planner.processPlanningResponse(
|
|
70
|
-
|
|
71
|
+
callbackContext,
|
|
71
72
|
llmResponse.content.parts
|
|
72
73
|
);
|
|
73
74
|
if (processedParts !== void 0) {
|
|
74
75
|
llmResponse.content = { ...llmResponse.content, parts: processedParts };
|
|
75
76
|
}
|
|
77
|
+
if (callbackContext.state.hasDelta()) {
|
|
78
|
+
yield createEvent({
|
|
79
|
+
invocationId: invocationContext.invocationId,
|
|
80
|
+
author: (_c = invocationContext.agent) == null ? void 0 : _c.name,
|
|
81
|
+
branch: invocationContext.branch,
|
|
82
|
+
actions: callbackContext.eventActions
|
|
83
|
+
});
|
|
84
|
+
}
|
|
76
85
|
}
|
|
77
86
|
};
|
|
78
87
|
__name(_NlPlanningResponseProcessor, "NlPlanningResponseProcessor");
|
|
@@ -61,7 +61,7 @@ function createWriterLogger(initialLevel, writeLine) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
__name(createWriterLogger, "createWriterLogger");
|
|
64
|
-
function
|
|
64
|
+
function setupAdkLogger(level = LogLevel.INFO) {
|
|
65
65
|
setLogLevel(level);
|
|
66
66
|
setLogger(
|
|
67
67
|
createWriterLogger(level, (line) => {
|
|
@@ -70,7 +70,7 @@ function logToStderr(level = LogLevel.INFO) {
|
|
|
70
70
|
})
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
__name(
|
|
73
|
+
__name(setupAdkLogger, "setupAdkLogger");
|
|
74
74
|
function logToTmpFolder(options = {}) {
|
|
75
75
|
const {
|
|
76
76
|
level = LogLevel.INFO,
|
|
@@ -106,6 +106,6 @@ function logToTmpFolder(options = {}) {
|
|
|
106
106
|
__name(logToTmpFolder, "logToTmpFolder");
|
|
107
107
|
export {
|
|
108
108
|
LOGGING_FORMAT,
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
logToTmpFolder,
|
|
110
|
+
setupAdkLogger
|
|
111
111
|
};
|
|
@@ -40,6 +40,8 @@ let ContainerCodeExecutor = class extends BaseCodeExecutor {
|
|
|
40
40
|
constructor(options = {}) {
|
|
41
41
|
var _a, _b, _c;
|
|
42
42
|
super();
|
|
43
|
+
this.containers = /* @__PURE__ */ new Map();
|
|
44
|
+
this.initPromises = /* @__PURE__ */ new Map();
|
|
43
45
|
if (!options.image && !options.dockerPath) {
|
|
44
46
|
throw new Error(
|
|
45
47
|
"Either image or dockerPath must be set for ContainerCodeExecutor."
|
|
@@ -69,8 +71,9 @@ let ContainerCodeExecutor = class extends BaseCodeExecutor {
|
|
|
69
71
|
`Unsupported language for ContainerCodeExecutor: ${language}. Supported: ${Object.keys(LANGUAGE_RUNTIME_COMMAND_MAP).join(", ")}.`
|
|
70
72
|
);
|
|
71
73
|
}
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
+
const key = sessionKey(params.invocationContext);
|
|
75
|
+
const container = await this.ensureContainer(key);
|
|
76
|
+
const { stdout, stderr, exitCode } = await container.execute(
|
|
74
77
|
[...TIMEOUT_COMMAND, String(this.timeoutSeconds), ...command, code],
|
|
75
78
|
this.timeoutSeconds
|
|
76
79
|
);
|
|
@@ -102,32 +105,35 @@ ${message}` : message;
|
|
|
102
105
|
return stderr;
|
|
103
106
|
}
|
|
104
107
|
/**
|
|
105
|
-
* Stops and removes
|
|
106
|
-
* started; provided for deterministic teardown in tests and app
|
|
108
|
+
* Stops and removes every session's container. Safe to call when none has
|
|
109
|
+
* been started; provided for deterministic teardown in tests and app
|
|
110
|
+
* shutdown.
|
|
107
111
|
*/
|
|
108
112
|
async close() {
|
|
109
|
-
const
|
|
110
|
-
this.
|
|
111
|
-
this.
|
|
112
|
-
await (container
|
|
113
|
+
const containers = [...this.containers.values()];
|
|
114
|
+
this.containers.clear();
|
|
115
|
+
this.initPromises.clear();
|
|
116
|
+
await Promise.all(containers.map((container) => container.stop()));
|
|
113
117
|
}
|
|
114
|
-
/** Lazily builds/starts the container exactly once. */
|
|
115
|
-
ensureContainer() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
/** Lazily builds/starts the given session's container exactly once. */
|
|
119
|
+
ensureContainer(key) {
|
|
120
|
+
let initPromise = this.initPromises.get(key);
|
|
121
|
+
if (!initPromise) {
|
|
122
|
+
initPromise = this.initContainer(key).catch((error) => {
|
|
123
|
+
this.initPromises.delete(key);
|
|
119
124
|
throw error;
|
|
120
125
|
});
|
|
126
|
+
this.initPromises.set(key, initPromise);
|
|
121
127
|
}
|
|
122
|
-
return this.
|
|
128
|
+
return initPromise.then(() => this.containers.get(key));
|
|
123
129
|
}
|
|
124
|
-
async initContainer() {
|
|
130
|
+
async initContainer(key) {
|
|
125
131
|
const container = new DockerContainer(this.containerOptions);
|
|
126
132
|
if (this.dockerPath) {
|
|
127
133
|
await container.build(this.dockerPath);
|
|
128
134
|
}
|
|
129
135
|
await container.start();
|
|
130
|
-
this.
|
|
136
|
+
this.containers.set(key, container);
|
|
131
137
|
const { exitCode } = await container.execute(
|
|
132
138
|
["which", "python3"],
|
|
133
139
|
this.timeoutSeconds
|
|
@@ -141,6 +147,11 @@ __name(ContainerCodeExecutor, "ContainerCodeExecutor");
|
|
|
141
147
|
ContainerCodeExecutor = __decorateClass([
|
|
142
148
|
experimental
|
|
143
149
|
], ContainerCodeExecutor);
|
|
150
|
+
function sessionKey(invocationContext) {
|
|
151
|
+
const session = invocationContext.session;
|
|
152
|
+
return JSON.stringify([session.appName, session.userId, session.id]);
|
|
153
|
+
}
|
|
154
|
+
__name(sessionKey, "sessionKey");
|
|
144
155
|
function defineFrozenFalse(target, key) {
|
|
145
156
|
Object.defineProperty(target, key, {
|
|
146
157
|
value: false,
|
|
@@ -216,7 +216,12 @@ Code execution timed out after ${this.timeoutSeconds} seconds.`;
|
|
|
216
216
|
};
|
|
217
217
|
} finally {
|
|
218
218
|
if (tempDir) {
|
|
219
|
-
await fs.rm(tempDir, {
|
|
219
|
+
await fs.rm(tempDir, {
|
|
220
|
+
recursive: true,
|
|
221
|
+
force: true,
|
|
222
|
+
maxRetries: 10,
|
|
223
|
+
retryDelay: 500
|
|
224
|
+
});
|
|
220
225
|
}
|
|
221
226
|
}
|
|
222
227
|
}
|
package/dist/esm/common.js
CHANGED
|
@@ -49,7 +49,6 @@ import {
|
|
|
49
49
|
InteractionsRequestProcessor
|
|
50
50
|
} from "./agents/processors/interactions_request_processor.js";
|
|
51
51
|
import { ReadonlyContext } from "./agents/readonly_context.js";
|
|
52
|
-
import { RemoteAgent, isRemoteAgent } from "./agents/remote_agent.js";
|
|
53
52
|
import { RoutedAgent, isRoutedAgent } from "./agents/routed_agent.js";
|
|
54
53
|
import { StreamingMode, createRunConfig } from "./agents/run_config.js";
|
|
55
54
|
import { SequentialAgent, isSequentialAgent } from "./agents/sequential_agent.js";
|
|
@@ -255,7 +254,11 @@ import {
|
|
|
255
254
|
isGemini3xLive
|
|
256
255
|
} from "./utils/model_name.js";
|
|
257
256
|
import { toJsonSchema } from "./utils/schema.js";
|
|
258
|
-
import {
|
|
257
|
+
import {
|
|
258
|
+
isZodObject,
|
|
259
|
+
isZodSchema,
|
|
260
|
+
zodObjectToSchema
|
|
261
|
+
} from "./utils/simple_zod_to_json.js";
|
|
259
262
|
import { Task } from "./utils/task.js";
|
|
260
263
|
import { GoogleLLMVariant } from "./utils/variant_utils.js";
|
|
261
264
|
import { version } from "./version.js";
|
|
@@ -314,15 +317,13 @@ import {
|
|
|
314
317
|
convertSessionToEvalFormat,
|
|
315
318
|
createEmptyState
|
|
316
319
|
} from "./cli/utils/evals.js";
|
|
317
|
-
import { CrewaiTool, isCrewaiTool } from "./tools/crewai_tool.js";
|
|
318
320
|
import {
|
|
319
321
|
buildFunctionDeclarationForLangchain,
|
|
320
322
|
buildFunctionDeclarationForParamsForCrewai,
|
|
321
323
|
buildFunctionDeclarationUtil
|
|
322
324
|
} from "./tools/function_tool.js";
|
|
323
|
-
import { LangchainTool, isLangchainTool } from "./tools/langchain_tool.js";
|
|
324
325
|
import { isBaseRetrievalTool } from "./tools/retrieval/base_retrieval_tool.js";
|
|
325
|
-
import {
|
|
326
|
+
import { ToolboxToolset, isToolboxToolset } from "./tools/toolbox_toolset.js";
|
|
326
327
|
export {
|
|
327
328
|
ADK_HANDLE_MODEL_ERROR_TOOL_NAME,
|
|
328
329
|
AUTH_PREPROCESSOR,
|
|
@@ -372,7 +373,6 @@ export {
|
|
|
372
373
|
ContextCompactorRequestProcessor,
|
|
373
374
|
CredentialExchangeError,
|
|
374
375
|
CredentialRefresherRegistry,
|
|
375
|
-
CrewaiTool,
|
|
376
376
|
DEFAULT_ROUTE,
|
|
377
377
|
ENTERPRISE_WEB_SEARCH,
|
|
378
378
|
EXIT_LOOP,
|
|
@@ -414,7 +414,6 @@ export {
|
|
|
414
414
|
LOAD_ARTIFACTS,
|
|
415
415
|
LOAD_MEMORY,
|
|
416
416
|
LangGraphAgent,
|
|
417
|
-
LangchainTool,
|
|
418
417
|
ListSkillsTool,
|
|
419
418
|
LiveRequestQueue,
|
|
420
419
|
LlamaIndexRetrieval,
|
|
@@ -454,7 +453,6 @@ export {
|
|
|
454
453
|
ReadonlyContext,
|
|
455
454
|
ReflectAndRetryModelPlugin,
|
|
456
455
|
ReflectAndRetryToolPlugin,
|
|
457
|
-
RemoteAgent,
|
|
458
456
|
RequestInput,
|
|
459
457
|
RoutedAgent,
|
|
460
458
|
RoutedLlm,
|
|
@@ -479,7 +477,7 @@ export {
|
|
|
479
477
|
ToolErrorType,
|
|
480
478
|
ToolExecutionError,
|
|
481
479
|
ToolNode,
|
|
482
|
-
|
|
480
|
+
ToolboxToolset,
|
|
483
481
|
TrackingScope,
|
|
484
482
|
TrajectoryThoughtPruningCompactor,
|
|
485
483
|
TruncatingContextCompactor,
|
|
@@ -543,7 +541,6 @@ export {
|
|
|
543
541
|
isBaseToolset,
|
|
544
542
|
isBuiltInPlanner,
|
|
545
543
|
isCompactedEvent,
|
|
546
|
-
isCrewaiTool,
|
|
547
544
|
isFinalResponse,
|
|
548
545
|
isFunctionTool,
|
|
549
546
|
isGemini2OrAbove,
|
|
@@ -552,7 +549,6 @@ export {
|
|
|
552
549
|
isGemini3xLive,
|
|
553
550
|
isIntentMismatchError,
|
|
554
551
|
isLangGraphAgent,
|
|
555
|
-
isLangchainTool,
|
|
556
552
|
isLlmAgent,
|
|
557
553
|
isLlmCallsLimitExceededError,
|
|
558
554
|
isLoopAgent,
|
|
@@ -562,7 +558,6 @@ export {
|
|
|
562
558
|
isNodeState,
|
|
563
559
|
isNodeTimeoutError,
|
|
564
560
|
isParallelAgent,
|
|
565
|
-
isRemoteAgent,
|
|
566
561
|
isRequestInput,
|
|
567
562
|
isRoutableLlmAgent,
|
|
568
563
|
isRoutedAgent,
|
|
@@ -573,9 +568,11 @@ export {
|
|
|
573
568
|
isSessionArtifactService,
|
|
574
569
|
isStateSchemaError,
|
|
575
570
|
isToolNotFound,
|
|
576
|
-
|
|
571
|
+
isToolboxToolset,
|
|
577
572
|
isWebMCPSupported,
|
|
578
573
|
isWorkflow,
|
|
574
|
+
isZodObject,
|
|
575
|
+
isZodSchema,
|
|
579
576
|
logger,
|
|
580
577
|
markRestored,
|
|
581
578
|
node,
|
|
@@ -10,9 +10,10 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
10
10
|
const _InputValidationError = class _InputValidationError extends Error {
|
|
11
11
|
/**
|
|
12
12
|
* @param message A message describing why the input is invalid.
|
|
13
|
+
* @param options Standard error options, e.g. `{cause}`.
|
|
13
14
|
*/
|
|
14
|
-
constructor(message = "Invalid input.") {
|
|
15
|
-
super(message);
|
|
15
|
+
constructor(message = "Invalid input.", options) {
|
|
16
|
+
super(message, options);
|
|
16
17
|
this.name = "InputValidationError";
|
|
17
18
|
}
|
|
18
19
|
};
|