@google/gemini-cli 0.37.0-preview.0 → 0.37.0-preview.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/bundle/{chunk-ULC3DHVX.js → chunk-33B2YA3V.js} +4 -4
- package/bundle/{chunk-3TN4SOLW.js → chunk-43UUP7VO.js} +72 -29
- package/bundle/{chunk-R5X4CMUM.js → chunk-5OOT636U.js} +30 -23
- package/bundle/{chunk-A62NZYIK.js → chunk-BLL44IGV.js} +71 -59
- package/bundle/{chunk-7UZ4Y32N.js → chunk-JS5WSGB2.js} +30 -23
- package/bundle/{chunk-LEK5YYAR.js → chunk-PPWUMHZT.js} +65 -28
- package/bundle/chunk-TSSVZ7RZ.js +98376 -0
- package/bundle/{chunk-TJ76C6AA.js → chunk-VSXV53B7.js} +5901 -11014
- package/bundle/{chunk-XX7JYMTE.js → chunk-WZB27TDF.js} +4 -4
- package/bundle/chunk-ZB4UQCX5.js +356418 -0
- package/bundle/{core-5OME6LT4.js → core-RMRIZ3E5.js} +4 -2
- package/bundle/{devtoolsService-TVWW3DBW.js → devtoolsService-2ULAA43E.js} +3 -3
- package/bundle/{devtoolsService-IDLWLZFQ.js → devtoolsService-AWVCG2N2.js} +5 -4
- package/bundle/devtoolsService-IWSTJYRB.js +871 -0
- package/bundle/{devtoolsService-4FIYD6OW.js → devtoolsService-SZYXXACN.js} +3 -3
- package/bundle/{core-CUCGSGCA.js → dist-4FKFY6XB.js} +4 -2
- package/bundle/{dist-YWCADMDD.js → dist-PRDBNGX2.js} +4 -2
- package/bundle/dist-TCCEQJDV.js +1942 -0
- package/bundle/docs/cli/plan-mode.md +10 -3
- package/bundle/docs/reference/policy-engine.md +20 -1
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-4WFWOVAQ.js → interactiveCli-24VGI5NV.js} +4 -4
- package/bundle/{interactiveCli-6SIGBRWS.js → interactiveCli-D2MTTARB.js} +4 -4
- package/bundle/{interactiveCli-4ZZ72DR3.js → interactiveCli-DX76MWWT.js} +264 -247
- package/bundle/interactiveCli-VNDJAKWG.js +50355 -0
- package/bundle/{memoryDiscovery-NS2EGHYH.js → memoryDiscovery-A265O6ML.js} +1 -1
- package/bundle/{memoryDiscovery-VL3OH25S.js → memoryDiscovery-H6J7KIH2.js} +1 -1
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-TYBJKXSJ.js → oauth2-provider-FZUTS3SV.js} +2 -2
- package/bundle/{oauth2-provider-HGHECKPY.js → oauth2-provider-K25DXIWC.js} +2 -2
- package/bundle/{oauth2-provider-YYRJ44X5.js → oauth2-provider-N73M7SQI.js} +39 -73
- package/bundle/oauth2-provider-RMDEEXSP.js +237 -0
- package/package.json +1 -1
|
@@ -73,6 +73,7 @@ import {
|
|
|
73
73
|
MAX_LINE_LENGTH_TEXT_FILE,
|
|
74
74
|
MCP_TOOL_PREFIX,
|
|
75
75
|
MEMORY_TOOL_NAME,
|
|
76
|
+
MODES_BY_PERMISSIVENESS,
|
|
76
77
|
MemoryTool,
|
|
77
78
|
MessageBusType,
|
|
78
79
|
OAUTH_FILE,
|
|
@@ -203,7 +204,7 @@ import {
|
|
|
203
204
|
toFriendlyError,
|
|
204
205
|
unescapePath,
|
|
205
206
|
zodToJsonSchema
|
|
206
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-JS5WSGB2.js";
|
|
207
208
|
import {
|
|
208
209
|
require_dist as require_dist2,
|
|
209
210
|
require_src
|
|
@@ -250893,7 +250894,7 @@ var Float64Vector = import_vector.default.Float64Vector;
|
|
|
250893
250894
|
var PointerVector = import_vector.default.PointerVector;
|
|
250894
250895
|
|
|
250895
250896
|
// packages/core/dist/src/generated/git-commit.js
|
|
250896
|
-
var GIT_COMMIT_INFO = "
|
|
250897
|
+
var GIT_COMMIT_INFO = "24810f97e";
|
|
250897
250898
|
var CLI_VERSION = "0.37.0-preview.0";
|
|
250898
250899
|
|
|
250899
250900
|
// packages/core/dist/src/ide/detect-ide.js
|
|
@@ -276675,7 +276676,7 @@ function getVersion() {
|
|
|
276675
276676
|
}
|
|
276676
276677
|
versionPromise = (async () => {
|
|
276677
276678
|
const pkgJson = await getPackageJson(__dirname4);
|
|
276678
|
-
return "0.37.0-preview.
|
|
276679
|
+
return "0.37.0-preview.1";
|
|
276679
276680
|
})();
|
|
276680
276681
|
return versionPromise;
|
|
276681
276682
|
}
|
|
@@ -328860,7 +328861,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
|
|
|
328860
328861
|
return provider;
|
|
328861
328862
|
}
|
|
328862
328863
|
case "oauth2": {
|
|
328863
|
-
const { OAuth2AuthProvider } = await import("./oauth2-provider-
|
|
328864
|
+
const { OAuth2AuthProvider } = await import("./oauth2-provider-N73M7SQI.js");
|
|
328864
328865
|
const provider = new OAuth2AuthProvider(authConfig, options.agentName ?? "unknown", agentCard, options.agentCardUrl);
|
|
328865
328866
|
await provider.initialize();
|
|
328866
328867
|
return provider;
|
|
@@ -330254,6 +330255,14 @@ async function updatePolicy(tool, outcome, confirmationDetails, context2, messag
|
|
|
330254
330255
|
return;
|
|
330255
330256
|
}
|
|
330256
330257
|
let persistScope;
|
|
330258
|
+
let modes;
|
|
330259
|
+
const currentMode = context2.config.getApprovalMode();
|
|
330260
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways || outcome === ToolConfirmationOutcome.ProceedAlwaysTool || outcome === ToolConfirmationOutcome.ProceedAlwaysServer || outcome === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
330261
|
+
const modeIndex = MODES_BY_PERMISSIVENESS.indexOf(currentMode);
|
|
330262
|
+
if (modeIndex !== -1) {
|
|
330263
|
+
modes = MODES_BY_PERMISSIVENESS.slice(modeIndex);
|
|
330264
|
+
}
|
|
330265
|
+
}
|
|
330257
330266
|
if (outcome === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
330258
330267
|
if (context2.config && context2.config.isTrustedFolder() && context2.config.getWorkspacePoliciesDir() !== void 0) {
|
|
330259
330268
|
persistScope = "workspace";
|
|
@@ -330262,15 +330271,15 @@ async function updatePolicy(tool, outcome, confirmationDetails, context2, messag
|
|
|
330262
330271
|
}
|
|
330263
330272
|
}
|
|
330264
330273
|
if (confirmationDetails?.type === "mcp") {
|
|
330265
|
-
await handleMcpPolicyUpdate(tool, outcome, confirmationDetails, messageBus, persistScope);
|
|
330274
|
+
await handleMcpPolicyUpdate(tool, outcome, confirmationDetails, messageBus, persistScope, modes);
|
|
330266
330275
|
return;
|
|
330267
330276
|
}
|
|
330268
|
-
await handleStandardPolicyUpdate(tool, outcome, confirmationDetails, messageBus, persistScope, toolInvocation, context2.config);
|
|
330277
|
+
await handleStandardPolicyUpdate(tool, outcome, confirmationDetails, messageBus, persistScope, toolInvocation, context2.config, modes);
|
|
330269
330278
|
}
|
|
330270
330279
|
function isAutoEditTransition(tool, outcome) {
|
|
330271
330280
|
return outcome === ToolConfirmationOutcome.ProceedAlways && EDIT_TOOL_NAMES.has(tool.name);
|
|
330272
330281
|
}
|
|
330273
|
-
async function handleStandardPolicyUpdate(tool, outcome, confirmationDetails, messageBus, persistScope, toolInvocation, config2) {
|
|
330282
|
+
async function handleStandardPolicyUpdate(tool, outcome, confirmationDetails, messageBus, persistScope, toolInvocation, config2, modes) {
|
|
330274
330283
|
if (outcome === ToolConfirmationOutcome.ProceedAlways || outcome === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
330275
330284
|
const options = toolInvocation?.getPolicyUpdateOptions?.(outcome) || {};
|
|
330276
330285
|
if (!options.commandPrefix && confirmationDetails?.type === "exec") {
|
|
@@ -330284,11 +330293,12 @@ async function handleStandardPolicyUpdate(tool, outcome, confirmationDetails, me
|
|
|
330284
330293
|
toolName: tool.name,
|
|
330285
330294
|
persist: outcome === ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
330286
330295
|
persistScope,
|
|
330296
|
+
modes,
|
|
330287
330297
|
...options
|
|
330288
330298
|
});
|
|
330289
330299
|
}
|
|
330290
330300
|
}
|
|
330291
|
-
async function handleMcpPolicyUpdate(tool, outcome, confirmationDetails, messageBus, persistScope) {
|
|
330301
|
+
async function handleMcpPolicyUpdate(tool, outcome, confirmationDetails, messageBus, persistScope, modes) {
|
|
330292
330302
|
const isMcpAlways = outcome === ToolConfirmationOutcome.ProceedAlways || outcome === ToolConfirmationOutcome.ProceedAlwaysTool || outcome === ToolConfirmationOutcome.ProceedAlwaysServer || outcome === ToolConfirmationOutcome.ProceedAlwaysAndSave;
|
|
330293
330303
|
if (!isMcpAlways) {
|
|
330294
330304
|
return;
|
|
@@ -330303,7 +330313,8 @@ async function handleMcpPolicyUpdate(tool, outcome, confirmationDetails, message
|
|
|
330303
330313
|
toolName,
|
|
330304
330314
|
mcpName: confirmationDetails.serverName,
|
|
330305
330315
|
persist,
|
|
330306
|
-
persistScope
|
|
330316
|
+
persistScope,
|
|
330317
|
+
modes
|
|
330307
330318
|
});
|
|
330308
330319
|
}
|
|
330309
330320
|
|
|
@@ -336283,6 +336294,31 @@ async function createPolicyEngineConfig(settings, approvalMode, defaultPoliciesD
|
|
|
336283
336294
|
disableAlwaysAllow: settings.disableAlwaysAllow
|
|
336284
336295
|
};
|
|
336285
336296
|
}
|
|
336297
|
+
function findMatchingRule(rules, criteria) {
|
|
336298
|
+
return rules.find((r2) => r2.toolName === criteria.toolName && r2.mcpName === criteria.mcpName && JSON.stringify(r2.commandPrefix) === JSON.stringify(criteria.commandPrefix) && r2.argsPattern === criteria.argsPattern);
|
|
336299
|
+
}
|
|
336300
|
+
function createTomlRule(toolName, message) {
|
|
336301
|
+
const rule = {
|
|
336302
|
+
decision: "allow",
|
|
336303
|
+
priority: getAlwaysAllowPriorityFraction(),
|
|
336304
|
+
toolName
|
|
336305
|
+
};
|
|
336306
|
+
if (message.mcpName) {
|
|
336307
|
+
rule.mcpName = message.mcpName;
|
|
336308
|
+
}
|
|
336309
|
+
if (message.commandPrefix) {
|
|
336310
|
+
rule.commandPrefix = message.commandPrefix;
|
|
336311
|
+
} else if (message.argsPattern) {
|
|
336312
|
+
rule.argsPattern = message.argsPattern;
|
|
336313
|
+
}
|
|
336314
|
+
if (message.allowRedirection !== void 0) {
|
|
336315
|
+
rule.allowRedirection = message.allowRedirection;
|
|
336316
|
+
}
|
|
336317
|
+
if (message.modes) {
|
|
336318
|
+
rule.modes = message.modes;
|
|
336319
|
+
}
|
|
336320
|
+
return rule;
|
|
336321
|
+
}
|
|
336286
336322
|
function createPolicyUpdater(policyEngine, messageBus, storage2) {
|
|
336287
336323
|
let persistenceQueue = Promise.resolve();
|
|
336288
336324
|
messageBus.subscribe(MessageBusType.UPDATE_POLICY, async (message) => {
|
|
@@ -336303,6 +336339,7 @@ function createPolicyUpdater(policyEngine, messageBus, storage2) {
|
|
|
336303
336339
|
priority,
|
|
336304
336340
|
argsPattern: new RegExp(pattern),
|
|
336305
336341
|
mcpName: message.mcpName,
|
|
336342
|
+
modes: message.modes,
|
|
336306
336343
|
source: "Dynamic (Confirmed)",
|
|
336307
336344
|
allowRedirection: message.allowRedirection
|
|
336308
336345
|
});
|
|
@@ -336326,6 +336363,7 @@ function createPolicyUpdater(policyEngine, messageBus, storage2) {
|
|
|
336326
336363
|
priority,
|
|
336327
336364
|
argsPattern,
|
|
336328
336365
|
mcpName: message.mcpName,
|
|
336366
|
+
modes: message.modes,
|
|
336329
336367
|
source: "Dynamic (Confirmed)",
|
|
336330
336368
|
allowRedirection: message.allowRedirection
|
|
336331
336369
|
});
|
|
@@ -336350,30 +336388,29 @@ function createPolicyUpdater(policyEngine, messageBus, storage2) {
|
|
|
336350
336388
|
if (!existingData.rule) {
|
|
336351
336389
|
existingData.rule = [];
|
|
336352
336390
|
}
|
|
336353
|
-
|
|
336354
|
-
decision: "allow",
|
|
336355
|
-
priority: getAlwaysAllowPriorityFraction()
|
|
336356
|
-
};
|
|
336391
|
+
let normalizedToolName = toolName;
|
|
336357
336392
|
if (message.mcpName) {
|
|
336358
|
-
newRule.mcpName = message.mcpName;
|
|
336359
336393
|
const expectedPrefix = `${MCP_TOOL_PREFIX}${message.mcpName}_`;
|
|
336360
336394
|
if (toolName.startsWith(expectedPrefix)) {
|
|
336361
|
-
|
|
336362
|
-
} else {
|
|
336363
|
-
newRule.toolName = toolName;
|
|
336395
|
+
normalizedToolName = toolName.slice(expectedPrefix.length);
|
|
336364
336396
|
}
|
|
336365
|
-
} else {
|
|
336366
|
-
newRule.toolName = toolName;
|
|
336367
336397
|
}
|
|
336368
|
-
|
|
336369
|
-
|
|
336370
|
-
|
|
336371
|
-
|
|
336372
|
-
|
|
336373
|
-
|
|
336374
|
-
|
|
336398
|
+
const existingRule = findMatchingRule(existingData.rule, {
|
|
336399
|
+
toolName: normalizedToolName,
|
|
336400
|
+
mcpName: message.mcpName,
|
|
336401
|
+
commandPrefix: message.commandPrefix,
|
|
336402
|
+
argsPattern: message.argsPattern
|
|
336403
|
+
});
|
|
336404
|
+
if (existingRule) {
|
|
336405
|
+
if (message.allowRedirection !== void 0) {
|
|
336406
|
+
existingRule.allowRedirection = message.allowRedirection;
|
|
336407
|
+
}
|
|
336408
|
+
if (message.modes) {
|
|
336409
|
+
existingRule.modes = message.modes;
|
|
336410
|
+
}
|
|
336411
|
+
} else {
|
|
336412
|
+
existingData.rule.push(createTomlRule(normalizedToolName, message));
|
|
336375
336413
|
}
|
|
336376
|
-
existingData.rule.push(newRule);
|
|
336377
336414
|
const newContent = import_toml3.default.stringify(existingData);
|
|
336378
336415
|
const tmpSuffix = crypto18.randomBytes(8).toString("hex");
|
|
336379
336416
|
const tmpFile = `${policyFile}.${tmpSuffix}.tmp`;
|
|
@@ -349435,7 +349472,7 @@ var Config = class {
|
|
|
349435
349472
|
if (this.experimentalJitContext && this.contextManager) {
|
|
349436
349473
|
await this.contextManager.refresh();
|
|
349437
349474
|
} else {
|
|
349438
|
-
const { refreshServerHierarchicalMemory: refreshServerHierarchicalMemory2 } = await import("./memoryDiscovery-
|
|
349475
|
+
const { refreshServerHierarchicalMemory: refreshServerHierarchicalMemory2 } = await import("./memoryDiscovery-A265O6ML.js");
|
|
349439
349476
|
await refreshServerHierarchicalMemory2(this);
|
|
349440
349477
|
}
|
|
349441
349478
|
if (this._geminiClient?.isInitialized()) {
|