@google/gemini-cli 0.59.0-preview.0 → 0.60.0-nightly.20260905.g85aca163f
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/bundled/chrome-devtools-mcp.mjs +1 -1
- package/bundle/bundled/third_party/index.js +1 -1
- package/bundle/{chunk-NQC3UDKG.js → chunk-3CDPEGVA.js} +1 -1
- package/bundle/{chunk-THPIH2AE.js → chunk-3MT62KJ7.js} +1 -1
- package/bundle/{chunk-23C4TBLH.js → chunk-3SPYWTAG.js} +2 -2
- package/bundle/{chunk-UGT6DHAE.js → chunk-AL25HEEO.js} +210 -46
- package/bundle/{chunk-52JU4ECF.js → chunk-AXAX7FSE.js} +3845 -2735
- package/bundle/{chunk-KDHW7PJD.js → chunk-B7XEMEN5.js} +3 -3
- package/bundle/{chunk-UZXNPI5Z.js → chunk-DFOZHS4G.js} +270 -93
- package/bundle/{chunk-UA5K3TB5.js → chunk-FIESYQDV.js} +3967 -2757
- package/bundle/{chunk-YI5PKR5L.js → chunk-FPVYQTVA.js} +11349 -16975
- package/bundle/{chunk-D6XI6WNG.js → chunk-FX53IMQ4.js} +1 -1
- package/bundle/{chunk-IJPZK2CD.js → chunk-FYCX7S2H.js} +1 -1
- package/bundle/{chunk-VCQFRV5A.js → chunk-G4V32KTT.js} +1 -1
- package/bundle/{chunk-M6UTVOUK.js → chunk-IK5LG3S5.js} +1 -1
- package/bundle/{chunk-YLSAASP5.js → chunk-JE7V5AAP.js} +3 -3
- package/bundle/{chunk-LXBSPQEH.js → chunk-JIXDRDKL.js} +25 -4
- package/bundle/{chunk-DH76W27O.js → chunk-KI4HA3RK.js} +2 -2
- package/bundle/{chunk-FXZRZ2YL.js → chunk-L5DTYBPR.js} +210 -46
- package/bundle/chunk-M2YOG367.js +398992 -0
- package/bundle/{chunk-ILPBRVSF.js → chunk-M4VSTX4X.js} +1 -1
- package/bundle/{chunk-55V2C3NE.js → chunk-N7PUYZ2C.js} +3 -3
- package/bundle/{chunk-HSRFT2PV.js → chunk-OI5WY42W.js} +2 -2
- package/bundle/{chunk-7QCPYRGC.js → chunk-OSSPFBB5.js} +1 -1
- package/bundle/{chunk-GPE57TQ5.js → chunk-PHCDH4SW.js} +32 -8
- package/bundle/{chunk-GOBGZY54.js → chunk-Q5CIEKL6.js} +9 -8
- package/bundle/chunk-QCBXPS5K.js +154 -0
- package/bundle/chunk-TVCSMCKT.js +512 -0
- package/bundle/chunk-VEXKBYW3.js +1571 -0
- package/bundle/{chunk-F45BTUYK.js → chunk-VIXOL23X.js} +25 -4
- package/bundle/chunk-VKWL57SN.js +102670 -0
- package/bundle/chunk-W7R7PC32.js +17353 -0
- package/bundle/chunk-XTLORUWQ.js +398 -0
- package/bundle/chunk-ZIQEES26.js +118 -0
- package/bundle/{cleanup-IGZ72X72.js → cleanup-3YWFIXB3.js} +2 -2
- package/bundle/{cleanup-OHSG4ABA.js → cleanup-NQDXOU2K.js} +2 -2
- package/bundle/{cleanup-VTATI2S7.js → cleanup-SXOQFKSA.js} +2 -2
- package/bundle/cleanup-XSTC4XRT.js +32 -0
- package/bundle/{core-XJO3GR5B.js → core-T6ZA3RPN.js} +25 -1
- package/bundle/{devtoolsService-OSXWGLT3.js → devtoolsService-AYPMPUPD.js} +2 -2
- package/bundle/{devtoolsService-VQJ4XEED.js → devtoolsService-FPEN37GX.js} +4 -3
- package/bundle/{devtoolsService-TJCP6X22.js → devtoolsService-J5IMHON6.js} +2 -2
- package/bundle/devtoolsService-UV75F4RP.js +4359 -0
- package/bundle/{dist-KC5GXNU5.js → dist-CUTV6FXO.js} +25 -1
- package/bundle/{core-Q2DBVF5E.js → dist-QOCIGEB4.js} +25 -1
- package/bundle/dist-ZTPNJYCX.js +2212 -0
- package/bundle/docs/changelogs/index.md +20 -0
- package/bundle/docs/changelogs/latest.md +32 -281
- package/bundle/docs/changelogs/preview.md +18 -31
- package/bundle/docs/reference/tools.md +4 -4
- package/bundle/docs/tools/mcp-server.md +53 -0
- package/bundle/docs/tools/web-fetch.md +7 -3
- package/bundle/{gemini-FMVYHQ4P.js → gemini-DM7UHG5I.js} +56 -23
- package/bundle/{gemini-G4U2XJ5N.js → gemini-JANWUJ6X.js} +56 -23
- package/bundle/{gemini-G3Y4ZBUW.js → gemini-UBKFBQUZ.js} +256 -207
- package/bundle/gemini-ZT27CSNJ.js +17370 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-ODBGO5ZB.js → interactiveCli-AGRRFZQX.js} +8 -8
- package/bundle/{interactiveCli-J7RHUM6Y.js → interactiveCli-NC7ZBX74.js} +8 -8
- package/bundle/{interactiveCli-DFQDNRQR.js → interactiveCli-Q2LPGB6L.js} +315 -296
- package/bundle/interactiveCli-WG2TABNS.js +34983 -0
- package/bundle/{liteRtServerManager-FYXZXFSP.js → liteRtServerManager-6DPVBVVU.js} +4 -4
- package/bundle/{liteRtServerManager-H3DCLTFE.js → liteRtServerManager-HE2FE4FH.js} +4 -4
- package/bundle/{liteRtServerManager-BEQPNIUI.js → liteRtServerManager-JSW26OPJ.js} +4 -4
- package/bundle/liteRtServerManager-PJ223Y36.js +65 -0
- package/bundle/{oauth2-provider-2DCMBS2D.js → oauth2-provider-BR53NDPU.js} +1 -1
- package/bundle/{oauth2-provider-3RBG2E74.js → oauth2-provider-I665TJQN.js} +1 -1
- package/bundle/{oauth2-provider-DX42O6UX.js → oauth2-provider-UBZT242N.js} +38 -72
- package/bundle/oauth2-provider-WUYROQ6O.js +235 -0
- package/bundle/{start-MJKXAIFL.js → start-AA23VJDL.js} +6 -6
- package/bundle/{start-R4LT7TW6.js → start-U6VMEF32.js} +6 -6
- package/bundle/{start-MIKPZTJ4.js → start-WLQTESZU.js} +6 -6
- package/bundle/start-YX32XE72.js +18 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-M4VSTX4X.js";
|
|
6
6
|
import {
|
|
7
7
|
AppEvent,
|
|
8
8
|
appEvents
|
|
@@ -59,20 +59,22 @@ import {
|
|
|
59
59
|
stripUnsafeCharacters,
|
|
60
60
|
toCodePoints,
|
|
61
61
|
validateCustomTheme
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-W7R7PC32.js";
|
|
63
63
|
import {
|
|
64
64
|
isDevelopment
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-3SPYWTAG.js";
|
|
66
66
|
import {
|
|
67
67
|
emptyIcon,
|
|
68
68
|
require_react
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-3MT62KJ7.js";
|
|
70
70
|
import {
|
|
71
71
|
ALL_EDITORS,
|
|
72
72
|
ApprovalMode,
|
|
73
73
|
AsyncFzf,
|
|
74
|
+
AuthType,
|
|
74
75
|
Config,
|
|
75
76
|
CoreEvent,
|
|
77
|
+
CoreToolCallStatus,
|
|
76
78
|
DiscoveredMCPTool,
|
|
77
79
|
ExtensionDisableEvent,
|
|
78
80
|
ExtensionEnableEvent,
|
|
@@ -83,20 +85,31 @@ import {
|
|
|
83
85
|
ExtensionUpdateEvent,
|
|
84
86
|
GEMINI_CLI_COMPANION_EXTENSION_NAME,
|
|
85
87
|
GEMINI_DIR,
|
|
88
|
+
HookType,
|
|
89
|
+
IDEConnectionStatus,
|
|
86
90
|
INITIAL_HISTORY_LENGTH,
|
|
87
91
|
IdeClient,
|
|
88
92
|
IdeConnectionEvent,
|
|
93
|
+
IdeConnectionType,
|
|
94
|
+
IntegrityDataStatus,
|
|
89
95
|
KeychainTokenStorage,
|
|
96
|
+
LlmRole,
|
|
97
|
+
MCPDiscoveryState,
|
|
90
98
|
MCPOAuthTokenStorage,
|
|
99
|
+
MCPServerStatus,
|
|
91
100
|
ModelSlashCommandEvent,
|
|
101
|
+
PolicyDecision,
|
|
92
102
|
ProjectIdRequiredError,
|
|
93
103
|
REFERENCE_CONTENT_END,
|
|
94
104
|
REFERENCE_CONTENT_START,
|
|
95
105
|
ReadManyFilesTool,
|
|
96
106
|
RewindEvent,
|
|
107
|
+
SessionEndReason,
|
|
108
|
+
SessionStartSource,
|
|
97
109
|
ShellExecutionService,
|
|
98
110
|
StartSessionEvent,
|
|
99
111
|
Storage,
|
|
112
|
+
TrustLevel,
|
|
100
113
|
UPGRADE_URL_PAGE,
|
|
101
114
|
UserAccountManager,
|
|
102
115
|
ValidationRequiredError,
|
|
@@ -231,7 +244,7 @@ import {
|
|
|
231
244
|
tokenLimit,
|
|
232
245
|
uiTelemetryService,
|
|
233
246
|
unescapePath
|
|
234
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-M2YOG367.js";
|
|
235
248
|
import {
|
|
236
249
|
require_src
|
|
237
250
|
} from "./chunk-TUDYL3X4.js";
|
|
@@ -25721,11 +25734,11 @@ var require_util4 = __commonJS({
|
|
|
25721
25734
|
var { isUint8Array } = __require("node:util/types");
|
|
25722
25735
|
var { webidl } = require_webidl();
|
|
25723
25736
|
var supportedHashes = [];
|
|
25724
|
-
var
|
|
25737
|
+
var crypto3;
|
|
25725
25738
|
try {
|
|
25726
|
-
|
|
25739
|
+
crypto3 = __require("node:crypto");
|
|
25727
25740
|
const possibleRelevantHashes = ["sha256", "sha384", "sha512"];
|
|
25728
|
-
supportedHashes =
|
|
25741
|
+
supportedHashes = crypto3.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
|
|
25729
25742
|
} catch {
|
|
25730
25743
|
}
|
|
25731
25744
|
function responseURL(response) {
|
|
@@ -26028,7 +26041,7 @@ var require_util4 = __commonJS({
|
|
|
26028
26041
|
return isOriginPotentiallyTrustworthy(url.origin);
|
|
26029
26042
|
}
|
|
26030
26043
|
function bytesMatch(bytes, metadataList) {
|
|
26031
|
-
if (
|
|
26044
|
+
if (crypto3 === void 0) {
|
|
26032
26045
|
return true;
|
|
26033
26046
|
}
|
|
26034
26047
|
const parsedMetadata = parseMetadata(metadataList);
|
|
@@ -26043,7 +26056,7 @@ var require_util4 = __commonJS({
|
|
|
26043
26056
|
for (const item of metadata) {
|
|
26044
26057
|
const algorithm = item.algo;
|
|
26045
26058
|
const expectedValue = item.hash;
|
|
26046
|
-
let actualValue =
|
|
26059
|
+
let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64");
|
|
26047
26060
|
if (actualValue[actualValue.length - 1] === "=") {
|
|
26048
26061
|
if (actualValue[actualValue.length - 2] === "=") {
|
|
26049
26062
|
actualValue = actualValue.slice(0, -2);
|
|
@@ -27061,8 +27074,8 @@ var require_body = __commonJS({
|
|
|
27061
27074
|
var { multipartFormDataParser } = require_formdata_parser();
|
|
27062
27075
|
var random;
|
|
27063
27076
|
try {
|
|
27064
|
-
const
|
|
27065
|
-
random = (max) =>
|
|
27077
|
+
const crypto3 = __require("node:crypto");
|
|
27078
|
+
random = (max) => crypto3.randomInt(0, max);
|
|
27066
27079
|
} catch {
|
|
27067
27080
|
random = (max) => Math.floor(Math.random() * max);
|
|
27068
27081
|
}
|
|
@@ -39979,13 +39992,13 @@ var require_frame = __commonJS({
|
|
|
39979
39992
|
"use strict";
|
|
39980
39993
|
var { maxUnsigned16Bit, opcodes } = require_constants7();
|
|
39981
39994
|
var BUFFER_SIZE = 8 * 1024;
|
|
39982
|
-
var
|
|
39995
|
+
var crypto3;
|
|
39983
39996
|
var buffer = null;
|
|
39984
39997
|
var bufIdx = BUFFER_SIZE;
|
|
39985
39998
|
try {
|
|
39986
|
-
|
|
39999
|
+
crypto3 = __require("node:crypto");
|
|
39987
40000
|
} catch {
|
|
39988
|
-
|
|
40001
|
+
crypto3 = {
|
|
39989
40002
|
// not full compatibility, but minimum.
|
|
39990
40003
|
randomFillSync: function randomFillSync(buffer2, _offset, _size) {
|
|
39991
40004
|
for (let i = 0; i < buffer2.length; ++i) {
|
|
@@ -39998,7 +40011,7 @@ var require_frame = __commonJS({
|
|
|
39998
40011
|
function generateMask() {
|
|
39999
40012
|
if (bufIdx === BUFFER_SIZE) {
|
|
40000
40013
|
bufIdx = 0;
|
|
40001
|
-
|
|
40014
|
+
crypto3.randomFillSync(buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE), 0, BUFFER_SIZE);
|
|
40002
40015
|
}
|
|
40003
40016
|
return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]];
|
|
40004
40017
|
}
|
|
@@ -40096,9 +40109,9 @@ var require_connection = __commonJS({
|
|
|
40096
40109
|
var { getDecodeSplit } = require_util4();
|
|
40097
40110
|
var { WebsocketFrameSend } = require_frame();
|
|
40098
40111
|
var assert = __require("node:assert");
|
|
40099
|
-
var
|
|
40112
|
+
var crypto3;
|
|
40100
40113
|
try {
|
|
40101
|
-
|
|
40114
|
+
crypto3 = __require("node:crypto");
|
|
40102
40115
|
} catch {
|
|
40103
40116
|
}
|
|
40104
40117
|
function establishWebSocketConnection(url, protocols, client, handler2, options) {
|
|
@@ -40118,7 +40131,7 @@ var require_connection = __commonJS({
|
|
|
40118
40131
|
const headersList = getHeadersList(new Headers(options.headers));
|
|
40119
40132
|
request.headersList = headersList;
|
|
40120
40133
|
}
|
|
40121
|
-
const keyValue =
|
|
40134
|
+
const keyValue = crypto3.randomBytes(16).toString("base64");
|
|
40122
40135
|
request.headersList.append("sec-websocket-key", keyValue, true);
|
|
40123
40136
|
request.headersList.append("sec-websocket-version", "13", true);
|
|
40124
40137
|
for (const protocol of protocols) {
|
|
@@ -40151,7 +40164,7 @@ var require_connection = __commonJS({
|
|
|
40151
40164
|
return;
|
|
40152
40165
|
}
|
|
40153
40166
|
const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");
|
|
40154
|
-
const digest =
|
|
40167
|
+
const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64");
|
|
40155
40168
|
if (secWSAccept !== digest) {
|
|
40156
40169
|
failWebsocketConnection(handler2, 1002, "Incorrect hash received in Sec-WebSocket-Accept header.");
|
|
40157
40170
|
return;
|
|
@@ -60077,7 +60090,7 @@ var import_react34 = __toESM(require_react(), 1);
|
|
|
60077
60090
|
function useIdeTrustListener() {
|
|
60078
60091
|
const settings = useSettings();
|
|
60079
60092
|
const [connectionStatus, setConnectionStatus] = (0, import_react34.useState)(
|
|
60080
|
-
|
|
60093
|
+
IDEConnectionStatus.Disconnected
|
|
60081
60094
|
);
|
|
60082
60095
|
const previousTrust = (0, import_react34.useRef)(void 0);
|
|
60083
60096
|
const [restartReason, setRestartReason] = (0, import_react34.useState)("NONE");
|
|
@@ -60107,7 +60120,7 @@ function useIdeTrustListener() {
|
|
|
60107
60120
|
};
|
|
60108
60121
|
}, []);
|
|
60109
60122
|
const getSnapshot = () => {
|
|
60110
|
-
if (connectionStatus !==
|
|
60123
|
+
if (connectionStatus !== IDEConnectionStatus.Connected) {
|
|
60111
60124
|
return void 0;
|
|
60112
60125
|
}
|
|
60113
60126
|
return ideContextStore.get()?.workspaceState?.isTrusted;
|
|
@@ -60812,7 +60825,7 @@ async function initializeApp(config, settings) {
|
|
|
60812
60825
|
await ideClient.connect();
|
|
60813
60826
|
logIdeConnection(
|
|
60814
60827
|
config,
|
|
60815
|
-
new IdeConnectionEvent(
|
|
60828
|
+
new IdeConnectionEvent(IdeConnectionType.START)
|
|
60816
60829
|
);
|
|
60817
60830
|
}).catch((e) => {
|
|
60818
60831
|
debugLogger.error("Failed to initialize IDE client:", e);
|
|
@@ -60830,17 +60843,17 @@ async function initializeApp(config, settings) {
|
|
|
60830
60843
|
// packages/cli/src/config/auth.ts
|
|
60831
60844
|
async function validateAuthMethod(authMethod) {
|
|
60832
60845
|
loadEnvironment(loadSettings().merged, process.cwd());
|
|
60833
|
-
if (authMethod ===
|
|
60846
|
+
if (authMethod === AuthType.LOGIN_WITH_GOOGLE || authMethod === AuthType.COMPUTE_ADC) {
|
|
60834
60847
|
return null;
|
|
60835
60848
|
}
|
|
60836
|
-
if (authMethod ===
|
|
60849
|
+
if (authMethod === AuthType.USE_GEMINI) {
|
|
60837
60850
|
const key = process.env["GEMINI_API_KEY"] || await loadApiKey();
|
|
60838
60851
|
if (!key) {
|
|
60839
60852
|
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)!";
|
|
60840
60853
|
}
|
|
60841
60854
|
return null;
|
|
60842
60855
|
}
|
|
60843
|
-
if (authMethod ===
|
|
60856
|
+
if (authMethod === AuthType.USE_VERTEX_AI) {
|
|
60844
60857
|
const hasVertexProjectLocationConfig = !!process.env["GOOGLE_CLOUD_PROJECT"] && !!process.env["GOOGLE_CLOUD_LOCATION"];
|
|
60845
60858
|
const hasGoogleApiKey = !!process.env["GOOGLE_API_KEY"];
|
|
60846
60859
|
if (!hasVertexProjectLocationConfig && !hasGoogleApiKey) {
|
|
@@ -60852,6 +60865,7 @@ async function validateAuthMethod(authMethod) {
|
|
|
60852
60865
|
}
|
|
60853
60866
|
|
|
60854
60867
|
// packages/cli/src/config/extensions/consent.ts
|
|
60868
|
+
import * as crypto from "node:crypto";
|
|
60855
60869
|
import * as fs9 from "node:fs/promises";
|
|
60856
60870
|
import * as path3 from "node:path";
|
|
60857
60871
|
var import_chalk4 = __toESM(require_source(), 1);
|
|
@@ -60921,6 +60935,27 @@ async function promptForConsentInteractive(prompt, addExtensionUpdateConfirmatio
|
|
|
60921
60935
|
});
|
|
60922
60936
|
});
|
|
60923
60937
|
}
|
|
60938
|
+
function isRecord(value) {
|
|
60939
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60940
|
+
}
|
|
60941
|
+
function getMcpServerConfigHash(mcpServer) {
|
|
60942
|
+
const plainMcpServer = isRecord(mcpServer) ? mcpServer : {};
|
|
60943
|
+
const copy = { ...plainMcpServer };
|
|
60944
|
+
delete copy["extension"];
|
|
60945
|
+
const canonicalString = JSON.stringify(copy, (key, value) => {
|
|
60946
|
+
if (value instanceof RegExp) {
|
|
60947
|
+
return value.toString();
|
|
60948
|
+
}
|
|
60949
|
+
if (isRecord(value)) {
|
|
60950
|
+
return Object.keys(value).sort().reduce((result, k2) => {
|
|
60951
|
+
result[k2] = value[k2];
|
|
60952
|
+
return result;
|
|
60953
|
+
}, {});
|
|
60954
|
+
}
|
|
60955
|
+
return value;
|
|
60956
|
+
});
|
|
60957
|
+
return crypto.createHash("sha256").update(canonicalString).digest("hex");
|
|
60958
|
+
}
|
|
60924
60959
|
async function extensionConsentString(extensionConfig, hasHooks, skills = [], previousName, wasMigrated) {
|
|
60925
60960
|
const sanitizedConfig = escapeAnsiCtrlCodes(extensionConfig);
|
|
60926
60961
|
const output = [];
|
|
@@ -60948,6 +60983,83 @@ async function extensionConsentString(extensionConfig, hasHooks, skills = [], pr
|
|
|
60948
60983
|
const isLocal = !!mcpServer.command;
|
|
60949
60984
|
const source2 = mcpServer.httpUrl ?? `${mcpServer.command || ""}${mcpServer.args ? " " + mcpServer.args.join(" ") : ""}`;
|
|
60950
60985
|
output.push(` * ${key} (${isLocal ? "local" : "remote"}): ${source2}`);
|
|
60986
|
+
if (mcpServer.cwd) {
|
|
60987
|
+
output.push(` Working directory: ${mcpServer.cwd}`);
|
|
60988
|
+
}
|
|
60989
|
+
if (mcpServer.env && Object.keys(mcpServer.env).length > 0) {
|
|
60990
|
+
output.push(" Environment variables:");
|
|
60991
|
+
const sortedEnv = Object.entries(mcpServer.env).sort(
|
|
60992
|
+
([a], [b2]) => a.localeCompare(b2)
|
|
60993
|
+
);
|
|
60994
|
+
for (const [envKey, envValue] of sortedEnv) {
|
|
60995
|
+
const isSensitive = /token|secret|password|passwd|key|auth|credential|creds|private|cert/i.test(
|
|
60996
|
+
envKey
|
|
60997
|
+
);
|
|
60998
|
+
const displayValue = isSensitive && envValue ? "********" : envValue ?? "";
|
|
60999
|
+
output.push(` - ${envKey}: ${displayValue}`);
|
|
61000
|
+
}
|
|
61001
|
+
}
|
|
61002
|
+
if (mcpServer.headers && Object.keys(mcpServer.headers).length > 0) {
|
|
61003
|
+
output.push(" Headers:");
|
|
61004
|
+
const sortedHeaders = Object.entries(mcpServer.headers).sort(
|
|
61005
|
+
([a], [b2]) => a.localeCompare(b2)
|
|
61006
|
+
);
|
|
61007
|
+
for (const [headerKey, headerValue] of sortedHeaders) {
|
|
61008
|
+
const isSensitive = /authorization|key|cookie|token|secret/i.test(
|
|
61009
|
+
headerKey
|
|
61010
|
+
);
|
|
61011
|
+
const displayValue = isSensitive && headerValue ? "********" : headerValue ?? "";
|
|
61012
|
+
output.push(` - ${headerKey}: ${displayValue}`);
|
|
61013
|
+
}
|
|
61014
|
+
}
|
|
61015
|
+
if (mcpServer.url) {
|
|
61016
|
+
output.push(` URL: ${mcpServer.url}`);
|
|
61017
|
+
}
|
|
61018
|
+
if (mcpServer.tcp) {
|
|
61019
|
+
output.push(` TCP: ${mcpServer.tcp}`);
|
|
61020
|
+
}
|
|
61021
|
+
if (mcpServer.type) {
|
|
61022
|
+
output.push(` Type: ${mcpServer.type}`);
|
|
61023
|
+
}
|
|
61024
|
+
if (mcpServer.timeout !== void 0) {
|
|
61025
|
+
output.push(` Timeout: ${mcpServer.timeout}`);
|
|
61026
|
+
}
|
|
61027
|
+
if (mcpServer.trust !== void 0) {
|
|
61028
|
+
output.push(` Trust: ${mcpServer.trust}`);
|
|
61029
|
+
}
|
|
61030
|
+
if (mcpServer.description) {
|
|
61031
|
+
output.push(` Description: ${mcpServer.description}`);
|
|
61032
|
+
}
|
|
61033
|
+
if (mcpServer.includeTools && mcpServer.includeTools.length > 0) {
|
|
61034
|
+
output.push(` Include tools: ${mcpServer.includeTools.join(", ")}`);
|
|
61035
|
+
}
|
|
61036
|
+
if (mcpServer.excludeTools && mcpServer.excludeTools.length > 0) {
|
|
61037
|
+
output.push(` Exclude tools: ${mcpServer.excludeTools.join(", ")}`);
|
|
61038
|
+
}
|
|
61039
|
+
if (mcpServer.authProviderType) {
|
|
61040
|
+
output.push(` Auth Provider Type: ${mcpServer.authProviderType}`);
|
|
61041
|
+
}
|
|
61042
|
+
if (mcpServer.targetAudience) {
|
|
61043
|
+
output.push(` Target Audience: ${mcpServer.targetAudience}`);
|
|
61044
|
+
}
|
|
61045
|
+
if (mcpServer.targetServiceAccount) {
|
|
61046
|
+
output.push(
|
|
61047
|
+
` Target Service Account: ${mcpServer.targetServiceAccount}`
|
|
61048
|
+
);
|
|
61049
|
+
}
|
|
61050
|
+
if (mcpServer.oauth) {
|
|
61051
|
+
output.push(" OAuth Configuration:");
|
|
61052
|
+
const sortedOauth = Object.entries(mcpServer.oauth).sort(
|
|
61053
|
+
([a], [b2]) => a.localeCompare(b2)
|
|
61054
|
+
);
|
|
61055
|
+
for (const [oKey, oValue] of sortedOauth) {
|
|
61056
|
+
const isSensitive = /secret|token|password/i.test(oKey);
|
|
61057
|
+
const valStr = Array.isArray(oValue) ? oValue.join(", ") : String(oValue ?? "");
|
|
61058
|
+
const displayValue = isSensitive && valStr ? "********" : valStr;
|
|
61059
|
+
output.push(` - ${oKey}: ${displayValue}`);
|
|
61060
|
+
}
|
|
61061
|
+
}
|
|
61062
|
+
output.push(` Config signature: ${getMcpServerConfigHash(mcpServer)}`);
|
|
60951
61063
|
}
|
|
60952
61064
|
}
|
|
60953
61065
|
if (sanitizedConfig.contextFileName) {
|
|
@@ -61563,7 +61675,7 @@ var ExtensionEnablementManager = class {
|
|
|
61563
61675
|
};
|
|
61564
61676
|
|
|
61565
61677
|
// packages/cli/src/config/extension-manager.ts
|
|
61566
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
61678
|
+
import { createHash as createHash2, randomUUID } from "node:crypto";
|
|
61567
61679
|
|
|
61568
61680
|
// packages/cli/src/config/extension.ts
|
|
61569
61681
|
import * as fs13 from "node:fs";
|
|
@@ -65267,7 +65379,7 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
65267
65379
|
const trustedFolders = loadTrustedFolders();
|
|
65268
65380
|
await trustedFolders.setValue(
|
|
65269
65381
|
this.workspaceDir,
|
|
65270
|
-
|
|
65382
|
+
TrustLevel.TRUST_FOLDER
|
|
65271
65383
|
);
|
|
65272
65384
|
} else {
|
|
65273
65385
|
throw new Error(
|
|
@@ -65453,7 +65565,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
65453
65565
|
newExtensionConfig.version,
|
|
65454
65566
|
previousExtensionConfig.version,
|
|
65455
65567
|
installMetadata.type,
|
|
65456
|
-
|
|
65568
|
+
CoreToolCallStatus.Success
|
|
65457
65569
|
)
|
|
65458
65570
|
);
|
|
65459
65571
|
if (newExtensionName !== previousName) {
|
|
@@ -65476,7 +65588,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
65476
65588
|
getExtensionId(newExtensionConfig, installMetadata),
|
|
65477
65589
|
newExtensionConfig.version,
|
|
65478
65590
|
installMetadata.type,
|
|
65479
|
-
|
|
65591
|
+
CoreToolCallStatus.Success
|
|
65480
65592
|
)
|
|
65481
65593
|
);
|
|
65482
65594
|
await this.enableExtension(
|
|
@@ -65509,7 +65621,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
65509
65621
|
newExtensionConfig?.version ?? "",
|
|
65510
65622
|
previousExtensionConfig.version,
|
|
65511
65623
|
installMetadata.type,
|
|
65512
|
-
|
|
65624
|
+
CoreToolCallStatus.Error
|
|
65513
65625
|
)
|
|
65514
65626
|
);
|
|
65515
65627
|
} else {
|
|
@@ -65521,7 +65633,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
65521
65633
|
extensionId ?? "",
|
|
65522
65634
|
newExtensionConfig?.version ?? "",
|
|
65523
65635
|
installMetadata.type,
|
|
65524
|
-
|
|
65636
|
+
CoreToolCallStatus.Error
|
|
65525
65637
|
)
|
|
65526
65638
|
);
|
|
65527
65639
|
}
|
|
@@ -65552,7 +65664,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
65552
65664
|
extension.name,
|
|
65553
65665
|
hashValue(extension.name),
|
|
65554
65666
|
extension.id,
|
|
65555
|
-
|
|
65667
|
+
CoreToolCallStatus.Success
|
|
65556
65668
|
)
|
|
65557
65669
|
);
|
|
65558
65670
|
}
|
|
@@ -65782,18 +65894,10 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
65782
65894
|
}
|
|
65783
65895
|
}
|
|
65784
65896
|
}
|
|
65785
|
-
const contextFiles =
|
|
65786
|
-
|
|
65787
|
-
|
|
65788
|
-
|
|
65789
|
-
);
|
|
65790
|
-
if (!isSubpath(effectiveExtensionPath, contextFilePath)) {
|
|
65791
|
-
throw new Error(
|
|
65792
|
-
`Invalid context file path: "${contextFileName}". Context files must be within the extension directory.`
|
|
65793
|
-
);
|
|
65794
|
-
}
|
|
65795
|
-
return contextFilePath;
|
|
65796
|
-
}).filter((contextFilePath) => fs16.existsSync(contextFilePath));
|
|
65897
|
+
const contextFiles = resolveContextFilePaths(
|
|
65898
|
+
config,
|
|
65899
|
+
effectiveExtensionPath
|
|
65900
|
+
);
|
|
65797
65901
|
const hydrationContext = {
|
|
65798
65902
|
extensionPath: effectiveExtensionPath,
|
|
65799
65903
|
workspacePath: this.workspaceDir,
|
|
@@ -65822,7 +65926,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
65822
65926
|
if (eventHooks) {
|
|
65823
65927
|
for (const definition of eventHooks) {
|
|
65824
65928
|
for (const hook of definition.hooks) {
|
|
65825
|
-
if (hook.type ===
|
|
65929
|
+
if (hook.type === HookType.Command) {
|
|
65826
65930
|
hook.env = { ...hook.env, ...hookEnv };
|
|
65827
65931
|
}
|
|
65828
65932
|
}
|
|
@@ -65866,6 +65970,15 @@ Details: ${error.details}` : ""}`
|
|
|
65866
65970
|
`[ExtensionManager] Error loading agent from ${config.name}: ${error.message}`
|
|
65867
65971
|
);
|
|
65868
65972
|
}
|
|
65973
|
+
let plan = config.plan;
|
|
65974
|
+
if (plan?.directory) {
|
|
65975
|
+
if (typeof plan.directory !== "string" || path10.isAbsolute(plan.directory) || path10.win32.isAbsolute(plan.directory) || plan.directory.includes("..")) {
|
|
65976
|
+
debugLogger.warn(
|
|
65977
|
+
`[ExtensionManager] Invalid plan.directory in extension "${config.name}": "${plan.directory}". Relative parent navigation and absolute paths are not allowed.`
|
|
65978
|
+
);
|
|
65979
|
+
plan = void 0;
|
|
65980
|
+
}
|
|
65981
|
+
}
|
|
65869
65982
|
return {
|
|
65870
65983
|
name: config.name,
|
|
65871
65984
|
version: config.version,
|
|
@@ -65888,7 +66001,7 @@ Details: ${error.details}` : ""}`
|
|
|
65888
66001
|
themes: config.themes,
|
|
65889
66002
|
rules,
|
|
65890
66003
|
checkers,
|
|
65891
|
-
plan
|
|
66004
|
+
plan
|
|
65892
66005
|
};
|
|
65893
66006
|
} catch (e) {
|
|
65894
66007
|
debugLogger.error(
|
|
@@ -66143,6 +66256,69 @@ function getContextFileNames(config) {
|
|
|
66143
66256
|
}
|
|
66144
66257
|
return config.contextFileName;
|
|
66145
66258
|
}
|
|
66259
|
+
function validateContextFilePath(contextFileName, effectiveExtensionPath) {
|
|
66260
|
+
if (typeof contextFileName !== "string" || !contextFileName.trim()) {
|
|
66261
|
+
return {
|
|
66262
|
+
isValid: false,
|
|
66263
|
+
errorMessage: "expected a non-empty string."
|
|
66264
|
+
};
|
|
66265
|
+
}
|
|
66266
|
+
if (contextFileName.includes("\0")) {
|
|
66267
|
+
return {
|
|
66268
|
+
isValid: false,
|
|
66269
|
+
errorMessage: "null bytes are not allowed."
|
|
66270
|
+
};
|
|
66271
|
+
}
|
|
66272
|
+
if (path10.isAbsolute(contextFileName) || path10.win32.isAbsolute(contextFileName)) {
|
|
66273
|
+
return {
|
|
66274
|
+
isValid: false,
|
|
66275
|
+
errorMessage: "Absolute paths are not allowed."
|
|
66276
|
+
};
|
|
66277
|
+
}
|
|
66278
|
+
let decodedFileName = contextFileName;
|
|
66279
|
+
try {
|
|
66280
|
+
decodedFileName = decodeURIComponent(contextFileName);
|
|
66281
|
+
} catch {
|
|
66282
|
+
debugLogger.debug(
|
|
66283
|
+
`[ExtensionManager] Could not decode URI component in contextFileName: "${contextFileName}". Proceeding with undecoded name.`
|
|
66284
|
+
);
|
|
66285
|
+
}
|
|
66286
|
+
if (contextFileName.includes("..") || decodedFileName.includes("..")) {
|
|
66287
|
+
return {
|
|
66288
|
+
isValid: false,
|
|
66289
|
+
errorMessage: 'Relative parent directory references ("..") are not allowed.'
|
|
66290
|
+
};
|
|
66291
|
+
}
|
|
66292
|
+
const resolvedExtensionRoot = path10.resolve(effectiveExtensionPath);
|
|
66293
|
+
const contextFilePath = path10.resolve(resolvedExtensionRoot, contextFileName);
|
|
66294
|
+
if (!isSubpath(resolvedExtensionRoot, contextFilePath)) {
|
|
66295
|
+
return {
|
|
66296
|
+
isValid: false,
|
|
66297
|
+
errorMessage: `escapes the extension directory boundary ("${resolvedExtensionRoot}").`
|
|
66298
|
+
};
|
|
66299
|
+
}
|
|
66300
|
+
return {
|
|
66301
|
+
isValid: true,
|
|
66302
|
+
resolvedPath: contextFilePath
|
|
66303
|
+
};
|
|
66304
|
+
}
|
|
66305
|
+
function resolveContextFilePaths(config, effectiveExtensionPath) {
|
|
66306
|
+
return getContextFileNames(config).map((contextFileName) => {
|
|
66307
|
+
const validation = validateContextFilePath(
|
|
66308
|
+
contextFileName,
|
|
66309
|
+
effectiveExtensionPath
|
|
66310
|
+
);
|
|
66311
|
+
if (!validation.isValid) {
|
|
66312
|
+
debugLogger.warn(
|
|
66313
|
+
`[ExtensionManager] Invalid contextFileName: "${contextFileName}" in extension "${config.name}". ${validation.errorMessage}`
|
|
66314
|
+
);
|
|
66315
|
+
return null;
|
|
66316
|
+
}
|
|
66317
|
+
return validation.resolvedPath;
|
|
66318
|
+
}).filter(
|
|
66319
|
+
(contextFilePath) => contextFilePath !== null && fs16.existsSync(contextFilePath)
|
|
66320
|
+
);
|
|
66321
|
+
}
|
|
66146
66322
|
function validateName(name) {
|
|
66147
66323
|
if (!/^[a-zA-Z0-9-]+$/.test(name)) {
|
|
66148
66324
|
throw new Error(
|
|
@@ -66187,7 +66363,7 @@ function getExtensionId(config, installMetadata) {
|
|
|
66187
66363
|
return hashValue(idValue);
|
|
66188
66364
|
}
|
|
66189
66365
|
function hashValue(value) {
|
|
66190
|
-
return
|
|
66366
|
+
return createHash2("sha256").update(value).digest("hex");
|
|
66191
66367
|
}
|
|
66192
66368
|
|
|
66193
66369
|
// packages/cli/src/config/mcp/mcpServerEnablement.ts
|
|
@@ -66464,7 +66640,7 @@ function getDialogRestartRequiredSettings() {
|
|
|
66464
66640
|
(definition) => definition.requiresRestart && definition.showInDialog !== false
|
|
66465
66641
|
).map((definition) => definition.key);
|
|
66466
66642
|
}
|
|
66467
|
-
function
|
|
66643
|
+
function isRecord2(value) {
|
|
66468
66644
|
return typeof value === "object" && value !== null;
|
|
66469
66645
|
}
|
|
66470
66646
|
function isSettingsValue(value) {
|
|
@@ -66476,7 +66652,7 @@ function isSettingsValue(value) {
|
|
|
66476
66652
|
function getNestedValue(obj, path38) {
|
|
66477
66653
|
let current = obj;
|
|
66478
66654
|
for (const key of path38) {
|
|
66479
|
-
if (!
|
|
66655
|
+
if (!isRecord2(current) || !(key in current)) {
|
|
66480
66656
|
return void 0;
|
|
66481
66657
|
}
|
|
66482
66658
|
current = current[key];
|
|
@@ -66543,7 +66719,7 @@ function tryParseJsonStringArray(input) {
|
|
|
66543
66719
|
function tryParseJsonObject(input) {
|
|
66544
66720
|
try {
|
|
66545
66721
|
const parsed = JSON.parse(input);
|
|
66546
|
-
if (
|
|
66722
|
+
if (isRecord2(parsed) && !Array.isArray(parsed)) {
|
|
66547
66723
|
return parsed;
|
|
66548
66724
|
}
|
|
66549
66725
|
return null;
|
|
@@ -66853,7 +67029,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
66853
67029
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
66854
67030
|
name: `resources/read (${resource.serverName})`,
|
|
66855
67031
|
description: resource.uri,
|
|
66856
|
-
status:
|
|
67032
|
+
status: CoreToolCallStatus.Success,
|
|
66857
67033
|
isClientInitiated: true,
|
|
66858
67034
|
resultDisplay: `Successfully read resource ${resource.uri}`,
|
|
66859
67035
|
confirmationDetails: void 0
|
|
@@ -66868,7 +67044,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
66868
67044
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
66869
67045
|
name: `resources/read (${resource.serverName})`,
|
|
66870
67046
|
description: resource.uri,
|
|
66871
|
-
status:
|
|
67047
|
+
status: CoreToolCallStatus.Error,
|
|
66872
67048
|
isClientInitiated: true,
|
|
66873
67049
|
resultDisplay: `Error reading resource ${resource.uri}: ${getErrorMessage(error)}`,
|
|
66874
67050
|
confirmationDetails: void 0
|
|
@@ -66893,7 +67069,7 @@ Content from @${result.uri}:
|
|
|
66893
67069
|
}
|
|
66894
67070
|
if (hasError) {
|
|
66895
67071
|
const firstError = displays.find(
|
|
66896
|
-
(d) => d.status ===
|
|
67072
|
+
(d) => d.status === CoreToolCallStatus.Error
|
|
66897
67073
|
);
|
|
66898
67074
|
return {
|
|
66899
67075
|
parts: [],
|
|
@@ -66934,7 +67110,7 @@ async function readLocalFiles(resolvedFiles, config, signal, userMessageTimestam
|
|
|
66934
67110
|
callId: `client-read-${userMessageTimestamp}`,
|
|
66935
67111
|
name: readManyFilesTool.displayName,
|
|
66936
67112
|
description: invocation.getDescription(),
|
|
66937
|
-
status:
|
|
67113
|
+
status: CoreToolCallStatus.Success,
|
|
66938
67114
|
isClientInitiated: true,
|
|
66939
67115
|
resultDisplay: result.returnDisplay || `Successfully read: ${fileLabelsForDisplay.join(", ")}`,
|
|
66940
67116
|
confirmationDetails: void 0
|
|
@@ -66981,7 +67157,7 @@ Content from @${displayPath}:
|
|
|
66981
67157
|
callId: `client-read-${userMessageTimestamp}`,
|
|
66982
67158
|
name: readManyFilesTool.displayName,
|
|
66983
67159
|
description: invocation?.getDescription() ?? "Error attempting to execute tool to read files",
|
|
66984
|
-
status:
|
|
67160
|
+
status: CoreToolCallStatus.Error,
|
|
66985
67161
|
isClientInitiated: true,
|
|
66986
67162
|
resultDisplay: `Error reading files (${fileLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,
|
|
66987
67163
|
confirmationDetails: void 0
|
|
@@ -67144,8 +67320,8 @@ var import_execa = __toESM(require_execa(), 1);
|
|
|
67144
67320
|
|
|
67145
67321
|
// node_modules/crypto-random-string/index.js
|
|
67146
67322
|
import { promisify } from "util";
|
|
67147
|
-
import
|
|
67148
|
-
var randomBytesAsync = promisify(
|
|
67323
|
+
import crypto2 from "crypto";
|
|
67324
|
+
var randomBytesAsync = promisify(crypto2.randomBytes);
|
|
67149
67325
|
var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split("");
|
|
67150
67326
|
var numericCharacters = "0123456789".split("");
|
|
67151
67327
|
var distinguishableCharacters = "CDEHKMPRTUWXY012458".split("");
|
|
@@ -67158,7 +67334,7 @@ var generateForCustomCharacters = (length, characters) => {
|
|
|
67158
67334
|
let string = "";
|
|
67159
67335
|
let stringLength = 0;
|
|
67160
67336
|
while (stringLength < length) {
|
|
67161
|
-
const entropy =
|
|
67337
|
+
const entropy = crypto2.randomBytes(entropyLength);
|
|
67162
67338
|
let entropyPosition = 0;
|
|
67163
67339
|
while (entropyPosition < entropyLength && stringLength < length) {
|
|
67164
67340
|
const entropyValue = entropy.readUInt16LE(entropyPosition);
|
|
@@ -67193,7 +67369,7 @@ var generateForCustomCharactersAsync = async (length, characters) => {
|
|
|
67193
67369
|
}
|
|
67194
67370
|
return string;
|
|
67195
67371
|
};
|
|
67196
|
-
var generateRandomBytes = (byteLength, type, length) =>
|
|
67372
|
+
var generateRandomBytes = (byteLength, type, length) => crypto2.randomBytes(byteLength).toString(type).slice(0, length);
|
|
67197
67373
|
var generateRandomBytesAsync = async (byteLength, type, length) => {
|
|
67198
67374
|
const buffer = await randomBytesAsync(byteLength);
|
|
67199
67375
|
return buffer.toString(type).slice(0, length);
|
|
@@ -70248,7 +70424,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
70248
70424
|
if (wasRaw) {
|
|
70249
70425
|
setRawMode?.(true);
|
|
70250
70426
|
}
|
|
70251
|
-
coreEvents.emit(
|
|
70427
|
+
coreEvents.emit(CoreEvent.ExternalEditorClosed);
|
|
70252
70428
|
}
|
|
70253
70429
|
}
|
|
70254
70430
|
|
|
@@ -72943,7 +73119,7 @@ async function updateExtension(extension, extensionManager, currentState, dispat
|
|
|
72943
73119
|
extension.name,
|
|
72944
73120
|
installMetadata
|
|
72945
73121
|
);
|
|
72946
|
-
if (status ===
|
|
73122
|
+
if (status === IntegrityDataStatus.INVALID) {
|
|
72947
73123
|
throw new Error("Extension integrity cannot be verified");
|
|
72948
73124
|
}
|
|
72949
73125
|
} catch (e) {
|
|
@@ -74364,11 +74540,11 @@ var ShellProcessor = class {
|
|
|
74364
74540
|
},
|
|
74365
74541
|
void 0
|
|
74366
74542
|
);
|
|
74367
|
-
if (decision ===
|
|
74543
|
+
if (decision === PolicyDecision.DENY) {
|
|
74368
74544
|
throw new Error(
|
|
74369
74545
|
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
74370
74546
|
);
|
|
74371
|
-
} else if (decision ===
|
|
74547
|
+
} else if (decision === PolicyDecision.ASK_USER) {
|
|
74372
74548
|
commandsToConfirm.add(command);
|
|
74373
74549
|
}
|
|
74374
74550
|
}
|
|
@@ -75486,7 +75662,7 @@ var MultiFolderTrustDialog = ({
|
|
|
75486
75662
|
if (choice === 1 /* YES_AND_REMEMBER */) {
|
|
75487
75663
|
await trustedFolders.setValue(
|
|
75488
75664
|
expandedPath,
|
|
75489
|
-
|
|
75665
|
+
TrustLevel.TRUST_FOLDER
|
|
75490
75666
|
);
|
|
75491
75667
|
}
|
|
75492
75668
|
workspaceContext.addDirectory(expandedPath);
|
|
@@ -77164,7 +77340,7 @@ var authCommand = {
|
|
|
77164
77340
|
import process29 from "node:process";
|
|
77165
77341
|
|
|
77166
77342
|
// packages/cli/src/generated/git-commit.ts
|
|
77167
|
-
var GIT_COMMIT_INFO = "
|
|
77343
|
+
var GIT_COMMIT_INFO = "45a3422c9";
|
|
77168
77344
|
|
|
77169
77345
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
77170
77346
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -77810,7 +77986,7 @@ var clearCommand = {
|
|
|
77810
77986
|
const config = context.services.agentContext?.config;
|
|
77811
77987
|
const hookSystem = config?.getHookSystem();
|
|
77812
77988
|
if (hookSystem) {
|
|
77813
|
-
await hookSystem.fireSessionEndEvent(
|
|
77989
|
+
await hookSystem.fireSessionEndEvent(SessionEndReason.Clear);
|
|
77814
77990
|
}
|
|
77815
77991
|
config?.injectionService.clear();
|
|
77816
77992
|
let newSessionId;
|
|
@@ -77827,7 +78003,7 @@ var clearCommand = {
|
|
|
77827
78003
|
}
|
|
77828
78004
|
let result;
|
|
77829
78005
|
if (hookSystem) {
|
|
77830
|
-
result = await hookSystem.fireSessionStartEvent(
|
|
78006
|
+
result = await hookSystem.fireSessionStartEvent(SessionStartSource.Clear);
|
|
77831
78007
|
}
|
|
77832
78008
|
await new Promise((resolve9) => setImmediate(resolve9));
|
|
77833
78009
|
if (config) {
|
|
@@ -78977,7 +79153,7 @@ var ExtensionRegistryClient = class _ExtensionRegistryClient {
|
|
|
78977
79153
|
_ExtensionRegistryClient.fetchPromise = (async () => {
|
|
78978
79154
|
try {
|
|
78979
79155
|
if (uri.startsWith("http")) {
|
|
78980
|
-
if (isPrivateIp(uri)) {
|
|
79156
|
+
if (await isPrivateIp(uri)) {
|
|
78981
79157
|
throw new Error(
|
|
78982
79158
|
"Private IP addresses are not allowed for the extension registry."
|
|
78983
79159
|
);
|
|
@@ -80826,7 +81002,7 @@ var Footer = () => {
|
|
|
80826
81002
|
case "auth": {
|
|
80827
81003
|
if (!settings.merged.ui.showUserIdentity) break;
|
|
80828
81004
|
if (!authType) break;
|
|
80829
|
-
const displayStr = authType ===
|
|
81005
|
+
const displayStr = authType === AuthType.LOGIN_WITH_GOOGLE ? email ?? "google" : authType;
|
|
80830
81006
|
addCol(
|
|
80831
81007
|
id,
|
|
80832
81008
|
header,
|
|
@@ -82594,12 +82770,12 @@ import path29 from "node:path";
|
|
|
82594
82770
|
function getIdeStatusMessage(ideClient) {
|
|
82595
82771
|
const connection = ideClient.getConnectionStatus();
|
|
82596
82772
|
switch (connection.status) {
|
|
82597
|
-
case
|
|
82773
|
+
case IDEConnectionStatus.Connected:
|
|
82598
82774
|
return {
|
|
82599
82775
|
messageType: "info",
|
|
82600
82776
|
content: `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`
|
|
82601
82777
|
};
|
|
82602
|
-
case
|
|
82778
|
+
case IDEConnectionStatus.Connecting:
|
|
82603
82779
|
return {
|
|
82604
82780
|
messageType: "info",
|
|
82605
82781
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -82640,7 +82816,7 @@ ${infoMessage}`;
|
|
|
82640
82816
|
async function getIdeStatusMessageWithFiles(ideClient) {
|
|
82641
82817
|
const connection = ideClient.getConnectionStatus();
|
|
82642
82818
|
switch (connection.status) {
|
|
82643
|
-
case
|
|
82819
|
+
case IDEConnectionStatus.Connected: {
|
|
82644
82820
|
let content = `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`;
|
|
82645
82821
|
const context = ideContextStore.get();
|
|
82646
82822
|
const openFiles = context?.workspaceState?.openFiles;
|
|
@@ -82652,7 +82828,7 @@ async function getIdeStatusMessageWithFiles(ideClient) {
|
|
|
82652
82828
|
content
|
|
82653
82829
|
};
|
|
82654
82830
|
}
|
|
82655
|
-
case
|
|
82831
|
+
case IDEConnectionStatus.Connecting:
|
|
82656
82832
|
return {
|
|
82657
82833
|
messageType: "info",
|
|
82658
82834
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -82674,7 +82850,7 @@ async function setIdeModeAndSyncConnection(config, value, options = {}) {
|
|
|
82674
82850
|
const ideClient = await IdeClient.getInstance();
|
|
82675
82851
|
if (value) {
|
|
82676
82852
|
await ideClient.connect(options);
|
|
82677
|
-
logIdeConnection(config, new IdeConnectionEvent(
|
|
82853
|
+
logIdeConnection(config, new IdeConnectionEvent(IdeConnectionType.SESSION));
|
|
82678
82854
|
} else {
|
|
82679
82855
|
await ideClient.disconnect();
|
|
82680
82856
|
}
|
|
@@ -82762,7 +82938,7 @@ var ideCommand = async () => {
|
|
|
82762
82938
|
logToConsole: false
|
|
82763
82939
|
}
|
|
82764
82940
|
);
|
|
82765
|
-
if (ideClient.getConnectionStatus().status ===
|
|
82941
|
+
if (ideClient.getConnectionStatus().status === IDEConnectionStatus.Connected) {
|
|
82766
82942
|
break;
|
|
82767
82943
|
}
|
|
82768
82944
|
await new Promise((resolve9) => setTimeout(resolve9, 500));
|
|
@@ -82839,7 +83015,7 @@ var ideCommand = async () => {
|
|
|
82839
83015
|
}
|
|
82840
83016
|
};
|
|
82841
83017
|
const { status } = ideClient.getConnectionStatus();
|
|
82842
|
-
const isConnected = status ===
|
|
83018
|
+
const isConnected = status === IDEConnectionStatus.Connected;
|
|
82843
83019
|
if (isConnected) {
|
|
82844
83020
|
ideSlashCommand.subCommands = [statusCommand2, disableCommand5];
|
|
82845
83021
|
} else {
|
|
@@ -82939,13 +83115,13 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
82939
83115
|
const displayListener = (message) => {
|
|
82940
83116
|
context.ui.addItem({ type: "info", text: message });
|
|
82941
83117
|
};
|
|
82942
|
-
coreEvents.on(
|
|
83118
|
+
coreEvents.on(CoreEvent.OauthDisplayMessage, displayListener);
|
|
82943
83119
|
try {
|
|
82944
83120
|
context.ui.addItem({
|
|
82945
83121
|
type: "info",
|
|
82946
83122
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
82947
83123
|
});
|
|
82948
|
-
const { MCPOAuthProvider } = await import("./
|
|
83124
|
+
const { MCPOAuthProvider } = await import("./dist-ZTPNJYCX.js");
|
|
82949
83125
|
let oauthConfig = server.oauth;
|
|
82950
83126
|
if (!oauthConfig) {
|
|
82951
83127
|
oauthConfig = { enabled: false };
|
|
@@ -82982,7 +83158,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
82982
83158
|
content: `Failed to authenticate with MCP server '${serverName}': ${getErrorMessage(error)}`
|
|
82983
83159
|
};
|
|
82984
83160
|
} finally {
|
|
82985
|
-
coreEvents.removeListener(
|
|
83161
|
+
coreEvents.removeListener(CoreEvent.OauthDisplayMessage, displayListener);
|
|
82986
83162
|
}
|
|
82987
83163
|
},
|
|
82988
83164
|
completion: async (context, partialArg) => {
|
|
@@ -83028,10 +83204,10 @@ var listAction2 = async (context, showDescriptions = false, showSchema = false,
|
|
|
83028
83204
|
}
|
|
83029
83205
|
const serverNames = Object.keys(mcpServers);
|
|
83030
83206
|
const connectingServers = serverNames.filter(
|
|
83031
|
-
(name) => getMCPServerStatus(name) ===
|
|
83207
|
+
(name) => getMCPServerStatus(name) === MCPServerStatus.CONNECTING
|
|
83032
83208
|
);
|
|
83033
83209
|
const discoveryState = getMCPDiscoveryState();
|
|
83034
|
-
const discoveryInProgress = discoveryState ===
|
|
83210
|
+
const discoveryInProgress = discoveryState === MCPDiscoveryState.IN_PROGRESS || connectingServers.length > 0;
|
|
83035
83211
|
const allTools = toolRegistry.getAllTools();
|
|
83036
83212
|
const mcpTools = allTools.filter((tool) => tool instanceof DiscoveredMCPTool);
|
|
83037
83213
|
const promptRegistry = config.getPromptRegistry();
|
|
@@ -98790,7 +98966,7 @@ Return a JSON object with:
|
|
|
98790
98966
|
},
|
|
98791
98967
|
abortSignal: new AbortController().signal,
|
|
98792
98968
|
promptId: "triage-duplicates",
|
|
98793
|
-
role:
|
|
98969
|
+
role: LlmRole.UTILITY_TOOL
|
|
98794
98970
|
});
|
|
98795
98971
|
const rec = response;
|
|
98796
98972
|
let canonical;
|
|
@@ -99624,7 +99800,7 @@ Return a JSON object with:
|
|
|
99624
99800
|
},
|
|
99625
99801
|
abortSignal: abortControllerRef.current.signal,
|
|
99626
99802
|
promptId: "triage-issues",
|
|
99627
|
-
role:
|
|
99803
|
+
role: LlmRole.UTILITY_TOOL
|
|
99628
99804
|
});
|
|
99629
99805
|
return response;
|
|
99630
99806
|
},
|
|
@@ -100198,8 +100374,8 @@ var planCommand = {
|
|
|
100198
100374
|
return;
|
|
100199
100375
|
}
|
|
100200
100376
|
const previousApprovalMode = config.getApprovalMode();
|
|
100201
|
-
config.setApprovalMode(
|
|
100202
|
-
if (previousApprovalMode !==
|
|
100377
|
+
config.setApprovalMode(ApprovalMode.PLAN);
|
|
100378
|
+
if (previousApprovalMode !== ApprovalMode.PLAN) {
|
|
100203
100379
|
coreEvents.emitFeedback("info", "Switched to Plan Mode.");
|
|
100204
100380
|
}
|
|
100205
100381
|
if (context.invocation?.args) {
|
|
@@ -100258,10 +100434,10 @@ var categorizeRulesByMode = (rules) => {
|
|
|
100258
100434
|
rules.forEach((rule) => {
|
|
100259
100435
|
const modes = rule.modes?.length ? rule.modes : ALL_MODES;
|
|
100260
100436
|
const modeSet = new Set(modes);
|
|
100261
|
-
if (modeSet.has(
|
|
100262
|
-
if (modeSet.has(
|
|
100263
|
-
if (modeSet.has(
|
|
100264
|
-
if (modeSet.has(
|
|
100437
|
+
if (modeSet.has(ApprovalMode.DEFAULT)) result.normal.push(rule);
|
|
100438
|
+
if (modeSet.has(ApprovalMode.AUTO_EDIT)) result.autoEdit.push(rule);
|
|
100439
|
+
if (modeSet.has(ApprovalMode.YOLO)) result.yolo.push(rule);
|
|
100440
|
+
if (modeSet.has(ApprovalMode.PLAN)) result.plan.push(rule);
|
|
100265
100441
|
});
|
|
100266
100442
|
return result;
|
|
100267
100443
|
};
|
|
@@ -101642,7 +101818,7 @@ var upgradeCommand = {
|
|
|
101642
101818
|
action: async (context) => {
|
|
101643
101819
|
const config = context.services.agentContext?.config;
|
|
101644
101820
|
const authType = config?.getContentGeneratorConfig()?.authType;
|
|
101645
|
-
if (authType !==
|
|
101821
|
+
if (authType !== AuthType.LOGIN_WITH_GOOGLE) {
|
|
101646
101822
|
return {
|
|
101647
101823
|
type: "message",
|
|
101648
101824
|
messageType: "error",
|
|
@@ -101871,7 +102047,7 @@ var BuiltinCommandLoader = class {
|
|
|
101871
102047
|
setupGithubCommand,
|
|
101872
102048
|
terminalSetupCommand,
|
|
101873
102049
|
...this.config?.isVoiceModeEnabled() ? [voiceCommand] : [],
|
|
101874
|
-
...this.config?.getContentGeneratorConfig()?.authType ===
|
|
102050
|
+
...this.config?.getContentGeneratorConfig()?.authType === AuthType.LOGIN_WITH_GOOGLE ? [upgradeCommand] : []
|
|
101875
102051
|
];
|
|
101876
102052
|
handle?.end();
|
|
101877
102053
|
return allDefinitions.filter((cmd) => cmd !== null);
|
|
@@ -102129,6 +102305,7 @@ export {
|
|
|
102129
102305
|
configureAllExtensions,
|
|
102130
102306
|
getFormattedSettingValue,
|
|
102131
102307
|
ExtensionManager,
|
|
102308
|
+
validateContextFilePath,
|
|
102132
102309
|
inferInstallMetadata,
|
|
102133
102310
|
normalizeServerId,
|
|
102134
102311
|
canLoadServer,
|
|
@@ -102146,7 +102323,7 @@ export {
|
|
|
102146
102323
|
statusCommand,
|
|
102147
102324
|
getSettingDefinition,
|
|
102148
102325
|
getDialogRestartRequiredSettings,
|
|
102149
|
-
isRecord,
|
|
102326
|
+
isRecord2 as isRecord,
|
|
102150
102327
|
getNestedValue,
|
|
102151
102328
|
getEffectiveValue,
|
|
102152
102329
|
getDialogSettingKeys,
|