@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
|
@@ -2,7 +2,9 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
AsyncFzf,
|
|
4
4
|
AuthProviderType,
|
|
5
|
+
AuthType,
|
|
5
6
|
Config,
|
|
7
|
+
CoreToolCallStatus,
|
|
6
8
|
DEFAULT_MODEL_CONFIGS,
|
|
7
9
|
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
|
|
8
10
|
ExitCodes,
|
|
@@ -14,17 +16,26 @@ import {
|
|
|
14
16
|
ExtensionUninstallEvent,
|
|
15
17
|
ExtensionUpdateEvent,
|
|
16
18
|
GEMINI_CLI_COMPANION_EXTENSION_NAME,
|
|
19
|
+
HookType,
|
|
20
|
+
IDEConnectionStatus,
|
|
17
21
|
INITIAL_HISTORY_LENGTH,
|
|
18
22
|
IdeClient,
|
|
19
23
|
IdeConnectionEvent,
|
|
24
|
+
IdeConnectionType,
|
|
25
|
+
IntegrityDataStatus,
|
|
20
26
|
KeychainTokenStorage,
|
|
27
|
+
LlmRole,
|
|
28
|
+
MCPDiscoveryState,
|
|
21
29
|
MCPOAuthTokenStorage,
|
|
30
|
+
MCPServerStatus,
|
|
22
31
|
MaxBufferError,
|
|
23
32
|
ModelSlashCommandEvent,
|
|
24
33
|
ProjectIdRequiredError,
|
|
25
34
|
ReadManyFilesTool,
|
|
26
35
|
RewindEvent,
|
|
27
36
|
SESSION_FILE_PREFIX,
|
|
37
|
+
SessionEndReason,
|
|
38
|
+
SessionStartSource,
|
|
28
39
|
ShellExecutionService,
|
|
29
40
|
StartSessionEvent,
|
|
30
41
|
TOOL_OUTPUTS_DIR,
|
|
@@ -156,13 +167,14 @@ import {
|
|
|
156
167
|
tokenLimit,
|
|
157
168
|
uiTelemetryService,
|
|
158
169
|
yellowBright
|
|
159
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-VSXV53B7.js";
|
|
160
171
|
import {
|
|
161
172
|
ApprovalMode,
|
|
162
173
|
CoreEvent,
|
|
163
174
|
DiscoveredMCPTool,
|
|
164
175
|
FatalConfigError,
|
|
165
176
|
GEMINI_DIR,
|
|
177
|
+
PolicyDecision,
|
|
166
178
|
REFERENCE_CONTENT_END,
|
|
167
179
|
REFERENCE_CONTENT_START,
|
|
168
180
|
Storage,
|
|
@@ -184,7 +196,7 @@ import {
|
|
|
184
196
|
shortenPath,
|
|
185
197
|
tildeifyPath,
|
|
186
198
|
unescapePath
|
|
187
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-JS5WSGB2.js";
|
|
188
200
|
import {
|
|
189
201
|
AppEvent,
|
|
190
202
|
appEvents
|
|
@@ -43461,19 +43473,19 @@ var require_cli_spinners = __commonJS({
|
|
|
43461
43473
|
var import_react = __toESM(require_react(), 1);
|
|
43462
43474
|
function mapCoreStatusToDisplayStatus(coreStatus) {
|
|
43463
43475
|
switch (coreStatus) {
|
|
43464
|
-
case
|
|
43476
|
+
case CoreToolCallStatus.Validating:
|
|
43465
43477
|
return "Pending" /* Pending */;
|
|
43466
|
-
case
|
|
43478
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
43467
43479
|
return "Confirming" /* Confirming */;
|
|
43468
|
-
case
|
|
43480
|
+
case CoreToolCallStatus.Executing:
|
|
43469
43481
|
return "Executing" /* Executing */;
|
|
43470
|
-
case
|
|
43482
|
+
case CoreToolCallStatus.Success:
|
|
43471
43483
|
return "Success" /* Success */;
|
|
43472
|
-
case
|
|
43484
|
+
case CoreToolCallStatus.Cancelled:
|
|
43473
43485
|
return "Canceled" /* Canceled */;
|
|
43474
|
-
case
|
|
43486
|
+
case CoreToolCallStatus.Error:
|
|
43475
43487
|
return "Error" /* Error */;
|
|
43476
|
-
case
|
|
43488
|
+
case CoreToolCallStatus.Scheduled:
|
|
43477
43489
|
return "Pending" /* Pending */;
|
|
43478
43490
|
default:
|
|
43479
43491
|
return checkExhaustive(coreStatus);
|
|
@@ -58613,7 +58625,7 @@ function convertSessionToHistoryFormats(messages) {
|
|
|
58613
58625
|
name: tool.displayName || tool.name,
|
|
58614
58626
|
description: tool.description || "",
|
|
58615
58627
|
renderOutputAsMarkdown: tool.renderOutputAsMarkdown ?? true,
|
|
58616
|
-
status: tool.status === "success" ?
|
|
58628
|
+
status: tool.status === "success" ? CoreToolCallStatus.Success : CoreToolCallStatus.Error,
|
|
58617
58629
|
resultDisplay: tool.resultDisplay,
|
|
58618
58630
|
confirmationDetails: void 0
|
|
58619
58631
|
}))
|
|
@@ -62570,8 +62582,8 @@ var LoadedSettings = class {
|
|
|
62570
62582
|
// React will pass a listener fn into this subscribe fn
|
|
62571
62583
|
// that listener fn will perform an object identity check on the snapshot and trigger a React re render if the snapshot has changed
|
|
62572
62584
|
subscribe(listener) {
|
|
62573
|
-
coreEvents.on(
|
|
62574
|
-
return () => coreEvents.off(
|
|
62585
|
+
coreEvents.on(CoreEvent.SettingsChanged, listener);
|
|
62586
|
+
return () => coreEvents.off(CoreEvent.SettingsChanged, listener);
|
|
62575
62587
|
}
|
|
62576
62588
|
getSnapshot() {
|
|
62577
62589
|
return this._snapshot;
|
|
@@ -68034,7 +68046,7 @@ var import_react34 = __toESM(require_react(), 1);
|
|
|
68034
68046
|
function useIdeTrustListener() {
|
|
68035
68047
|
const settings = useSettings();
|
|
68036
68048
|
const [connectionStatus, setConnectionStatus] = (0, import_react34.useState)(
|
|
68037
|
-
|
|
68049
|
+
IDEConnectionStatus.Disconnected
|
|
68038
68050
|
);
|
|
68039
68051
|
const previousTrust = (0, import_react34.useRef)(void 0);
|
|
68040
68052
|
const [restartReason, setRestartReason] = (0, import_react34.useState)("NONE");
|
|
@@ -68064,7 +68076,7 @@ function useIdeTrustListener() {
|
|
|
68064
68076
|
};
|
|
68065
68077
|
}, []);
|
|
68066
68078
|
const getSnapshot = () => {
|
|
68067
|
-
if (connectionStatus !==
|
|
68079
|
+
if (connectionStatus !== IDEConnectionStatus.Connected) {
|
|
68068
68080
|
return void 0;
|
|
68069
68081
|
}
|
|
68070
68082
|
return ideContextStore.get()?.workspaceState?.isTrusted;
|
|
@@ -73210,7 +73222,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
73210
73222
|
newExtensionConfig.version,
|
|
73211
73223
|
previousExtensionConfig.version,
|
|
73212
73224
|
installMetadata.type,
|
|
73213
|
-
|
|
73225
|
+
CoreToolCallStatus.Success
|
|
73214
73226
|
)
|
|
73215
73227
|
);
|
|
73216
73228
|
if (newExtensionName !== previousName) {
|
|
@@ -73233,7 +73245,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
73233
73245
|
getExtensionId(newExtensionConfig, installMetadata),
|
|
73234
73246
|
newExtensionConfig.version,
|
|
73235
73247
|
installMetadata.type,
|
|
73236
|
-
|
|
73248
|
+
CoreToolCallStatus.Success
|
|
73237
73249
|
)
|
|
73238
73250
|
);
|
|
73239
73251
|
await this.enableExtension(
|
|
@@ -73266,7 +73278,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
73266
73278
|
newExtensionConfig?.version ?? "",
|
|
73267
73279
|
previousExtensionConfig.version,
|
|
73268
73280
|
installMetadata.type,
|
|
73269
|
-
|
|
73281
|
+
CoreToolCallStatus.Error
|
|
73270
73282
|
)
|
|
73271
73283
|
);
|
|
73272
73284
|
} else {
|
|
@@ -73278,7 +73290,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
73278
73290
|
extensionId ?? "",
|
|
73279
73291
|
newExtensionConfig?.version ?? "",
|
|
73280
73292
|
installMetadata.type,
|
|
73281
|
-
|
|
73293
|
+
CoreToolCallStatus.Error
|
|
73282
73294
|
)
|
|
73283
73295
|
);
|
|
73284
73296
|
}
|
|
@@ -73309,7 +73321,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
73309
73321
|
extension.name,
|
|
73310
73322
|
hashValue(extension.name),
|
|
73311
73323
|
extension.id,
|
|
73312
|
-
|
|
73324
|
+
CoreToolCallStatus.Success
|
|
73313
73325
|
)
|
|
73314
73326
|
);
|
|
73315
73327
|
}
|
|
@@ -73579,7 +73591,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
73579
73591
|
if (eventHooks) {
|
|
73580
73592
|
for (const definition of eventHooks) {
|
|
73581
73593
|
for (const hook of definition.hooks) {
|
|
73582
|
-
if (hook.type ===
|
|
73594
|
+
if (hook.type === HookType.Command) {
|
|
73583
73595
|
hook.env = { ...hook.env, ...hookEnv };
|
|
73584
73596
|
}
|
|
73585
73597
|
}
|
|
@@ -74206,7 +74218,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
74206
74218
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
74207
74219
|
name: `resources/read (${resource.serverName})`,
|
|
74208
74220
|
description: resource.uri,
|
|
74209
|
-
status:
|
|
74221
|
+
status: CoreToolCallStatus.Success,
|
|
74210
74222
|
isClientInitiated: true,
|
|
74211
74223
|
resultDisplay: `Successfully read resource ${resource.uri}`,
|
|
74212
74224
|
confirmationDetails: void 0
|
|
@@ -74221,7 +74233,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
74221
74233
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
74222
74234
|
name: `resources/read (${resource.serverName})`,
|
|
74223
74235
|
description: resource.uri,
|
|
74224
|
-
status:
|
|
74236
|
+
status: CoreToolCallStatus.Error,
|
|
74225
74237
|
isClientInitiated: true,
|
|
74226
74238
|
resultDisplay: `Error reading resource ${resource.uri}: ${getErrorMessage(error)}`,
|
|
74227
74239
|
confirmationDetails: void 0
|
|
@@ -74246,7 +74258,7 @@ Content from @${result.uri}:
|
|
|
74246
74258
|
}
|
|
74247
74259
|
if (hasError) {
|
|
74248
74260
|
const firstError = displays.find(
|
|
74249
|
-
(d) => d.status ===
|
|
74261
|
+
(d) => d.status === CoreToolCallStatus.Error
|
|
74250
74262
|
);
|
|
74251
74263
|
return {
|
|
74252
74264
|
parts: [],
|
|
@@ -74282,7 +74294,7 @@ async function readLocalFiles(resolvedFiles, config, signal, userMessageTimestam
|
|
|
74282
74294
|
callId: `client-read-${userMessageTimestamp}`,
|
|
74283
74295
|
name: readManyFilesTool.displayName,
|
|
74284
74296
|
description: invocation.getDescription(),
|
|
74285
|
-
status:
|
|
74297
|
+
status: CoreToolCallStatus.Success,
|
|
74286
74298
|
isClientInitiated: true,
|
|
74287
74299
|
resultDisplay: result.returnDisplay || `Successfully read: ${fileLabelsForDisplay.join(", ")}`,
|
|
74288
74300
|
confirmationDetails: void 0
|
|
@@ -74329,7 +74341,7 @@ Content from @${displayPath}:
|
|
|
74329
74341
|
callId: `client-read-${userMessageTimestamp}`,
|
|
74330
74342
|
name: readManyFilesTool.displayName,
|
|
74331
74343
|
description: invocation?.getDescription() ?? "Error attempting to execute tool to read files",
|
|
74332
|
-
status:
|
|
74344
|
+
status: CoreToolCallStatus.Error,
|
|
74333
74345
|
isClientInitiated: true,
|
|
74334
74346
|
resultDisplay: `Error reading files (${fileLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,
|
|
74335
74347
|
confirmationDetails: void 0
|
|
@@ -82541,7 +82553,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
82541
82553
|
if (wasRaw) {
|
|
82542
82554
|
setRawMode?.(true);
|
|
82543
82555
|
}
|
|
82544
|
-
coreEvents.emit(
|
|
82556
|
+
coreEvents.emit(CoreEvent.ExternalEditorClosed);
|
|
82545
82557
|
}
|
|
82546
82558
|
}
|
|
82547
82559
|
|
|
@@ -85220,7 +85232,7 @@ async function updateExtension(extension, extensionManager, currentState, dispat
|
|
|
85220
85232
|
extension.name,
|
|
85221
85233
|
installMetadata
|
|
85222
85234
|
);
|
|
85223
|
-
if (status ===
|
|
85235
|
+
if (status === IntegrityDataStatus.INVALID) {
|
|
85224
85236
|
throw new Error("Extension integrity cannot be verified");
|
|
85225
85237
|
}
|
|
85226
85238
|
} catch (e) {
|
|
@@ -86057,7 +86069,7 @@ async function initializeApp(config, settings) {
|
|
|
86057
86069
|
await ideClient.connect();
|
|
86058
86070
|
logIdeConnection(
|
|
86059
86071
|
config,
|
|
86060
|
-
new IdeConnectionEvent(
|
|
86072
|
+
new IdeConnectionEvent(IdeConnectionType.START)
|
|
86061
86073
|
);
|
|
86062
86074
|
}).catch((e) => {
|
|
86063
86075
|
debugLogger.error("Failed to initialize IDE client:", e);
|
|
@@ -86075,16 +86087,16 @@ async function initializeApp(config, settings) {
|
|
|
86075
86087
|
// packages/cli/src/config/auth.ts
|
|
86076
86088
|
function validateAuthMethod(authMethod) {
|
|
86077
86089
|
loadEnvironment(loadSettings().merged, process.cwd());
|
|
86078
|
-
if (authMethod ===
|
|
86090
|
+
if (authMethod === AuthType.LOGIN_WITH_GOOGLE || authMethod === AuthType.COMPUTE_ADC) {
|
|
86079
86091
|
return null;
|
|
86080
86092
|
}
|
|
86081
|
-
if (authMethod ===
|
|
86093
|
+
if (authMethod === AuthType.USE_GEMINI) {
|
|
86082
86094
|
if (!process.env["GEMINI_API_KEY"]) {
|
|
86083
86095
|
return "When using Gemini API, you must specify the GEMINI_API_KEY environment variable.\nUpdate your environment and try again (no reload needed if using .env)!";
|
|
86084
86096
|
}
|
|
86085
86097
|
return null;
|
|
86086
86098
|
}
|
|
86087
|
-
if (authMethod ===
|
|
86099
|
+
if (authMethod === AuthType.USE_VERTEX_AI) {
|
|
86088
86100
|
const hasVertexProjectLocationConfig = !!process.env["GOOGLE_CLOUD_PROJECT"] && !!process.env["GOOGLE_CLOUD_LOCATION"];
|
|
86089
86101
|
const hasGoogleApiKey = !!process.env["GOOGLE_API_KEY"];
|
|
86090
86102
|
if (!hasVertexProjectLocationConfig && !hasGoogleApiKey) {
|
|
@@ -88055,7 +88067,7 @@ var authCommand = {
|
|
|
88055
88067
|
import process34 from "node:process";
|
|
88056
88068
|
|
|
88057
88069
|
// packages/cli/src/generated/git-commit.ts
|
|
88058
|
-
var GIT_COMMIT_INFO = "
|
|
88070
|
+
var GIT_COMMIT_INFO = "24810f97e";
|
|
88059
88071
|
|
|
88060
88072
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
88061
88073
|
import * as fsPromises2 from "node:fs/promises";
|
|
@@ -88568,7 +88580,7 @@ var clearCommand = {
|
|
|
88568
88580
|
const config = context.services.agentContext?.config;
|
|
88569
88581
|
const hookSystem = config?.getHookSystem();
|
|
88570
88582
|
if (hookSystem) {
|
|
88571
|
-
await hookSystem.fireSessionEndEvent(
|
|
88583
|
+
await hookSystem.fireSessionEndEvent(SessionEndReason.Clear);
|
|
88572
88584
|
}
|
|
88573
88585
|
config?.injectionService.clear();
|
|
88574
88586
|
let newSessionId;
|
|
@@ -88585,7 +88597,7 @@ var clearCommand = {
|
|
|
88585
88597
|
}
|
|
88586
88598
|
let result;
|
|
88587
88599
|
if (hookSystem) {
|
|
88588
|
-
result = await hookSystem.fireSessionStartEvent(
|
|
88600
|
+
result = await hookSystem.fireSessionStartEvent(SessionStartSource.Clear);
|
|
88589
88601
|
}
|
|
88590
88602
|
await new Promise((resolve9) => setImmediate(resolve9));
|
|
88591
88603
|
if (config) {
|
|
@@ -91451,7 +91463,7 @@ var Footer = ({
|
|
|
91451
91463
|
case "auth": {
|
|
91452
91464
|
if (!settings.merged.ui.showUserIdentity) break;
|
|
91453
91465
|
if (!authType) break;
|
|
91454
|
-
const displayStr = authType ===
|
|
91466
|
+
const displayStr = authType === AuthType.LOGIN_WITH_GOOGLE ? email ?? "google" : authType;
|
|
91455
91467
|
addCol(
|
|
91456
91468
|
id,
|
|
91457
91469
|
header,
|
|
@@ -93203,12 +93215,12 @@ import path34 from "node:path";
|
|
|
93203
93215
|
function getIdeStatusMessage(ideClient) {
|
|
93204
93216
|
const connection = ideClient.getConnectionStatus();
|
|
93205
93217
|
switch (connection.status) {
|
|
93206
|
-
case
|
|
93218
|
+
case IDEConnectionStatus.Connected:
|
|
93207
93219
|
return {
|
|
93208
93220
|
messageType: "info",
|
|
93209
93221
|
content: `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`
|
|
93210
93222
|
};
|
|
93211
|
-
case
|
|
93223
|
+
case IDEConnectionStatus.Connecting:
|
|
93212
93224
|
return {
|
|
93213
93225
|
messageType: "info",
|
|
93214
93226
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -93249,7 +93261,7 @@ ${infoMessage}`;
|
|
|
93249
93261
|
async function getIdeStatusMessageWithFiles(ideClient) {
|
|
93250
93262
|
const connection = ideClient.getConnectionStatus();
|
|
93251
93263
|
switch (connection.status) {
|
|
93252
|
-
case
|
|
93264
|
+
case IDEConnectionStatus.Connected: {
|
|
93253
93265
|
let content = `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`;
|
|
93254
93266
|
const context = ideContextStore.get();
|
|
93255
93267
|
const openFiles = context?.workspaceState?.openFiles;
|
|
@@ -93261,7 +93273,7 @@ async function getIdeStatusMessageWithFiles(ideClient) {
|
|
|
93261
93273
|
content
|
|
93262
93274
|
};
|
|
93263
93275
|
}
|
|
93264
|
-
case
|
|
93276
|
+
case IDEConnectionStatus.Connecting:
|
|
93265
93277
|
return {
|
|
93266
93278
|
messageType: "info",
|
|
93267
93279
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -93283,7 +93295,7 @@ async function setIdeModeAndSyncConnection(config, value, options = {}) {
|
|
|
93283
93295
|
const ideClient = await IdeClient.getInstance();
|
|
93284
93296
|
if (value) {
|
|
93285
93297
|
await ideClient.connect(options);
|
|
93286
|
-
logIdeConnection(config, new IdeConnectionEvent(
|
|
93298
|
+
logIdeConnection(config, new IdeConnectionEvent(IdeConnectionType.SESSION));
|
|
93287
93299
|
} else {
|
|
93288
93300
|
await ideClient.disconnect();
|
|
93289
93301
|
}
|
|
@@ -93371,7 +93383,7 @@ var ideCommand = async () => {
|
|
|
93371
93383
|
logToConsole: false
|
|
93372
93384
|
}
|
|
93373
93385
|
);
|
|
93374
|
-
if (ideClient.getConnectionStatus().status ===
|
|
93386
|
+
if (ideClient.getConnectionStatus().status === IDEConnectionStatus.Connected) {
|
|
93375
93387
|
break;
|
|
93376
93388
|
}
|
|
93377
93389
|
await new Promise((resolve9) => setTimeout(resolve9, 500));
|
|
@@ -93448,7 +93460,7 @@ var ideCommand = async () => {
|
|
|
93448
93460
|
}
|
|
93449
93461
|
};
|
|
93450
93462
|
const { status } = ideClient.getConnectionStatus();
|
|
93451
|
-
const isConnected2 = status ===
|
|
93463
|
+
const isConnected2 = status === IDEConnectionStatus.Connected;
|
|
93452
93464
|
if (isConnected2) {
|
|
93453
93465
|
ideSlashCommand.subCommands = [statusCommand, disableCommand5];
|
|
93454
93466
|
} else {
|
|
@@ -93548,13 +93560,13 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
93548
93560
|
const displayListener = (message) => {
|
|
93549
93561
|
context.ui.addItem({ type: "info", text: message });
|
|
93550
93562
|
};
|
|
93551
|
-
coreEvents.on(
|
|
93563
|
+
coreEvents.on(CoreEvent.OauthDisplayMessage, displayListener);
|
|
93552
93564
|
try {
|
|
93553
93565
|
context.ui.addItem({
|
|
93554
93566
|
type: "info",
|
|
93555
93567
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
93556
93568
|
});
|
|
93557
|
-
const { MCPOAuthProvider } = await import("./
|
|
93569
|
+
const { MCPOAuthProvider } = await import("./dist-4FKFY6XB.js");
|
|
93558
93570
|
let oauthConfig = server.oauth;
|
|
93559
93571
|
if (!oauthConfig) {
|
|
93560
93572
|
oauthConfig = { enabled: false };
|
|
@@ -93591,7 +93603,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
93591
93603
|
content: `Failed to authenticate with MCP server '${serverName}': ${getErrorMessage(error)}`
|
|
93592
93604
|
};
|
|
93593
93605
|
} finally {
|
|
93594
|
-
coreEvents.removeListener(
|
|
93606
|
+
coreEvents.removeListener(CoreEvent.OauthDisplayMessage, displayListener);
|
|
93595
93607
|
}
|
|
93596
93608
|
},
|
|
93597
93609
|
completion: async (context, partialArg) => {
|
|
@@ -93637,10 +93649,10 @@ var listAction3 = async (context, showDescriptions = false, showSchema = false,
|
|
|
93637
93649
|
}
|
|
93638
93650
|
const serverNames = Object.keys(mcpServers);
|
|
93639
93651
|
const connectingServers = serverNames.filter(
|
|
93640
|
-
(name) => getMCPServerStatus(name) ===
|
|
93652
|
+
(name) => getMCPServerStatus(name) === MCPServerStatus.CONNECTING
|
|
93641
93653
|
);
|
|
93642
93654
|
const discoveryState = getMCPDiscoveryState();
|
|
93643
|
-
const discoveryInProgress = discoveryState ===
|
|
93655
|
+
const discoveryInProgress = discoveryState === MCPDiscoveryState.IN_PROGRESS || connectingServers.length > 0;
|
|
93644
93656
|
const allTools = toolRegistry.getAllTools();
|
|
93645
93657
|
const mcpTools = allTools.filter((tool) => tool instanceof DiscoveredMCPTool);
|
|
93646
93658
|
const promptRegistry = config.getPromptRegistry();
|
|
@@ -94245,7 +94257,7 @@ Return a JSON object with:
|
|
|
94245
94257
|
},
|
|
94246
94258
|
abortSignal: new AbortController().signal,
|
|
94247
94259
|
promptId: "triage-duplicates",
|
|
94248
|
-
role:
|
|
94260
|
+
role: LlmRole.UTILITY_TOOL
|
|
94249
94261
|
});
|
|
94250
94262
|
const rec = response;
|
|
94251
94263
|
let canonical;
|
|
@@ -95079,7 +95091,7 @@ Return a JSON object with:
|
|
|
95079
95091
|
},
|
|
95080
95092
|
abortSignal: abortControllerRef.current.signal,
|
|
95081
95093
|
promptId: "triage-issues",
|
|
95082
|
-
role:
|
|
95094
|
+
role: LlmRole.UTILITY_TOOL
|
|
95083
95095
|
});
|
|
95084
95096
|
return response;
|
|
95085
95097
|
},
|
|
@@ -95653,8 +95665,8 @@ var planCommand = {
|
|
|
95653
95665
|
return;
|
|
95654
95666
|
}
|
|
95655
95667
|
const previousApprovalMode = config.getApprovalMode();
|
|
95656
|
-
config.setApprovalMode(
|
|
95657
|
-
if (previousApprovalMode !==
|
|
95668
|
+
config.setApprovalMode(ApprovalMode.PLAN);
|
|
95669
|
+
if (previousApprovalMode !== ApprovalMode.PLAN) {
|
|
95658
95670
|
coreEvents.emitFeedback("info", "Switched to Plan Mode.");
|
|
95659
95671
|
}
|
|
95660
95672
|
if (context.invocation?.args) {
|
|
@@ -95713,10 +95725,10 @@ var categorizeRulesByMode = (rules) => {
|
|
|
95713
95725
|
rules.forEach((rule) => {
|
|
95714
95726
|
const modes = rule.modes?.length ? rule.modes : ALL_MODES;
|
|
95715
95727
|
const modeSet = new Set(modes);
|
|
95716
|
-
if (modeSet.has(
|
|
95717
|
-
if (modeSet.has(
|
|
95718
|
-
if (modeSet.has(
|
|
95719
|
-
if (modeSet.has(
|
|
95728
|
+
if (modeSet.has(ApprovalMode.DEFAULT)) result.normal.push(rule);
|
|
95729
|
+
if (modeSet.has(ApprovalMode.AUTO_EDIT)) result.autoEdit.push(rule);
|
|
95730
|
+
if (modeSet.has(ApprovalMode.YOLO)) result.yolo.push(rule);
|
|
95731
|
+
if (modeSet.has(ApprovalMode.PLAN)) result.plan.push(rule);
|
|
95720
95732
|
});
|
|
95721
95733
|
return result;
|
|
95722
95734
|
};
|
|
@@ -97061,7 +97073,7 @@ var upgradeCommand = {
|
|
|
97061
97073
|
action: async (context) => {
|
|
97062
97074
|
const config = context.services.agentContext?.config;
|
|
97063
97075
|
const authType = config?.getContentGeneratorConfig()?.authType;
|
|
97064
|
-
if (authType !==
|
|
97076
|
+
if (authType !== AuthType.LOGIN_WITH_GOOGLE) {
|
|
97065
97077
|
return {
|
|
97066
97078
|
type: "message",
|
|
97067
97079
|
messageType: "error",
|
|
@@ -97231,7 +97243,7 @@ var BuiltinCommandLoader = class {
|
|
|
97231
97243
|
vimCommand,
|
|
97232
97244
|
setupGithubCommand,
|
|
97233
97245
|
terminalSetupCommand,
|
|
97234
|
-
...this.config?.getContentGeneratorConfig()?.authType ===
|
|
97246
|
+
...this.config?.getContentGeneratorConfig()?.authType === AuthType.LOGIN_WITH_GOOGLE ? [upgradeCommand] : []
|
|
97235
97247
|
];
|
|
97236
97248
|
handle?.end();
|
|
97237
97249
|
return allDefinitions.filter((cmd) => cmd !== null);
|
|
@@ -97374,11 +97386,11 @@ var ShellProcessor = class {
|
|
|
97374
97386
|
},
|
|
97375
97387
|
void 0
|
|
97376
97388
|
);
|
|
97377
|
-
if (decision ===
|
|
97389
|
+
if (decision === PolicyDecision.DENY) {
|
|
97378
97390
|
throw new Error(
|
|
97379
97391
|
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
97380
97392
|
);
|
|
97381
|
-
} else if (decision ===
|
|
97393
|
+
} else if (decision === PolicyDecision.ASK_USER) {
|
|
97382
97394
|
commandsToConfirm.add(command);
|
|
97383
97395
|
}
|
|
97384
97396
|
}
|
|
@@ -40759,27 +40759,6 @@ function getApiKeyFromEnv() {
|
|
|
40759
40759
|
return envGoogleApiKey || envGeminiApiKey || void 0;
|
|
40760
40760
|
}
|
|
40761
40761
|
|
|
40762
|
-
// packages/core/dist/src/confirmation-bus/types.js
|
|
40763
|
-
var MessageBusType;
|
|
40764
|
-
(function(MessageBusType2) {
|
|
40765
|
-
MessageBusType2["TOOL_CONFIRMATION_REQUEST"] = "tool-confirmation-request";
|
|
40766
|
-
MessageBusType2["TOOL_CONFIRMATION_RESPONSE"] = "tool-confirmation-response";
|
|
40767
|
-
MessageBusType2["TOOL_POLICY_REJECTION"] = "tool-policy-rejection";
|
|
40768
|
-
MessageBusType2["TOOL_EXECUTION_SUCCESS"] = "tool-execution-success";
|
|
40769
|
-
MessageBusType2["TOOL_EXECUTION_FAILURE"] = "tool-execution-failure";
|
|
40770
|
-
MessageBusType2["UPDATE_POLICY"] = "update-policy";
|
|
40771
|
-
MessageBusType2["TOOL_CALLS_UPDATE"] = "tool-calls-update";
|
|
40772
|
-
MessageBusType2["ASK_USER_REQUEST"] = "ask-user-request";
|
|
40773
|
-
MessageBusType2["ASK_USER_RESPONSE"] = "ask-user-response";
|
|
40774
|
-
MessageBusType2["SUBAGENT_ACTIVITY"] = "subagent-activity";
|
|
40775
|
-
})(MessageBusType || (MessageBusType = {}));
|
|
40776
|
-
var QuestionType;
|
|
40777
|
-
(function(QuestionType2) {
|
|
40778
|
-
QuestionType2["CHOICE"] = "choice";
|
|
40779
|
-
QuestionType2["TEXT"] = "text";
|
|
40780
|
-
QuestionType2["YESNO"] = "yesno";
|
|
40781
|
-
})(QuestionType || (QuestionType = {}));
|
|
40782
|
-
|
|
40783
40762
|
// packages/core/dist/src/policy/types.js
|
|
40784
40763
|
var PolicyDecision;
|
|
40785
40764
|
(function(PolicyDecision2) {
|
|
@@ -40808,6 +40787,12 @@ var ApprovalMode;
|
|
|
40808
40787
|
ApprovalMode2["YOLO"] = "yolo";
|
|
40809
40788
|
ApprovalMode2["PLAN"] = "plan";
|
|
40810
40789
|
})(ApprovalMode || (ApprovalMode = {}));
|
|
40790
|
+
var MODES_BY_PERMISSIVENESS = [
|
|
40791
|
+
ApprovalMode.PLAN,
|
|
40792
|
+
ApprovalMode.DEFAULT,
|
|
40793
|
+
ApprovalMode.AUTO_EDIT,
|
|
40794
|
+
ApprovalMode.YOLO
|
|
40795
|
+
];
|
|
40811
40796
|
var InProcessCheckerType;
|
|
40812
40797
|
(function(InProcessCheckerType2) {
|
|
40813
40798
|
InProcessCheckerType2["ALLOWED_PATH"] = "allowed-path";
|
|
@@ -40818,6 +40803,27 @@ var ALWAYS_ALLOW_PRIORITY_FRACTION = 950;
|
|
|
40818
40803
|
var ALWAYS_ALLOW_PRIORITY_OFFSET = ALWAYS_ALLOW_PRIORITY_FRACTION / 1e3;
|
|
40819
40804
|
var PRIORITY_YOLO_ALLOW_ALL = 998;
|
|
40820
40805
|
|
|
40806
|
+
// packages/core/dist/src/confirmation-bus/types.js
|
|
40807
|
+
var MessageBusType;
|
|
40808
|
+
(function(MessageBusType2) {
|
|
40809
|
+
MessageBusType2["TOOL_CONFIRMATION_REQUEST"] = "tool-confirmation-request";
|
|
40810
|
+
MessageBusType2["TOOL_CONFIRMATION_RESPONSE"] = "tool-confirmation-response";
|
|
40811
|
+
MessageBusType2["TOOL_POLICY_REJECTION"] = "tool-policy-rejection";
|
|
40812
|
+
MessageBusType2["TOOL_EXECUTION_SUCCESS"] = "tool-execution-success";
|
|
40813
|
+
MessageBusType2["TOOL_EXECUTION_FAILURE"] = "tool-execution-failure";
|
|
40814
|
+
MessageBusType2["UPDATE_POLICY"] = "update-policy";
|
|
40815
|
+
MessageBusType2["TOOL_CALLS_UPDATE"] = "tool-calls-update";
|
|
40816
|
+
MessageBusType2["ASK_USER_REQUEST"] = "ask-user-request";
|
|
40817
|
+
MessageBusType2["ASK_USER_RESPONSE"] = "ask-user-response";
|
|
40818
|
+
MessageBusType2["SUBAGENT_ACTIVITY"] = "subagent-activity";
|
|
40819
|
+
})(MessageBusType || (MessageBusType = {}));
|
|
40820
|
+
var QuestionType;
|
|
40821
|
+
(function(QuestionType2) {
|
|
40822
|
+
QuestionType2["CHOICE"] = "choice";
|
|
40823
|
+
QuestionType2["TEXT"] = "text";
|
|
40824
|
+
QuestionType2["YESNO"] = "yesno";
|
|
40825
|
+
})(QuestionType || (QuestionType = {}));
|
|
40826
|
+
|
|
40821
40827
|
// packages/core/dist/src/tools/tools.js
|
|
40822
40828
|
function isBackgroundExecutionData(data) {
|
|
40823
40829
|
if (typeof data !== "object" || data === null) {
|
|
@@ -51951,16 +51957,17 @@ export {
|
|
|
51951
51957
|
EmbedContentResponse,
|
|
51952
51958
|
ApiError,
|
|
51953
51959
|
GoogleGenAI,
|
|
51954
|
-
MessageBusType,
|
|
51955
|
-
QuestionType,
|
|
51956
51960
|
PolicyDecision,
|
|
51957
51961
|
getHookSource,
|
|
51958
51962
|
ApprovalMode,
|
|
51963
|
+
MODES_BY_PERMISSIVENESS,
|
|
51959
51964
|
InProcessCheckerType,
|
|
51960
51965
|
PRIORITY_SUBAGENT_TOOL,
|
|
51961
51966
|
ALWAYS_ALLOW_PRIORITY_FRACTION,
|
|
51962
51967
|
ALWAYS_ALLOW_PRIORITY_OFFSET,
|
|
51963
51968
|
PRIORITY_YOLO_ALLOW_ALL,
|
|
51969
|
+
MessageBusType,
|
|
51970
|
+
QuestionType,
|
|
51964
51971
|
isBackgroundExecutionData,
|
|
51965
51972
|
BaseToolInvocation,
|
|
51966
51973
|
DeclarativeTool,
|