@google/gemini-cli 0.34.0-preview.0 → 0.34.0-preview.2
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/bundle/gemini.js
CHANGED
|
@@ -104260,7 +104260,7 @@ var init_mcp_tool = __esm({
|
|
|
104260
104260
|
return safeJsonStringify(this.params);
|
|
104261
104261
|
}
|
|
104262
104262
|
};
|
|
104263
|
-
DiscoveredMCPTool = class
|
|
104263
|
+
DiscoveredMCPTool = class extends BaseDeclarativeTool {
|
|
104264
104264
|
mcpTool;
|
|
104265
104265
|
serverName;
|
|
104266
104266
|
serverToolName;
|
|
@@ -104312,9 +104312,6 @@ var init_mcp_tool = __esm({
|
|
|
104312
104312
|
getFullyQualifiedName() {
|
|
104313
104313
|
return generateValidName(`${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}${this.serverToolName}`);
|
|
104314
104314
|
}
|
|
104315
|
-
asFullyQualifiedTool() {
|
|
104316
|
-
return new _DiscoveredMCPTool(this.mcpTool, this.serverName, this.serverToolName, this.description, this.parameterSchema, this.messageBus, this.trust, this.isReadOnly, this.getFullyQualifiedName(), this.cliConfig, this.extensionName, this.extensionId, this._toolAnnotations);
|
|
104317
|
-
}
|
|
104318
104315
|
createInvocation(params, messageBus, _toolName, _displayName) {
|
|
104319
104316
|
return new DiscoveredMCPToolInvocation(this.mcpTool, this.serverName, this.serverToolName, _displayName ?? this.displayName, messageBus, this.trust, params, this.cliConfig, this.description, this.parameterSchema, this._toolAnnotations);
|
|
104320
104317
|
}
|
|
@@ -195045,18 +195042,28 @@ function isValidToolName(name3, options = {}) {
|
|
|
195045
195042
|
if (options.allowWildcards && name3 === "*") {
|
|
195046
195043
|
return true;
|
|
195047
195044
|
}
|
|
195048
|
-
if (name3
|
|
195049
|
-
|
|
195050
|
-
|
|
195045
|
+
if (isMcpToolName(name3)) {
|
|
195046
|
+
if (name3 === `${MCP_TOOL_PREFIX}*` && options.allowWildcards) {
|
|
195047
|
+
return true;
|
|
195048
|
+
}
|
|
195049
|
+
if (name3.startsWith(`${MCP_TOOL_PREFIX}_`)) {
|
|
195051
195050
|
return false;
|
|
195052
195051
|
}
|
|
195053
|
-
const
|
|
195054
|
-
|
|
195055
|
-
|
|
195056
|
-
|
|
195052
|
+
const parsed = parseMcpToolName(name3);
|
|
195053
|
+
if (parsed.serverName && parsed.toolName) {
|
|
195054
|
+
const slugRegex = /^[a-z0-9_.:-]+$/i;
|
|
195055
|
+
if (!slugRegex.test(parsed.serverName)) {
|
|
195056
|
+
return false;
|
|
195057
|
+
}
|
|
195058
|
+
if (parsed.toolName === "*") {
|
|
195059
|
+
return options.allowWildcards === true;
|
|
195060
|
+
}
|
|
195061
|
+
if (/^_*$/.test(parsed.toolName)) {
|
|
195062
|
+
return false;
|
|
195063
|
+
}
|
|
195064
|
+
return slugRegex.test(parsed.toolName);
|
|
195057
195065
|
}
|
|
195058
|
-
|
|
195059
|
-
return slugRegex.test(server) && slugRegex.test(tool);
|
|
195066
|
+
return false;
|
|
195060
195067
|
}
|
|
195061
195068
|
return false;
|
|
195062
195069
|
}
|
|
@@ -195065,6 +195072,7 @@ var init_tool_names = __esm({
|
|
|
195065
195072
|
"packages/core/dist/src/tools/tool-names.js"() {
|
|
195066
195073
|
"use strict";
|
|
195067
195074
|
init_coreTools();
|
|
195075
|
+
init_mcp_tool();
|
|
195068
195076
|
LS_TOOL_NAME_LEGACY = "list_directory";
|
|
195069
195077
|
EDIT_TOOL_NAMES = /* @__PURE__ */ new Set([EDIT_TOOL_NAME, WRITE_FILE_TOOL_NAME]);
|
|
195070
195078
|
SENSITIVE_TOOLS = /* @__PURE__ */ new Set([
|
|
@@ -195136,8 +195144,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
195136
195144
|
var init_git_commit = __esm({
|
|
195137
195145
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
195138
195146
|
"use strict";
|
|
195139
|
-
GIT_COMMIT_INFO = "
|
|
195140
|
-
CLI_VERSION = "0.34.0-preview.
|
|
195147
|
+
GIT_COMMIT_INFO = "4085b4f8e";
|
|
195148
|
+
CLI_VERSION = "0.34.0-preview.2";
|
|
195141
195149
|
}
|
|
195142
195150
|
});
|
|
195143
195151
|
|
|
@@ -334183,7 +334191,7 @@ function getVersion() {
|
|
|
334183
334191
|
}
|
|
334184
334192
|
versionPromise = (async () => {
|
|
334185
334193
|
const pkgJson = await getPackageJson(__dirname3);
|
|
334186
|
-
return "0.34.0-preview.
|
|
334194
|
+
return "0.34.0-preview.2";
|
|
334187
334195
|
})();
|
|
334188
334196
|
return versionPromise;
|
|
334189
334197
|
}
|
|
@@ -336138,11 +336146,7 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
|
|
336138
336146
|
*/
|
|
336139
336147
|
registerTool(tool) {
|
|
336140
336148
|
if (this.allKnownTools.has(tool.name)) {
|
|
336141
|
-
|
|
336142
|
-
tool = tool.asFullyQualifiedTool();
|
|
336143
|
-
} else {
|
|
336144
|
-
debugLogger.warn(`Tool with name "${tool.name}" is already registered. Overwriting.`);
|
|
336145
|
-
}
|
|
336149
|
+
debugLogger.warn(`Tool with name "${tool.name}" is already registered. Overwriting.`);
|
|
336146
336150
|
}
|
|
336147
336151
|
this.allKnownTools.set(tool.name, tool);
|
|
336148
336152
|
}
|
|
@@ -336416,7 +336420,14 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
|
|
336416
336420
|
for (const name3 of toolNames) {
|
|
336417
336421
|
const tool = this.getTool(name3);
|
|
336418
336422
|
if (tool) {
|
|
336419
|
-
|
|
336423
|
+
let schema2 = tool.getSchema(modelId);
|
|
336424
|
+
if (tool instanceof DiscoveredMCPTool) {
|
|
336425
|
+
schema2 = {
|
|
336426
|
+
...schema2,
|
|
336427
|
+
name: tool.getFullyQualifiedName()
|
|
336428
|
+
};
|
|
336429
|
+
}
|
|
336430
|
+
declarations.push(schema2);
|
|
336420
336431
|
}
|
|
336421
336432
|
}
|
|
336422
336433
|
return declarations;
|
|
@@ -336476,16 +336487,6 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
|
|
336476
336487
|
debugLogger.debug(`Resolved legacy tool name "${name3}" to current name "${currentName}"`);
|
|
336477
336488
|
}
|
|
336478
336489
|
}
|
|
336479
|
-
if (!tool && name3.includes("__")) {
|
|
336480
|
-
for (const t3 of this.allKnownTools.values()) {
|
|
336481
|
-
if (t3 instanceof DiscoveredMCPTool) {
|
|
336482
|
-
if (t3.getFullyQualifiedName() === name3) {
|
|
336483
|
-
tool = t3;
|
|
336484
|
-
break;
|
|
336485
|
-
}
|
|
336486
|
-
}
|
|
336487
|
-
}
|
|
336488
|
-
}
|
|
336489
336490
|
if (tool && this.isActiveTool(tool)) {
|
|
336490
336491
|
return tool;
|
|
336491
336492
|
}
|
|
@@ -408735,7 +408736,7 @@ var init_agentLoader = __esm({
|
|
|
408735
408736
|
name: nameSchema,
|
|
408736
408737
|
description: external_exports.string().min(1),
|
|
408737
408738
|
display_name: external_exports.string().optional(),
|
|
408738
|
-
tools: external_exports.array(external_exports.string().refine((val) => isValidToolName(val), {
|
|
408739
|
+
tools: external_exports.array(external_exports.string().refine((val) => isValidToolName(val, { allowWildcards: true }), {
|
|
408739
408740
|
message: "Invalid tool name"
|
|
408740
408741
|
})).optional(),
|
|
408741
408742
|
model: external_exports.string().optional(),
|
|
@@ -415590,6 +415591,7 @@ var init_local_executor = __esm({
|
|
|
415590
415591
|
init_geminiChat();
|
|
415591
415592
|
init_node();
|
|
415592
415593
|
init_tool_registry();
|
|
415594
|
+
init_tools();
|
|
415593
415595
|
init_mcp_tool();
|
|
415594
415596
|
init_turn();
|
|
415595
415597
|
init_types3();
|
|
@@ -415649,18 +415651,40 @@ var init_local_executor = __esm({
|
|
|
415649
415651
|
const agentToolRegistry = new ToolRegistry(runtimeContext, subagentMessageBus);
|
|
415650
415652
|
const parentToolRegistry = runtimeContext.getToolRegistry();
|
|
415651
415653
|
const allAgentNames = new Set(runtimeContext.getAgentRegistry().getAllAgentNames());
|
|
415654
|
+
const registerToolInstance = (tool) => {
|
|
415655
|
+
if (allAgentNames.has(tool.name)) {
|
|
415656
|
+
debugLogger.warn(`[LocalAgentExecutor] Skipping subagent tool '${tool.name}' for agent '${definition.name}' to prevent recursion.`);
|
|
415657
|
+
return;
|
|
415658
|
+
}
|
|
415659
|
+
agentToolRegistry.registerTool(tool);
|
|
415660
|
+
};
|
|
415652
415661
|
const registerToolByName = (toolName) => {
|
|
415653
|
-
if (
|
|
415654
|
-
|
|
415662
|
+
if (toolName === "*") {
|
|
415663
|
+
for (const tool2 of parentToolRegistry.getAllTools()) {
|
|
415664
|
+
registerToolInstance(tool2);
|
|
415665
|
+
}
|
|
415655
415666
|
return;
|
|
415656
415667
|
}
|
|
415668
|
+
if (isMcpToolName(toolName)) {
|
|
415669
|
+
if (toolName === `${MCP_TOOL_PREFIX}*`) {
|
|
415670
|
+
for (const tool2 of parentToolRegistry.getAllTools()) {
|
|
415671
|
+
if (tool2 instanceof DiscoveredMCPTool) {
|
|
415672
|
+
registerToolInstance(tool2);
|
|
415673
|
+
}
|
|
415674
|
+
}
|
|
415675
|
+
return;
|
|
415676
|
+
}
|
|
415677
|
+
const parsed = parseMcpToolName(toolName);
|
|
415678
|
+
if (parsed.serverName && parsed.toolName === "*") {
|
|
415679
|
+
for (const tool2 of parentToolRegistry.getToolsByServer(parsed.serverName)) {
|
|
415680
|
+
registerToolInstance(tool2);
|
|
415681
|
+
}
|
|
415682
|
+
return;
|
|
415683
|
+
}
|
|
415684
|
+
}
|
|
415657
415685
|
const tool = parentToolRegistry.getTool(toolName);
|
|
415658
415686
|
if (tool) {
|
|
415659
|
-
|
|
415660
|
-
agentToolRegistry.registerTool(tool.asFullyQualifiedTool());
|
|
415661
|
-
} else {
|
|
415662
|
-
agentToolRegistry.registerTool(tool);
|
|
415663
|
-
}
|
|
415687
|
+
registerToolInstance(tool);
|
|
415664
415688
|
}
|
|
415665
415689
|
};
|
|
415666
415690
|
if (definition.toolConfig) {
|
|
@@ -416323,17 +416347,12 @@ var init_local_executor = __esm({
|
|
|
416323
416347
|
const toolsList = [];
|
|
416324
416348
|
const { toolConfig, outputConfig } = this.definition;
|
|
416325
416349
|
if (toolConfig) {
|
|
416326
|
-
const toolNamesToLoad = [];
|
|
416327
416350
|
for (const toolRef of toolConfig.tools) {
|
|
416328
|
-
if (typeof toolRef === "
|
|
416329
|
-
toolNamesToLoad.push(toolRef);
|
|
416330
|
-
} else if (typeof toolRef === "object" && "schema" in toolRef) {
|
|
416331
|
-
toolsList.push(toolRef.schema);
|
|
416332
|
-
} else {
|
|
416351
|
+
if (typeof toolRef === "object" && !("schema" in toolRef)) {
|
|
416333
416352
|
toolsList.push(toolRef);
|
|
416334
416353
|
}
|
|
416335
416354
|
}
|
|
416336
|
-
toolsList.push(...this.toolRegistry.
|
|
416355
|
+
toolsList.push(...this.toolRegistry.getFunctionDeclarations());
|
|
416337
416356
|
}
|
|
416338
416357
|
const completeTool = {
|
|
416339
416358
|
name: TASK_COMPLETE_TOOL_NAME,
|
|
@@ -496568,6 +496587,16 @@ var ThemeManager = class {
|
|
|
496568
496587
|
debugLogger.log(`Unregistered theme: ${namespacedName}`);
|
|
496569
496588
|
}
|
|
496570
496589
|
}
|
|
496590
|
+
/**
|
|
496591
|
+
* Checks if themes for a given extension are already registered.
|
|
496592
|
+
* @param extensionName The name of the extension.
|
|
496593
|
+
* @returns True if any themes from the extension are registered.
|
|
496594
|
+
*/
|
|
496595
|
+
hasExtensionThemes(extensionName) {
|
|
496596
|
+
return Array.from(this.extensionThemes.keys()).some(
|
|
496597
|
+
(name3) => name3.endsWith(`(${extensionName})`)
|
|
496598
|
+
);
|
|
496599
|
+
}
|
|
496571
496600
|
/**
|
|
496572
496601
|
* Clears all registered extension themes.
|
|
496573
496602
|
* This is primarily for testing purposes to reset state between tests.
|
|
@@ -528052,7 +528081,7 @@ var WarningMessage = ({ text }) => {
|
|
|
528052
528081
|
};
|
|
528053
528082
|
|
|
528054
528083
|
// packages/cli/src/generated/git-commit.ts
|
|
528055
|
-
var GIT_COMMIT_INFO2 = "
|
|
528084
|
+
var GIT_COMMIT_INFO2 = "62a4d375a";
|
|
528056
528085
|
|
|
528057
528086
|
// packages/cli/src/ui/components/AboutBox.tsx
|
|
528058
528087
|
init_dist7();
|
|
@@ -534324,7 +534353,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
534324
534353
|
}
|
|
534325
534354
|
async startExtension(extension) {
|
|
534326
534355
|
await super.startExtension(extension);
|
|
534327
|
-
if (extension.themes) {
|
|
534356
|
+
if (extension.themes && !themeManager.hasExtensionThemes(extension.name)) {
|
|
534328
534357
|
themeManager.registerExtensionThemes(extension.name, extension.themes);
|
|
534329
534358
|
}
|
|
534330
534359
|
}
|
|
@@ -534374,6 +534403,11 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
534374
534403
|
seenNames.add(ext2.name);
|
|
534375
534404
|
}
|
|
534376
534405
|
this.loadedExtensions = builtExtensions;
|
|
534406
|
+
for (const ext2 of this.loadedExtensions) {
|
|
534407
|
+
if (ext2.isActive && ext2.themes) {
|
|
534408
|
+
themeManager.registerExtensionThemes(ext2.name, ext2.themes);
|
|
534409
|
+
}
|
|
534410
|
+
}
|
|
534377
534411
|
await Promise.all(
|
|
534378
534412
|
this.loadedExtensions.map((ext2) => this.maybeStartExtension(ext2))
|
|
534379
534413
|
);
|
|
@@ -576928,7 +576962,7 @@ async function loadSandboxConfig(settings, argv) {
|
|
|
576928
576962
|
const sandboxOption = argv.sandbox ?? settings.tools?.sandbox;
|
|
576929
576963
|
const command2 = getSandboxCommand(sandboxOption);
|
|
576930
576964
|
const packageJson2 = await getPackageJson(__dirname13);
|
|
576931
|
-
const image3 = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.34.0-preview.
|
|
576965
|
+
const image3 = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.34.0-preview.2" ?? packageJson2?.config?.sandboxImageUri;
|
|
576932
576966
|
return command2 && image3 ? { command: command2, image: image3 } : void 0;
|
|
576933
576967
|
}
|
|
576934
576968
|
|