@google/adk 2.1.0 → 2.2.1
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/a2a/agent_card.js +8 -0
- package/dist/cjs/a2a/agent_executor.js +8 -3
- package/dist/cjs/a2a/event_converter_utils.js +5 -1
- package/dist/cjs/a2a/metadata_converter_utils.js +2 -1
- package/dist/cjs/agents/llm_agent.js +15 -1
- package/dist/cjs/agents/processors/content_processor_utils.js +10 -2
- package/dist/cjs/agents/processors/nl_planning_processor.js +114 -0
- package/dist/cjs/artifacts/gcs_artifact_service.js +13 -7
- package/dist/cjs/auth/auth_credential.js +12 -2
- package/dist/cjs/code_executors/code_execution_utils.js +3 -3
- package/dist/cjs/common.js +63 -0
- package/dist/cjs/events/abort_events.js +135 -0
- package/dist/cjs/events/internal_metadata.js +131 -0
- package/dist/cjs/examples/example.js +92 -0
- package/dist/cjs/examples/example_util.js +28 -4
- package/dist/cjs/examples/index.js +39 -0
- package/dist/cjs/examples/vertex_ai_example_store.js +39 -0
- package/dist/cjs/index.js +46 -0
- package/dist/cjs/memory/vertex_ai_memory_bank_service.js +17 -5
- package/dist/cjs/models/base_llm.js +1 -6
- package/dist/cjs/models/chrome_prompt_llm.js +16 -2
- package/dist/cjs/models/chrome_prompt_utils.js +54 -2
- package/dist/cjs/models/gemini_continuation.js +232 -0
- package/dist/cjs/models/gemini_llm_connection.js +5 -4
- package/dist/cjs/planners/base_planner.js +56 -0
- package/dist/cjs/planners/built_in_planner.js +85 -0
- package/dist/cjs/planners/plan_re_act_planner.js +172 -0
- package/dist/cjs/plugins/base_plugin.js +46 -61
- package/dist/cjs/plugins/debug_logging_plugin.js +653 -0
- package/dist/cjs/plugins/plugin_manager.js +1 -1
- package/dist/cjs/plugins/tool_call_integrity_plugin.js +364 -0
- package/dist/cjs/runner/runner.js +17 -3
- package/dist/cjs/tools/example_tool.js +1 -1
- package/dist/cjs/tools/mcp/mcp_session_manager.js +14 -8
- package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +281 -2
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +15 -1
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/base_auth_credential_exchanger.js +70 -0
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +120 -0
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +10 -10
- package/dist/cjs/tools/openapi_tool/common/common.js +139 -0
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +11 -6
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +73 -13
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +146 -34
- package/dist/cjs/tools/openapi_tool/openapi_toolset.js +14 -2
- package/dist/cjs/tools/openapi_tool/rest_api_tool.js +90 -28
- package/dist/cjs/tools/skill/skill_toolset.js +2 -0
- package/dist/cjs/tools/tool_context.js +41 -0
- package/dist/cjs/tools/webmcp/index.js +37 -0
- package/dist/cjs/tools/webmcp/webmcp_tool.js +156 -0
- package/dist/cjs/tools/webmcp/webmcp_toolset.js +116 -0
- package/dist/cjs/tools/webmcp/webmcp_types.js +50 -0
- package/dist/cjs/utils/case_utils.js +52 -2
- package/dist/cjs/utils/client_labels.js +67 -0
- package/dist/cjs/utils/gemini_schema_util.js +103 -3
- package/dist/cjs/utils/hash_utils.js +73 -0
- package/dist/cjs/utils/live_connection_utils.js +10 -9
- package/dist/cjs/utils/model_name.js +17 -2
- package/dist/cjs/utils/simple_zod_to_json.js +5 -0
- package/dist/cjs/version.js +1 -1
- package/dist/esm/a2a/agent_card.js +8 -0
- package/dist/esm/a2a/agent_executor.js +8 -3
- package/dist/esm/a2a/event_converter_utils.js +5 -1
- package/dist/esm/a2a/metadata_converter_utils.js +2 -1
- package/dist/esm/agents/llm_agent.js +18 -1
- package/dist/esm/agents/processors/content_processor_utils.js +10 -2
- package/dist/esm/agents/processors/nl_planning_processor.js +87 -0
- package/dist/esm/artifacts/gcs_artifact_service.js +13 -7
- package/dist/esm/auth/auth_credential.js +11 -1
- package/dist/esm/code_executors/code_execution_utils.js +3 -3
- package/dist/esm/common.js +58 -2
- package/dist/esm/events/abort_events.js +110 -0
- package/dist/esm/events/internal_metadata.js +97 -0
- package/dist/esm/examples/example.js +85 -0
- package/dist/esm/examples/example_util.js +25 -3
- package/dist/esm/examples/index.js +11 -0
- package/dist/esm/examples/vertex_ai_example_store.js +11 -0
- package/dist/esm/index.js +51 -1
- package/dist/esm/memory/vertex_ai_memory_bank_service.js +17 -5
- package/dist/esm/models/base_llm.js +2 -7
- package/dist/esm/models/chrome_prompt_llm.js +20 -3
- package/dist/esm/models/chrome_prompt_utils.js +51 -2
- package/dist/esm/models/gemini_continuation.js +205 -0
- package/dist/esm/models/gemini_llm_connection.js +6 -5
- package/dist/esm/planners/base_planner.js +28 -0
- package/dist/esm/planners/built_in_planner.js +57 -0
- package/dist/esm/planners/plan_re_act_planner.js +145 -0
- package/dist/esm/plugins/base_plugin.js +46 -61
- package/dist/esm/plugins/debug_logging_plugin.js +615 -0
- package/dist/esm/plugins/plugin_manager.js +1 -1
- package/dist/esm/plugins/tool_call_integrity_plugin.js +339 -0
- package/dist/esm/runner/runner.js +20 -3
- package/dist/esm/tools/example_tool.js +1 -1
- package/dist/esm/tools/mcp/mcp_session_manager.js +14 -8
- package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +272 -1
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +15 -1
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/base_auth_credential_exchanger.js +43 -0
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +93 -0
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +10 -12
- package/dist/esm/tools/openapi_tool/common/common.js +112 -0
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +11 -6
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +80 -13
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +146 -33
- package/dist/esm/tools/openapi_tool/openapi_toolset.js +14 -2
- package/dist/esm/tools/openapi_tool/rest_api_tool.js +89 -28
- package/dist/esm/tools/skill/skill_toolset.js +2 -0
- package/dist/esm/tools/tool_context.js +15 -0
- package/dist/esm/tools/webmcp/index.js +10 -0
- package/dist/esm/tools/webmcp/webmcp_tool.js +131 -0
- package/dist/esm/tools/webmcp/webmcp_toolset.js +89 -0
- package/dist/esm/tools/webmcp/webmcp_types.js +22 -0
- package/dist/esm/utils/case_utils.js +49 -1
- package/dist/esm/utils/client_labels.js +65 -0
- package/dist/esm/utils/gemini_schema_util.js +102 -3
- package/dist/esm/utils/hash_utils.js +45 -0
- package/dist/esm/utils/live_connection_utils.js +11 -10
- package/dist/esm/utils/model_name.js +15 -2
- package/dist/esm/utils/simple_zod_to_json.js +5 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/agents/llm_agent.d.ts +12 -1
- package/dist/types/agents/processors/nl_planning_processor.d.ts +30 -0
- package/dist/types/auth/auth_credential.d.ts +9 -0
- package/dist/types/common.d.ts +19 -4
- package/dist/types/events/abort_events.d.ts +43 -0
- package/dist/types/events/internal_metadata.d.ts +78 -0
- package/dist/types/examples/base_example_provider.d.ts +2 -2
- package/dist/types/examples/example.d.ts +75 -0
- package/dist/types/examples/example_util.d.ts +13 -2
- package/dist/types/examples/index.d.ts +18 -0
- package/dist/types/examples/vertex_ai_example_store.d.ts +7 -0
- package/dist/types/index.d.ts +12 -3
- package/dist/types/memory/memory_entry.d.ts +15 -0
- package/dist/types/memory/vertex_ai_memory_bank_service.d.ts +9 -0
- package/dist/types/models/chrome_prompt_utils.d.ts +29 -0
- package/dist/types/models/gemini_continuation.d.ts +59 -0
- package/dist/types/planners/base_planner.d.ts +50 -0
- package/dist/types/planners/built_in_planner.d.ts +53 -0
- package/dist/types/planners/plan_re_act_planner.d.ts +21 -0
- package/dist/types/plugins/base_plugin.d.ts +52 -52
- package/dist/types/plugins/debug_logging_plugin.d.ts +157 -0
- package/dist/types/plugins/tool_call_integrity_plugin.d.ts +116 -0
- package/dist/types/skills/skill_registry.d.ts +8 -0
- package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +110 -1
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.d.ts +32 -2
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/base_auth_credential_exchanger.d.ts +35 -0
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.d.ts +54 -0
- package/dist/types/tools/openapi_tool/common/common.d.ts +60 -0
- package/dist/types/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.d.ts +7 -0
- package/dist/types/tools/openapi_tool/openapi_spec_parser/operation_parser.d.ts +56 -2
- package/dist/types/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.d.ts +73 -5
- package/dist/types/tools/openapi_tool/openapi_toolset.d.ts +11 -0
- package/dist/types/tools/openapi_tool/rest_api_tool.d.ts +42 -8
- package/dist/types/tools/tool_context.d.ts +19 -0
- package/dist/types/tools/webmcp/index.d.ts +12 -0
- package/dist/types/tools/webmcp/webmcp_tool.d.ts +47 -0
- package/dist/types/tools/webmcp/webmcp_toolset.d.ts +67 -0
- package/dist/types/tools/webmcp/webmcp_types.d.ts +69 -0
- package/dist/types/utils/case_utils.d.ts +36 -0
- package/dist/types/utils/client_labels.d.ts +33 -0
- package/dist/types/utils/gemini_schema_util.d.ts +13 -0
- package/dist/types/utils/hash_utils.d.ts +25 -0
- package/dist/types/utils/logger.d.ts +10 -2
- package/dist/types/utils/model_name.d.ts +30 -2
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index_web.js +113 -80
- package/dist/web/index_web.js.map +4 -4
- package/package.json +8 -2
|
@@ -213,6 +213,14 @@ async function buildLLMAgentSkills(agent) {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
+
if (agent.codeExecutor) {
|
|
217
|
+
skills.push({
|
|
218
|
+
id: `${agent.name}-code-executor`,
|
|
219
|
+
name: "code-execution",
|
|
220
|
+
description: "Can execute code",
|
|
221
|
+
tags: ["llm", "code_execution"]
|
|
222
|
+
});
|
|
223
|
+
}
|
|
216
224
|
return skills;
|
|
217
225
|
}
|
|
218
226
|
__name(buildLLMAgentSkills, "buildLLMAgentSkills");
|
|
@@ -85,7 +85,10 @@ const _A2AAgentExecutor = class _A2AAgentExecutor {
|
|
|
85
85
|
await this.publishFinalTaskStatus({
|
|
86
86
|
executorContext,
|
|
87
87
|
eventBus,
|
|
88
|
-
event:
|
|
88
|
+
event: {
|
|
89
|
+
...unansweredRequestEvent,
|
|
90
|
+
metadata: (0, import_metadata_converter_utils.getA2ASessionMetadata)(executorContext)
|
|
91
|
+
}
|
|
89
92
|
});
|
|
90
93
|
return;
|
|
91
94
|
}
|
|
@@ -94,14 +97,16 @@ const _A2AAgentExecutor = class _A2AAgentExecutor {
|
|
|
94
97
|
(0, import_a2a_event.createTask)({
|
|
95
98
|
taskId: ctx.taskId,
|
|
96
99
|
contextId: ctx.contextId,
|
|
97
|
-
message: a2aUserMessage
|
|
100
|
+
message: a2aUserMessage,
|
|
101
|
+
metadata: (0, import_metadata_converter_utils.getA2ASessionMetadata)(executorContext)
|
|
98
102
|
})
|
|
99
103
|
);
|
|
100
104
|
}
|
|
101
105
|
eventBus.publish(
|
|
102
106
|
(0, import_a2a_event.createTaskWorkingEvent)({
|
|
103
107
|
taskId: ctx.taskId,
|
|
104
|
-
contextId: ctx.contextId
|
|
108
|
+
contextId: ctx.contextId,
|
|
109
|
+
metadata: (0, import_metadata_converter_utils.getA2ASessionMetadata)(executorContext)
|
|
105
110
|
})
|
|
106
111
|
);
|
|
107
112
|
const adkEvents = [];
|
|
@@ -32,6 +32,7 @@ module.exports = __toCommonJS(event_converter_utils_exports);
|
|
|
32
32
|
var import_genai = require("@google/genai");
|
|
33
33
|
var import_event = require("../events/event.js");
|
|
34
34
|
var import_event_actions = require("../events/event_actions.js");
|
|
35
|
+
var import_internal_metadata = require("../events/internal_metadata.js");
|
|
35
36
|
var import_env_aware_utils = require("../utils/env_aware_utils.js");
|
|
36
37
|
var import_a2a_event = require("./a2a_event.js");
|
|
37
38
|
var import_metadata_converter_utils = require("./metadata_converter_utils.js");
|
|
@@ -201,7 +202,10 @@ function createAdkEventFromMetadata(a2aEvent) {
|
|
|
201
202
|
citationMetadata: metadata[import_metadata_converter_utils.A2AMetadataKeys.CITATION_METADATA],
|
|
202
203
|
groundingMetadata: metadata[import_metadata_converter_utils.A2AMetadataKeys.GROUNDING_METADATA],
|
|
203
204
|
usageMetadata: metadata[import_metadata_converter_utils.A2AMetadataKeys.USAGE_METADATA],
|
|
204
|
-
|
|
205
|
+
// A remote peer cannot set ADK-internal keys on the events we emit for it.
|
|
206
|
+
customMetadata: (0, import_internal_metadata.withoutInternalMetadata)(
|
|
207
|
+
metadata[import_metadata_converter_utils.A2AMetadataKeys.CUSTOM_METADATA]
|
|
208
|
+
),
|
|
205
209
|
// Only fields in PEER_SETTABLE_ACTION_FIELDS may be restored from
|
|
206
210
|
// metadata a remote A2A peer controls. Every other action field either
|
|
207
211
|
// mutates the caller's own session or drives the caller's own control
|
|
@@ -33,6 +33,7 @@ __export(metadata_converter_utils_exports, {
|
|
|
33
33
|
getAdkEventMetadata: () => getAdkEventMetadata
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(metadata_converter_utils_exports);
|
|
36
|
+
var import_internal_metadata = require("../events/internal_metadata.js");
|
|
36
37
|
var import_a2a_event = require("./a2a_event.js");
|
|
37
38
|
/**
|
|
38
39
|
* @license
|
|
@@ -95,7 +96,7 @@ function getA2AEventMetadata(adkEvent, {
|
|
|
95
96
|
[A2AMetadataKeys.CITATION_METADATA]: adkEvent.citationMetadata,
|
|
96
97
|
[A2AMetadataKeys.GROUNDING_METADATA]: adkEvent.groundingMetadata,
|
|
97
98
|
[A2AMetadataKeys.USAGE_METADATA]: adkEvent.usageMetadata,
|
|
98
|
-
[A2AMetadataKeys.CUSTOM_METADATA]: adkEvent.customMetadata,
|
|
99
|
+
[A2AMetadataKeys.CUSTOM_METADATA]: (0, import_internal_metadata.publicMetadata)(adkEvent.customMetadata),
|
|
99
100
|
[A2AMetadataKeys.PARTIAL]: adkEvent.partial,
|
|
100
101
|
[A2AMetadataKeys.IS_LONG_RUNNING]: (adkEvent.longRunningToolIds || []).length > 0
|
|
101
102
|
};
|
|
@@ -40,6 +40,7 @@ var import_event = require("../events/event.js");
|
|
|
40
40
|
var import_event_actions = require("../events/event_actions.js");
|
|
41
41
|
var import_base_llm = require("../models/base_llm.js");
|
|
42
42
|
var import_registry = require("../models/registry.js");
|
|
43
|
+
var import_built_in_planner = require("../planners/built_in_planner.js");
|
|
43
44
|
var import_base_tool = require("../tools/base_tool.js");
|
|
44
45
|
var import_logger = require("../utils/logger.js");
|
|
45
46
|
var import_output_schema_utils = require("../utils/output_schema_utils.js");
|
|
@@ -59,6 +60,7 @@ var import_context_compactor_request_processor = require("./processors/context_c
|
|
|
59
60
|
var import_identity_llm_request_processor = require("./processors/identity_llm_request_processor.js");
|
|
60
61
|
var import_instructions_llm_request_processor = require("./processors/instructions_llm_request_processor.js");
|
|
61
62
|
var import_interactions_request_processor = require("./processors/interactions_request_processor.js");
|
|
63
|
+
var import_nl_planning_processor = require("./processors/nl_planning_processor.js");
|
|
62
64
|
var import_request_confirmation_llm_request_processor = require("./processors/request_confirmation_llm_request_processor.js");
|
|
63
65
|
var import_request_input_llm_request_processor = require("./processors/request_input_llm_request_processor.js");
|
|
64
66
|
var import_tool_filter_request_processor = require("./processors/tool_filter_request_processor.js");
|
|
@@ -166,6 +168,7 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
166
168
|
this.beforeToolCallback = config.beforeToolCallback;
|
|
167
169
|
this.afterToolCallback = config.afterToolCallback;
|
|
168
170
|
this.codeExecutor = config.codeExecutor;
|
|
171
|
+
this.planner = config.planner;
|
|
169
172
|
this.requestProcessors = (_i = config.requestProcessors) != null ? _i : [
|
|
170
173
|
import_basic_llm_request_processor.BASIC_LLM_REQUEST_PROCESSOR,
|
|
171
174
|
import_auth_preprocessor.AUTH_PREPROCESSOR,
|
|
@@ -174,6 +177,10 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
174
177
|
import_request_confirmation_llm_request_processor.REQUEST_CONFIRMATION_LLM_REQUEST_PROCESSOR,
|
|
175
178
|
import_request_input_llm_request_processor.REQUEST_INPUT_LLM_REQUEST_PROCESSOR,
|
|
176
179
|
import_content_request_processor.CONTENT_REQUEST_PROCESSOR,
|
|
180
|
+
// Planning clears the thought flags that the planning response
|
|
181
|
+
// processor sets, so it must run after the contents are built and
|
|
182
|
+
// before code execution rewrites them.
|
|
183
|
+
import_nl_planning_processor.NL_PLANNING_REQUEST_PROCESSOR,
|
|
177
184
|
import_interactions_request_processor.INTERACTIONS_REQUEST_PROCESSOR,
|
|
178
185
|
import_code_execution_request_processor.CODE_EXECUTION_REQUEST_PROCESSOR,
|
|
179
186
|
import_tool_filter_request_processor.TOOL_FILTER_REQUEST_PROCESSOR
|
|
@@ -194,7 +201,9 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
194
201
|
);
|
|
195
202
|
}
|
|
196
203
|
}
|
|
197
|
-
this.responseProcessors = (_j = config.responseProcessors) != null ? _j : [
|
|
204
|
+
this.responseProcessors = (_j = config.responseProcessors) != null ? _j : [
|
|
205
|
+
import_nl_planning_processor.NL_PLANNING_RESPONSE_PROCESSOR
|
|
206
|
+
];
|
|
198
207
|
const agentTransferDisabled = this.disallowTransferToParent && this.disallowTransferToPeers && !((_k = this.subAgents) == null ? void 0 : _k.length);
|
|
199
208
|
if (!agentTransferDisabled) {
|
|
200
209
|
this.requestProcessors.push(import_agent_transfer_llm_request_processor.AGENT_TRANSFER_LLM_REQUEST_PROCESSOR);
|
|
@@ -213,6 +222,11 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
213
222
|
"Response schema must be set via LlmAgent.output_schema."
|
|
214
223
|
);
|
|
215
224
|
}
|
|
225
|
+
if (config.generateContentConfig.thinkingConfig && (0, import_built_in_planner.isBuiltInPlanner)(this.planner) && this.planner.thinkingConfig) {
|
|
226
|
+
import_logger.logger.warn(
|
|
227
|
+
`Agent ${this.name}: both generateContentConfig.thinkingConfig and planner.thinkingConfig are set. The planner's thinkingConfig takes precedence.`
|
|
228
|
+
);
|
|
229
|
+
}
|
|
216
230
|
} else {
|
|
217
231
|
this.generateContentConfig = {};
|
|
218
232
|
}
|
|
@@ -43,6 +43,7 @@ var import_functions = require("../functions.js");
|
|
|
43
43
|
* Copyright 2025 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: Apache-2.0
|
|
45
45
|
*/
|
|
46
|
+
const UNSTRINGIFIABLE_VALUE = "<unstringifiable value>";
|
|
46
47
|
function removeClientFunctionCallId(content) {
|
|
47
48
|
var _a, _b, _c, _d, _e;
|
|
48
49
|
for (const part of (_a = content == null ? void 0 : content.parts) != null ? _a : []) {
|
|
@@ -406,9 +407,16 @@ function safeStringify(obj) {
|
|
|
406
407
|
return obj;
|
|
407
408
|
}
|
|
408
409
|
try {
|
|
409
|
-
|
|
410
|
-
|
|
410
|
+
const json = JSON.stringify(obj);
|
|
411
|
+
if (typeof json === "string") {
|
|
412
|
+
return json;
|
|
413
|
+
}
|
|
414
|
+
} catch {
|
|
415
|
+
}
|
|
416
|
+
try {
|
|
411
417
|
return String(obj);
|
|
418
|
+
} catch {
|
|
419
|
+
return UNSTRINGIFIABLE_VALUE;
|
|
412
420
|
}
|
|
413
421
|
}
|
|
414
422
|
__name(safeStringify, "safeStringify");
|
|
@@ -0,0 +1,114 @@
|
|
|
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 nl_planning_processor_exports = {};
|
|
27
|
+
__export(nl_planning_processor_exports, {
|
|
28
|
+
NL_PLANNING_REQUEST_PROCESSOR: () => NL_PLANNING_REQUEST_PROCESSOR,
|
|
29
|
+
NL_PLANNING_RESPONSE_PROCESSOR: () => NL_PLANNING_RESPONSE_PROCESSOR,
|
|
30
|
+
NlPlanningRequestProcessor: () => NlPlanningRequestProcessor,
|
|
31
|
+
NlPlanningResponseProcessor: () => NlPlanningResponseProcessor
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(nl_planning_processor_exports);
|
|
34
|
+
var import_llm_request = require("../../models/llm_request.js");
|
|
35
|
+
var import_base_planner = require("../../planners/base_planner.js");
|
|
36
|
+
var import_built_in_planner = require("../../planners/built_in_planner.js");
|
|
37
|
+
var import_context = require("../context.js");
|
|
38
|
+
var import_llm_agent = require("../llm_agent.js");
|
|
39
|
+
var import_readonly_context = require("../readonly_context.js");
|
|
40
|
+
var import_base_llm_processor = require("./base_llm_processor.js");
|
|
41
|
+
/**
|
|
42
|
+
* @license
|
|
43
|
+
* Copyright 2026 Google LLC
|
|
44
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
45
|
+
*/
|
|
46
|
+
function getPlanner(invocationContext) {
|
|
47
|
+
const agent = invocationContext.agent;
|
|
48
|
+
if (!(0, import_llm_agent.isLlmAgent)(agent) || !(0, import_base_planner.isBasePlanner)(agent.planner)) {
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
return agent.planner;
|
|
52
|
+
}
|
|
53
|
+
__name(getPlanner, "getPlanner");
|
|
54
|
+
function removeThought(part) {
|
|
55
|
+
const { thought: _thought, ...rest } = part;
|
|
56
|
+
return rest;
|
|
57
|
+
}
|
|
58
|
+
__name(removeThought, "removeThought");
|
|
59
|
+
function removeThoughtFromContents(contents) {
|
|
60
|
+
return contents.map(
|
|
61
|
+
(content) => content.parts ? { ...content, parts: content.parts.map(removeThought) } : content
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
__name(removeThoughtFromContents, "removeThoughtFromContents");
|
|
65
|
+
const _NlPlanningRequestProcessor = class _NlPlanningRequestProcessor extends import_base_llm_processor.BaseLlmRequestProcessor {
|
|
66
|
+
// eslint-disable-next-line require-yield -- this processor only mutates the request and has no event to emit
|
|
67
|
+
async *runAsync(invocationContext, llmRequest) {
|
|
68
|
+
const planner = getPlanner(invocationContext);
|
|
69
|
+
if (!planner) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if ((0, import_built_in_planner.isBuiltInPlanner)(planner)) {
|
|
73
|
+
planner.applyThinkingConfig(llmRequest);
|
|
74
|
+
}
|
|
75
|
+
const planningInstruction = planner.buildPlanningInstruction(
|
|
76
|
+
new import_readonly_context.ReadonlyContext(invocationContext),
|
|
77
|
+
llmRequest
|
|
78
|
+
);
|
|
79
|
+
if (planningInstruction) {
|
|
80
|
+
(0, import_llm_request.appendInstructions)(llmRequest, [planningInstruction]);
|
|
81
|
+
}
|
|
82
|
+
llmRequest.contents = removeThoughtFromContents(llmRequest.contents);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
__name(_NlPlanningRequestProcessor, "NlPlanningRequestProcessor");
|
|
86
|
+
let NlPlanningRequestProcessor = _NlPlanningRequestProcessor;
|
|
87
|
+
const _NlPlanningResponseProcessor = class _NlPlanningResponseProcessor extends import_base_llm_processor.BaseLlmResponseProcessor {
|
|
88
|
+
// eslint-disable-next-line require-yield -- this processor only rewrites the response and has no event to emit
|
|
89
|
+
async *runAsync(invocationContext, llmResponse) {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
const planner = getPlanner(invocationContext);
|
|
92
|
+
if (!planner || !((_b = (_a = llmResponse.content) == null ? void 0 : _a.parts) == null ? void 0 : _b.length)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const processedParts = planner.processPlanningResponse(
|
|
96
|
+
new import_context.Context({ invocationContext }),
|
|
97
|
+
llmResponse.content.parts
|
|
98
|
+
);
|
|
99
|
+
if (processedParts !== void 0) {
|
|
100
|
+
llmResponse.content = { ...llmResponse.content, parts: processedParts };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
__name(_NlPlanningResponseProcessor, "NlPlanningResponseProcessor");
|
|
105
|
+
let NlPlanningResponseProcessor = _NlPlanningResponseProcessor;
|
|
106
|
+
const NL_PLANNING_REQUEST_PROCESSOR = new NlPlanningRequestProcessor();
|
|
107
|
+
const NL_PLANNING_RESPONSE_PROCESSOR = new NlPlanningResponseProcessor();
|
|
108
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
+
0 && (module.exports = {
|
|
110
|
+
NL_PLANNING_REQUEST_PROCESSOR,
|
|
111
|
+
NL_PLANNING_RESPONSE_PROCESSOR,
|
|
112
|
+
NlPlanningRequestProcessor,
|
|
113
|
+
NlPlanningResponseProcessor
|
|
114
|
+
});
|
|
@@ -82,9 +82,7 @@ const _GcsArtifactService = class _GcsArtifactService {
|
|
|
82
82
|
version
|
|
83
83
|
})
|
|
84
84
|
);
|
|
85
|
-
const customMetadata =
|
|
86
|
-
...request.customMetadata
|
|
87
|
-
};
|
|
85
|
+
const customMetadata = stringifyMetadataValues(request.customMetadata);
|
|
88
86
|
if (request.artifact.inlineData) {
|
|
89
87
|
if (request.artifact.inlineData.displayName) {
|
|
90
88
|
customMetadata[GCS_DISPLAY_NAME_METADATA_KEY] = request.artifact.inlineData.displayName;
|
|
@@ -208,10 +206,9 @@ const _GcsArtifactService = class _GcsArtifactService {
|
|
|
208
206
|
const [files] = await bucket.getFiles({ prefix: searchPrefix });
|
|
209
207
|
const versions = [];
|
|
210
208
|
for (const file of files) {
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
versions.push(v);
|
|
209
|
+
const suffix = file.name.slice(searchPrefix.length);
|
|
210
|
+
if (/^\d+$/.test(suffix)) {
|
|
211
|
+
versions.push(Number(suffix));
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
214
|
return versions.sort((a, b) => a - b);
|
|
@@ -277,6 +274,15 @@ function getFileName({
|
|
|
277
274
|
return version !== void 0 ? `${prefix}/${version}` : prefix;
|
|
278
275
|
}
|
|
279
276
|
__name(getFileName, "getFileName");
|
|
277
|
+
function stringifyMetadataValues(customMetadata) {
|
|
278
|
+
return Object.fromEntries(
|
|
279
|
+
Object.entries(customMetadata != null ? customMetadata : {}).map(([key, value]) => [
|
|
280
|
+
key,
|
|
281
|
+
String(value)
|
|
282
|
+
])
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
__name(stringifyMetadataValues, "stringifyMetadataValues");
|
|
280
286
|
function extractArtifactKeys(files, fileNamePrefix, keyPrefix = "") {
|
|
281
287
|
const keys = /* @__PURE__ */ new Set();
|
|
282
288
|
for (const file of files) {
|
|
@@ -9,6 +9,7 @@ var __defProp = Object.defineProperty;
|
|
|
9
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
11
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
13
|
var __export = (target, all) => {
|
|
13
14
|
for (var name in all)
|
|
14
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -24,7 +25,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
26
|
var auth_credential_exports = {};
|
|
26
27
|
__export(auth_credential_exports, {
|
|
27
|
-
AuthCredentialTypes: () => AuthCredentialTypes
|
|
28
|
+
AuthCredentialTypes: () => AuthCredentialTypes,
|
|
29
|
+
isAuthCredential: () => isAuthCredential
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(auth_credential_exports);
|
|
30
32
|
/**
|
|
@@ -40,7 +42,15 @@ var AuthCredentialTypes = /* @__PURE__ */ ((AuthCredentialTypes2) => {
|
|
|
40
42
|
AuthCredentialTypes2["SERVICE_ACCOUNT"] = "serviceAccount";
|
|
41
43
|
return AuthCredentialTypes2;
|
|
42
44
|
})(AuthCredentialTypes || {});
|
|
45
|
+
const AUTH_CREDENTIAL_TYPES = new Set(
|
|
46
|
+
Object.values(AuthCredentialTypes)
|
|
47
|
+
);
|
|
48
|
+
function isAuthCredential(value) {
|
|
49
|
+
return typeof value === "object" && value !== null && "authType" in value && AUTH_CREDENTIAL_TYPES.has(value.authType);
|
|
50
|
+
}
|
|
51
|
+
__name(isAuthCredential, "isAuthCredential");
|
|
43
52
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
53
|
0 && (module.exports = {
|
|
45
|
-
AuthCredentialTypes
|
|
54
|
+
AuthCredentialTypes,
|
|
55
|
+
isAuthCredential
|
|
46
56
|
});
|
|
@@ -148,9 +148,9 @@ function convertCodeExecutionParts(content, codeBlockDelimiter, executionResultD
|
|
|
148
148
|
text: codeBlockDelimiter[0] + (lastPart.executableCode.code || "") + codeBlockDelimiter[1]
|
|
149
149
|
};
|
|
150
150
|
} else if (content.parts.length == 1 && lastPart.codeExecutionResult) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
};
|
|
151
|
+
const output = lastPart.codeExecutionResult.output;
|
|
152
|
+
const text = output == null ? "" : executionResultDelimiters[0] + output + executionResultDelimiters[1];
|
|
153
|
+
content.parts[content.parts.length - 1] = { text };
|
|
154
154
|
content.role = "user";
|
|
155
155
|
}
|
|
156
156
|
}
|
package/dist/cjs/common.js
CHANGED
|
@@ -49,6 +49,7 @@ __export(common_exports, {
|
|
|
49
49
|
BaseLlmRequestProcessor: () => import_base_llm_processor.BaseLlmRequestProcessor,
|
|
50
50
|
BaseLlmResponseProcessor: () => import_base_llm_processor.BaseLlmResponseProcessor,
|
|
51
51
|
BaseNode: () => import_workflow.BaseNode,
|
|
52
|
+
BasePlanner: () => import_base_planner.BasePlanner,
|
|
52
53
|
BasePlugin: () => import_base_plugin.BasePlugin,
|
|
53
54
|
BaseRetrievalTool: () => import_base_retrieval_tool.BaseRetrievalTool,
|
|
54
55
|
BaseSessionService: () => import_base_session_service.BaseSessionService,
|
|
@@ -56,8 +57,10 @@ __export(common_exports, {
|
|
|
56
57
|
BaseToolset: () => import_base_toolset.BaseToolset,
|
|
57
58
|
BranchPath: () => import_workflow.BranchPath,
|
|
58
59
|
BuiltInCodeExecutor: () => import_built_in_code_executor.BuiltInCodeExecutor,
|
|
60
|
+
BuiltInPlanner: () => import_built_in_planner.BuiltInPlanner,
|
|
59
61
|
BuiltInTool: () => import_built_in_tool.BuiltInTool,
|
|
60
62
|
CONTENT_REQUEST_PROCESSOR: () => import_content_request_processor.CONTENT_REQUEST_PROCESSOR,
|
|
63
|
+
CallbackContext: () => import_tool_context.CallbackContext,
|
|
61
64
|
ChromeBuiltInLlm: () => import_chrome_prompt_llm.ChromeBuiltInLlm,
|
|
62
65
|
ChromeModelUnavailableError: () => import_chrome_prompt_llm.ChromeModelUnavailableError,
|
|
63
66
|
CodeExecutionLanguage: () => import_code_execution_utils.CodeExecutionLanguage,
|
|
@@ -93,6 +96,7 @@ __export(common_exports, {
|
|
|
93
96
|
GoogleSearchTool: () => import_google_search_tool.GoogleSearchTool,
|
|
94
97
|
Graph: () => import_workflow.Graph,
|
|
95
98
|
INTERACTIONS_REQUEST_PROCESSOR: () => import_interactions_request_processor.INTERACTIONS_REQUEST_PROCESSOR,
|
|
99
|
+
INTERNAL_METADATA_PREFIX: () => import_internal_metadata.INTERNAL_METADATA_PREFIX,
|
|
96
100
|
InMemoryArtifactService: () => import_in_memory_artifact_service.InMemoryArtifactService,
|
|
97
101
|
InMemoryCredentialService: () => import_in_memory_credential_service.InMemoryCredentialService,
|
|
98
102
|
InMemoryMemoryService: () => import_in_memory_memory_service.InMemoryMemoryService,
|
|
@@ -132,6 +136,7 @@ __export(common_exports, {
|
|
|
132
136
|
PRELOAD_MEMORY: () => import_preload_memory_tool.PRELOAD_MEMORY,
|
|
133
137
|
ParallelAgent: () => import_parallel_agent.ParallelAgent,
|
|
134
138
|
ParallelWorker: () => import_workflow.ParallelWorker,
|
|
139
|
+
PlanReActPlanner: () => import_plan_re_act_planner.PlanReActPlanner,
|
|
135
140
|
PluginManager: () => import_plugin_manager.PluginManager,
|
|
136
141
|
PolicyOutcome: () => import_security_plugin.PolicyOutcome,
|
|
137
142
|
PreloadMemoryTool: () => import_preload_memory_tool.PreloadMemoryTool,
|
|
@@ -140,6 +145,7 @@ __export(common_exports, {
|
|
|
140
145
|
REQUEST_CREDENTIAL_FUNCTION_CALL_NAME: () => import_functions.REQUEST_CREDENTIAL_FUNCTION_CALL_NAME,
|
|
141
146
|
REQUEST_INPUT_FUNCTION_CALL_NAME: () => import_functions.REQUEST_INPUT_FUNCTION_CALL_NAME,
|
|
142
147
|
RESERVED_TOOL_CALL_ERROR_TYPE: () => import_reflect_retry_model_plugin.RESERVED_TOOL_CALL_ERROR_TYPE,
|
|
148
|
+
RESTORED_EVENT_KEY: () => import_internal_metadata.RESTORED_EVENT_KEY,
|
|
143
149
|
ReadonlyContext: () => import_readonly_context.ReadonlyContext,
|
|
144
150
|
ReflectAndRetryModelPlugin: () => import_reflect_retry_model_plugin.ReflectAndRetryModelPlugin,
|
|
145
151
|
ReflectAndRetryToolPlugin: () => import_reflect_retry_tool_plugin.ReflectAndRetryToolPlugin,
|
|
@@ -160,7 +166,10 @@ __export(common_exports, {
|
|
|
160
166
|
StreamingMode: () => import_run_config.StreamingMode,
|
|
161
167
|
Task: () => import_task.Task,
|
|
162
168
|
TokenBasedContextCompactor: () => import_token_based_context_compactor.TokenBasedContextCompactor,
|
|
169
|
+
ToolCallIntegrityError: () => import_tool_call_integrity_plugin.ToolCallIntegrityError,
|
|
170
|
+
ToolCallIntegrityPlugin: () => import_tool_call_integrity_plugin.ToolCallIntegrityPlugin,
|
|
163
171
|
ToolConfirmation: () => import_tool_confirmation.ToolConfirmation,
|
|
172
|
+
ToolContext: () => import_tool_context.ToolContext,
|
|
164
173
|
ToolErrorType: () => import_tool_execution_error.ToolErrorType,
|
|
165
174
|
ToolExecutionError: () => import_tool_execution_error.ToolExecutionError,
|
|
166
175
|
ToolNode: () => import_workflow.ToolNode,
|
|
@@ -169,8 +178,11 @@ __export(common_exports, {
|
|
|
169
178
|
TruncatingContextCompactor: () => import_truncating_context_compactor.TruncatingContextCompactor,
|
|
170
179
|
URL_CONTEXT: () => import_url_context_tool.URL_CONTEXT,
|
|
171
180
|
UrlContextTool: () => import_url_context_tool.UrlContextTool,
|
|
181
|
+
VertexAiExampleStore: () => import_example.VertexAiExampleStore,
|
|
172
182
|
VertexAiSearchTool: () => import_vertex_ai_search_tool.VertexAiSearchTool,
|
|
173
183
|
VertexRagRetrievalTool: () => import_vertex_rag_retrieval_tool.VertexRagRetrievalTool,
|
|
184
|
+
WebMCPTool: () => import_webmcp_tool.WebMCPTool,
|
|
185
|
+
WebMCPToolset: () => import_webmcp_toolset.WebMCPToolset,
|
|
174
186
|
Workflow: () => import_workflow.Workflow,
|
|
175
187
|
WorkflowNode: () => import_workflow.WorkflowNode,
|
|
176
188
|
asRunnableRoot: () => import_workflow.asRunnableRoot,
|
|
@@ -194,6 +206,7 @@ __export(common_exports, {
|
|
|
194
206
|
getFunctionCalls: () => import_event.getFunctionCalls,
|
|
195
207
|
getFunctionResponses: () => import_event.getFunctionResponses,
|
|
196
208
|
getLogger: () => import_logger.getLogger,
|
|
209
|
+
getModelContext: () => import_webmcp_types.getModelContext,
|
|
197
210
|
getPendingUserInputRequests: () => import_user_input_request.getPendingUserInputRequests,
|
|
198
211
|
getUserChoiceTool: () => import_get_user_choice_tool.getUserChoiceTool,
|
|
199
212
|
getUserInputRequests: () => import_user_input_request.getUserInputRequests,
|
|
@@ -201,16 +214,21 @@ __export(common_exports, {
|
|
|
201
214
|
hasTrailingCodeExecutionResult: () => import_event.hasTrailingCodeExecutionResult,
|
|
202
215
|
isAgentTool: () => import_agent_tool.isAgentTool,
|
|
203
216
|
isApp: () => import_app.isApp,
|
|
217
|
+
isAuthCredential: () => import_auth_credential.isAuthCredential,
|
|
204
218
|
isBaseAgent: () => import_base_agent.isBaseAgent,
|
|
205
219
|
isBaseExampleProvider: () => import_base_example_provider.isBaseExampleProvider,
|
|
206
220
|
isBaseLlm: () => import_base_llm.isBaseLlm,
|
|
221
|
+
isBasePlanner: () => import_base_planner.isBasePlanner,
|
|
207
222
|
isBaseTool: () => import_base_tool.isBaseTool,
|
|
208
223
|
isBaseToolset: () => import_base_toolset.isBaseToolset,
|
|
224
|
+
isBuiltInPlanner: () => import_built_in_planner.isBuiltInPlanner,
|
|
209
225
|
isCompactedEvent: () => import_compacted_event.isCompactedEvent,
|
|
210
226
|
isFinalResponse: () => import_event.isFinalResponse,
|
|
211
227
|
isFunctionTool: () => import_function_tool.isFunctionTool,
|
|
212
228
|
isGemini2OrAbove: () => import_model_name.isGemini2OrAbove,
|
|
229
|
+
isGemini35LiveTranslate: () => import_model_name.isGemini35LiveTranslate,
|
|
213
230
|
isGemini3xFlashLive: () => import_model_name.isGemini3xFlashLive,
|
|
231
|
+
isGemini3xLive: () => import_model_name.isGemini3xLive,
|
|
214
232
|
isIntentMismatchError: () => import_tool_confirmation.isIntentMismatchError,
|
|
215
233
|
isLlmAgent: () => import_llm_agent.isLlmAgent,
|
|
216
234
|
isLoopAgent: () => import_loop_agent.isLoopAgent,
|
|
@@ -230,12 +248,19 @@ __export(common_exports, {
|
|
|
230
248
|
isSessionArtifactService: () => import_session_artifact_service.isSessionArtifactService,
|
|
231
249
|
isStateSchemaError: () => import_state.isStateSchemaError,
|
|
232
250
|
isToolNotFound: () => import_functions.isToolNotFound,
|
|
251
|
+
isWebMCPSupported: () => import_webmcp_types.isWebMCPSupported,
|
|
233
252
|
isWorkflow: () => import_workflow.isWorkflow,
|
|
253
|
+
logger: () => import_logger.logger,
|
|
254
|
+
markRestored: () => import_internal_metadata.markRestored,
|
|
234
255
|
node: () => import_workflow.node,
|
|
235
256
|
normalizeRetryExceptions: () => import_workflow.normalizeRetryExceptions,
|
|
236
257
|
populateClientFunctionCallId: () => import_event.populateClientFunctionCallId,
|
|
237
258
|
prepareRetryConfig: () => import_workflow.prepareRetryConfig,
|
|
238
259
|
pruneThoughts: () => import_event.pruneThoughts,
|
|
260
|
+
publicEvent: () => import_internal_metadata.publicEvent,
|
|
261
|
+
publicMetadata: () => import_internal_metadata.publicMetadata,
|
|
262
|
+
publicSession: () => import_internal_metadata.publicSession,
|
|
263
|
+
renameReservedKeywords: () => import_case_utils.renameReservedKeywords,
|
|
239
264
|
requestInputTool: () => import_request_input_tool.requestInputTool,
|
|
240
265
|
requireAgent: () => import_invocation_context.requireAgent,
|
|
241
266
|
requiresUserInput: () => import_user_input_request.requiresUserInput,
|
|
@@ -246,6 +271,7 @@ __export(common_exports, {
|
|
|
246
271
|
setLogger: () => import_logger.setLogger,
|
|
247
272
|
stringifyContent: () => import_event.stringifyContent,
|
|
248
273
|
stripAdkIdentityPreamble: () => import_chrome_prompt_llm.stripAdkIdentityPreamble,
|
|
274
|
+
toSnakeCaseName: () => import_case_utils.toSnakeCaseName,
|
|
249
275
|
toStructuredEvents: () => import_structured_events.toStructuredEvents,
|
|
250
276
|
validateAppName: () => import_app.validateAppName,
|
|
251
277
|
version: () => import_version.version,
|
|
@@ -304,8 +330,10 @@ var import_tool_execution_error = require("./errors/tool_execution_error.js");
|
|
|
304
330
|
var import_compacted_event = require("./events/compacted_event.js");
|
|
305
331
|
var import_event = require("./events/event.js");
|
|
306
332
|
var import_event_actions = require("./events/event_actions.js");
|
|
333
|
+
var import_internal_metadata = require("./events/internal_metadata.js");
|
|
307
334
|
var import_structured_events = require("./events/structured_events.js");
|
|
308
335
|
var import_base_example_provider = require("./examples/base_example_provider.js");
|
|
336
|
+
var import_example = require("./examples/example.js");
|
|
309
337
|
var import_in_memory_memory_service = require("./memory/in_memory_memory_service.js");
|
|
310
338
|
var import_apigee_llm = require("./models/apigee_llm.js");
|
|
311
339
|
var import_base_llm = require("./models/base_llm.js");
|
|
@@ -313,6 +341,9 @@ var import_chrome_prompt_llm = require("./models/chrome_prompt_llm.js");
|
|
|
313
341
|
var import_google_llm = require("./models/google_llm.js");
|
|
314
342
|
var import_registry = require("./models/registry.js");
|
|
315
343
|
var import_routed_llm = require("./models/routed_llm.js");
|
|
344
|
+
var import_base_planner = require("./planners/base_planner.js");
|
|
345
|
+
var import_built_in_planner = require("./planners/built_in_planner.js");
|
|
346
|
+
var import_plan_re_act_planner = require("./planners/plan_re_act_planner.js");
|
|
316
347
|
var import_reflect_retry_utils = require("./plugins/_reflect_retry_utils.js");
|
|
317
348
|
var import_base_plugin = require("./plugins/base_plugin.js");
|
|
318
349
|
var import_global_instruction_plugin = require("./plugins/global_instruction_plugin.js");
|
|
@@ -321,6 +352,7 @@ var import_plugin_manager = require("./plugins/plugin_manager.js");
|
|
|
321
352
|
var import_reflect_retry_model_plugin = require("./plugins/reflect_retry_model_plugin.js");
|
|
322
353
|
var import_reflect_retry_tool_plugin = require("./plugins/reflect_retry_tool_plugin.js");
|
|
323
354
|
var import_security_plugin = require("./plugins/security_plugin.js");
|
|
355
|
+
var import_tool_call_integrity_plugin = require("./plugins/tool_call_integrity_plugin.js");
|
|
324
356
|
var import_in_memory_runner = require("./runner/in_memory_runner.js");
|
|
325
357
|
var import_runner = require("./runner/runner.js");
|
|
326
358
|
var import_base_session_service = require("./sessions/base_session_service.js");
|
|
@@ -349,10 +381,15 @@ var import_request_input_tool = require("./tools/request_input_tool.js");
|
|
|
349
381
|
var import_base_retrieval_tool = require("./tools/retrieval/base_retrieval_tool.js");
|
|
350
382
|
var import_llama_index_retrieval = require("./tools/retrieval/llama_index_retrieval.js");
|
|
351
383
|
var import_tool_confirmation = require("./tools/tool_confirmation.js");
|
|
384
|
+
var import_tool_context = require("./tools/tool_context.js");
|
|
352
385
|
var import_url_context_tool = require("./tools/url_context_tool.js");
|
|
353
386
|
var import_vertex_ai_search_tool = require("./tools/vertex_ai_search_tool.js");
|
|
354
387
|
var import_vertex_rag_retrieval_tool = require("./tools/vertex_rag_retrieval_tool.js");
|
|
388
|
+
var import_webmcp_tool = require("./tools/webmcp/webmcp_tool.js");
|
|
389
|
+
var import_webmcp_toolset = require("./tools/webmcp/webmcp_toolset.js");
|
|
390
|
+
var import_webmcp_types = require("./tools/webmcp/webmcp_types.js");
|
|
355
391
|
var import_async_queue = require("./utils/async_queue.js");
|
|
392
|
+
var import_case_utils = require("./utils/case_utils.js");
|
|
356
393
|
var import_client_labels = require("./utils/client_labels.js");
|
|
357
394
|
var import_logger = require("./utils/logger.js");
|
|
358
395
|
var import_model_name = require("./utils/model_name.js");
|
|
@@ -406,6 +443,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
406
443
|
BaseLlmRequestProcessor,
|
|
407
444
|
BaseLlmResponseProcessor,
|
|
408
445
|
BaseNode,
|
|
446
|
+
BasePlanner,
|
|
409
447
|
BasePlugin,
|
|
410
448
|
BaseRetrievalTool,
|
|
411
449
|
BaseSessionService,
|
|
@@ -413,8 +451,10 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
413
451
|
BaseToolset,
|
|
414
452
|
BranchPath,
|
|
415
453
|
BuiltInCodeExecutor,
|
|
454
|
+
BuiltInPlanner,
|
|
416
455
|
BuiltInTool,
|
|
417
456
|
CONTENT_REQUEST_PROCESSOR,
|
|
457
|
+
CallbackContext,
|
|
418
458
|
ChromeBuiltInLlm,
|
|
419
459
|
ChromeModelUnavailableError,
|
|
420
460
|
CodeExecutionLanguage,
|
|
@@ -450,6 +490,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
450
490
|
GoogleSearchTool,
|
|
451
491
|
Graph,
|
|
452
492
|
INTERACTIONS_REQUEST_PROCESSOR,
|
|
493
|
+
INTERNAL_METADATA_PREFIX,
|
|
453
494
|
InMemoryArtifactService,
|
|
454
495
|
InMemoryCredentialService,
|
|
455
496
|
InMemoryMemoryService,
|
|
@@ -489,6 +530,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
489
530
|
PRELOAD_MEMORY,
|
|
490
531
|
ParallelAgent,
|
|
491
532
|
ParallelWorker,
|
|
533
|
+
PlanReActPlanner,
|
|
492
534
|
PluginManager,
|
|
493
535
|
PolicyOutcome,
|
|
494
536
|
PreloadMemoryTool,
|
|
@@ -497,6 +539,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
497
539
|
REQUEST_CREDENTIAL_FUNCTION_CALL_NAME,
|
|
498
540
|
REQUEST_INPUT_FUNCTION_CALL_NAME,
|
|
499
541
|
RESERVED_TOOL_CALL_ERROR_TYPE,
|
|
542
|
+
RESTORED_EVENT_KEY,
|
|
500
543
|
ReadonlyContext,
|
|
501
544
|
ReflectAndRetryModelPlugin,
|
|
502
545
|
ReflectAndRetryToolPlugin,
|
|
@@ -517,7 +560,10 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
517
560
|
StreamingMode,
|
|
518
561
|
Task,
|
|
519
562
|
TokenBasedContextCompactor,
|
|
563
|
+
ToolCallIntegrityError,
|
|
564
|
+
ToolCallIntegrityPlugin,
|
|
520
565
|
ToolConfirmation,
|
|
566
|
+
ToolContext,
|
|
521
567
|
ToolErrorType,
|
|
522
568
|
ToolExecutionError,
|
|
523
569
|
ToolNode,
|
|
@@ -526,8 +572,11 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
526
572
|
TruncatingContextCompactor,
|
|
527
573
|
URL_CONTEXT,
|
|
528
574
|
UrlContextTool,
|
|
575
|
+
VertexAiExampleStore,
|
|
529
576
|
VertexAiSearchTool,
|
|
530
577
|
VertexRagRetrievalTool,
|
|
578
|
+
WebMCPTool,
|
|
579
|
+
WebMCPToolset,
|
|
531
580
|
Workflow,
|
|
532
581
|
WorkflowNode,
|
|
533
582
|
asRunnableRoot,
|
|
@@ -551,6 +600,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
551
600
|
getFunctionCalls,
|
|
552
601
|
getFunctionResponses,
|
|
553
602
|
getLogger,
|
|
603
|
+
getModelContext,
|
|
554
604
|
getPendingUserInputRequests,
|
|
555
605
|
getUserChoiceTool,
|
|
556
606
|
getUserInputRequests,
|
|
@@ -558,16 +608,21 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
558
608
|
hasTrailingCodeExecutionResult,
|
|
559
609
|
isAgentTool,
|
|
560
610
|
isApp,
|
|
611
|
+
isAuthCredential,
|
|
561
612
|
isBaseAgent,
|
|
562
613
|
isBaseExampleProvider,
|
|
563
614
|
isBaseLlm,
|
|
615
|
+
isBasePlanner,
|
|
564
616
|
isBaseTool,
|
|
565
617
|
isBaseToolset,
|
|
618
|
+
isBuiltInPlanner,
|
|
566
619
|
isCompactedEvent,
|
|
567
620
|
isFinalResponse,
|
|
568
621
|
isFunctionTool,
|
|
569
622
|
isGemini2OrAbove,
|
|
623
|
+
isGemini35LiveTranslate,
|
|
570
624
|
isGemini3xFlashLive,
|
|
625
|
+
isGemini3xLive,
|
|
571
626
|
isIntentMismatchError,
|
|
572
627
|
isLlmAgent,
|
|
573
628
|
isLoopAgent,
|
|
@@ -587,12 +642,19 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
587
642
|
isSessionArtifactService,
|
|
588
643
|
isStateSchemaError,
|
|
589
644
|
isToolNotFound,
|
|
645
|
+
isWebMCPSupported,
|
|
590
646
|
isWorkflow,
|
|
647
|
+
logger,
|
|
648
|
+
markRestored,
|
|
591
649
|
node,
|
|
592
650
|
normalizeRetryExceptions,
|
|
593
651
|
populateClientFunctionCallId,
|
|
594
652
|
prepareRetryConfig,
|
|
595
653
|
pruneThoughts,
|
|
654
|
+
publicEvent,
|
|
655
|
+
publicMetadata,
|
|
656
|
+
publicSession,
|
|
657
|
+
renameReservedKeywords,
|
|
596
658
|
requestInputTool,
|
|
597
659
|
requireAgent,
|
|
598
660
|
requiresUserInput,
|
|
@@ -603,6 +665,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
|
|
|
603
665
|
setLogger,
|
|
604
666
|
stringifyContent,
|
|
605
667
|
stripAdkIdentityPreamble,
|
|
668
|
+
toSnakeCaseName,
|
|
606
669
|
toStructuredEvents,
|
|
607
670
|
validateAppName,
|
|
608
671
|
version,
|