@google/gemini-cli 0.40.0-preview.2 → 0.40.0-preview.4
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-3GU3LF3I.js → chunk-4XVBQQNJ.js} +181 -16
- package/bundle/{chunk-PLUWJHZZ.js → chunk-547AWTTH.js} +238 -61
- package/bundle/{chunk-EFCQXWIF.js → chunk-63PTTRTA.js} +3 -3
- package/bundle/{chunk-IMEC72NS.js → chunk-ATGIEBEB.js} +1 -1
- package/bundle/{chunk-WL5MCPV2.js → chunk-BV2W6YE6.js} +2 -2
- package/bundle/{chunk-QK7UWGBN.js → chunk-CIO3GUGQ.js} +1382 -1083
- package/bundle/{chunk-HV36F4CL.js → chunk-CJQVVQSH.js} +134 -354
- package/bundle/{chunk-VCGILCZV.js → chunk-F73F75XM.js} +16 -0
- package/bundle/{chunk-TDW6FM3A.js → chunk-G356GKHH.js} +1 -1
- package/bundle/{chunk-4IJPDKI6.js → chunk-H4NQBTXN.js} +146 -364
- package/bundle/{chunk-GXRQOXQF.js → chunk-H7F2VOIJ.js} +178 -14
- package/bundle/chunk-HF7X35D3.js +80012 -0
- package/bundle/{chunk-WHIWQCI5.js → chunk-HGFADN5A.js} +1 -1
- package/bundle/{chunk-NO7STVVM.js → chunk-KG7ZFMJL.js} +1413 -1089
- package/bundle/{chunk-33ANPP4S.js → chunk-LMVZLINC.js} +3 -3
- package/bundle/chunk-LODNDE3S.js +17505 -0
- package/bundle/{chunk-IUVLJUOL.js → chunk-LVHUYMBU.js} +2 -2
- package/bundle/{chunk-NIVCRM5L.js → chunk-M76FWZ5L.js} +134 -354
- package/bundle/{chunk-RM43GNQQ.js → chunk-NV6UCR4K.js} +7711 -12909
- package/bundle/{chunk-MUGUV6RZ.js → chunk-PRZIW6SM.js} +2 -2
- package/bundle/chunk-RENFZ63F.js +351149 -0
- package/bundle/chunk-SYPUOR3U.js +156 -0
- package/bundle/{chunk-2RHFUIH4.js → chunk-UHHRGNIO.js} +16 -0
- package/bundle/chunk-VQ7N6NVX.js +1571 -0
- package/bundle/{chunk-UBXB5AEJ.js → chunk-WSTHO4WR.js} +3 -3
- package/bundle/chunk-ZQNX6OWU.js +118 -0
- package/bundle/{cleanup-A7WXWAMI.js → cleanup-4EFDM2N7.js} +3 -3
- package/bundle/{cleanup-EWPIME2M.js → cleanup-4RRVO4GO.js} +3 -3
- package/bundle/{cleanup-IPLJJT5S.js → cleanup-DNS7PXYC.js} +3 -3
- package/bundle/cleanup-DXHNV2J6.js +33 -0
- package/bundle/{core-VCDK23ZC.js → core-WQSFCPEO.js} +28 -2
- package/bundle/{devtoolsService-6Y6YER6T.js → devtoolsService-JWET4G6G.js} +3 -3
- package/bundle/{devtoolsService-B5VVZ752.js → devtoolsService-LPEBYJVD.js} +3 -3
- package/bundle/{devtoolsService-2JXSALRU.js → devtoolsService-S2LBUUZU.js} +5 -4
- package/bundle/devtoolsService-YCRNWWXE.js +852 -0
- package/bundle/{dist-UIXQETMC.js → dist-ANTOB3YW.js} +28 -2
- package/bundle/{core-BQT6T3CH.js → dist-RIVCP5ZD.js} +28 -2
- package/bundle/dist-UH565MTG.js +2046 -0
- package/bundle/docs/cli/cli-reference.md +1 -0
- package/bundle/docs/cli/trusted-folders.md +28 -0
- package/bundle/docs/reference/configuration.md +14 -0
- package/bundle/{gemini-ID44Z5SV.js → gemini-27FQ5BI4.js} +66 -22
- package/bundle/{gemini-54LH6RUH.js → gemini-57EC2ZF7.js} +241 -182
- package/bundle/{gemini-44W2QEZI.js → gemini-JAZVYRDD.js} +64 -21
- package/bundle/gemini-TQZRS37Q.js +16087 -0
- package/bundle/gemini.js +3 -3
- package/bundle/{interactiveCli-5MTJDFYC.js → interactiveCli-E35R6QQC.js} +17 -167
- package/bundle/{interactiveCli-JFBPGMNM.js → interactiveCli-FPHSBRV3.js} +30 -179
- package/bundle/{interactiveCli-5B3X6RNB.js → interactiveCli-L3EK4XEX.js} +300 -432
- package/bundle/interactiveCli-MVHR4VV7.js +34448 -0
- package/bundle/{liteRtServerManager-76V63PRJ.js → liteRtServerManager-LXEAYAUP.js} +4 -4
- package/bundle/{liteRtServerManager-WQMDPACQ.js → liteRtServerManager-ORSW3R4F.js} +4 -4
- package/bundle/{liteRtServerManager-6GJWEP5W.js → liteRtServerManager-PI4ZNFB5.js} +4 -4
- package/bundle/liteRtServerManager-YYXO5Q3I.js +65 -0
- package/bundle/{memoryDiscovery-RYHYLAPJ.js → memoryDiscovery-CZURD35O.js} +1 -1
- package/bundle/{memoryDiscovery-HWEYBJE7.js → memoryDiscovery-GZLXKRGB.js} +1 -1
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-EX6SQEZP.js → oauth2-provider-B3NTBNAM.js} +2 -2
- package/bundle/{oauth2-provider-ZF52AWQY.js → oauth2-provider-ENF2D4Q7.js} +39 -73
- package/bundle/{oauth2-provider-JCKLNKRV.js → oauth2-provider-I3G773GE.js} +2 -2
- package/bundle/oauth2-provider-WTF7AHQ2.js +237 -0
- package/bundle/{start-CYDJTOAP.js → start-CRIFZ3SW.js} +6 -6
- package/bundle/{start-SHOUHW3Y.js → start-KVFKS3IT.js} +6 -6
- package/bundle/{start-B6EMQCH5.js → start-OTLGMCNH.js} +6 -6
- package/bundle/start-S3REI3X2.js +18 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
exitCli,
|
|
8
8
|
require_source
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HGFADN5A.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_BACKGROUND_OPACITY,
|
|
12
12
|
DEFAULT_BORDER_OPACITY,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
escapeAnsiCtrlCodes,
|
|
33
33
|
getBinaryPath,
|
|
34
34
|
getCachedStringWidth,
|
|
35
|
+
getSettingsSchema,
|
|
35
36
|
getThemeTypeFromBackgroundColor,
|
|
36
37
|
interpolateColor,
|
|
37
38
|
isBinaryInstalled,
|
|
@@ -58,13 +59,15 @@ import {
|
|
|
58
59
|
stripUnsafeCharacters,
|
|
59
60
|
toCodePoints,
|
|
60
61
|
validateCustomTheme
|
|
61
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-LODNDE3S.js";
|
|
62
63
|
import {
|
|
63
64
|
runExitCleanup
|
|
64
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-SYPUOR3U.js";
|
|
65
66
|
import {
|
|
66
67
|
AsyncFzf,
|
|
68
|
+
AuthType,
|
|
67
69
|
Config,
|
|
70
|
+
CoreToolCallStatus,
|
|
68
71
|
ExtensionDisableEvent,
|
|
69
72
|
ExtensionEnableEvent,
|
|
70
73
|
ExtensionInstallEvent,
|
|
@@ -73,17 +76,27 @@ import {
|
|
|
73
76
|
ExtensionUninstallEvent,
|
|
74
77
|
ExtensionUpdateEvent,
|
|
75
78
|
GEMINI_CLI_COMPANION_EXTENSION_NAME,
|
|
79
|
+
HookType,
|
|
80
|
+
IDEConnectionStatus,
|
|
76
81
|
INITIAL_HISTORY_LENGTH,
|
|
77
82
|
IdeClient,
|
|
78
83
|
IdeConnectionEvent,
|
|
84
|
+
IdeConnectionType,
|
|
85
|
+
IntegrityDataStatus,
|
|
79
86
|
KeychainTokenStorage,
|
|
87
|
+
LlmRole,
|
|
88
|
+
MCPDiscoveryState,
|
|
80
89
|
MCPOAuthTokenStorage,
|
|
90
|
+
MCPServerStatus,
|
|
81
91
|
ModelSlashCommandEvent,
|
|
82
92
|
ProjectIdRequiredError,
|
|
83
93
|
ReadManyFilesTool,
|
|
84
94
|
RewindEvent,
|
|
95
|
+
SessionEndReason,
|
|
96
|
+
SessionStartSource,
|
|
85
97
|
ShellExecutionService,
|
|
86
98
|
StartSessionEvent,
|
|
99
|
+
TrustLevel,
|
|
87
100
|
UPGRADE_URL_PAGE,
|
|
88
101
|
UserAccountManager,
|
|
89
102
|
ValidationRequiredError,
|
|
@@ -195,12 +208,13 @@ import {
|
|
|
195
208
|
stripAnsi,
|
|
196
209
|
tokenLimit,
|
|
197
210
|
uiTelemetryService
|
|
198
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-RENFZ63F.js";
|
|
199
212
|
import {
|
|
200
213
|
ApprovalMode,
|
|
201
214
|
CoreEvent,
|
|
202
215
|
DiscoveredMCPTool,
|
|
203
216
|
GEMINI_DIR,
|
|
217
|
+
PolicyDecision,
|
|
204
218
|
REFERENCE_CONTENT_END,
|
|
205
219
|
REFERENCE_CONTENT_START,
|
|
206
220
|
Storage,
|
|
@@ -221,7 +235,7 @@ import {
|
|
|
221
235
|
shortenPath,
|
|
222
236
|
tildeifyPath,
|
|
223
237
|
unescapePath
|
|
224
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-F73F75XM.js";
|
|
225
239
|
import {
|
|
226
240
|
require_src
|
|
227
241
|
} from "./chunk-RJTRUG2J.js";
|
|
@@ -35165,13 +35179,7 @@ function* emitKeys(keypressHandler) {
|
|
|
35165
35179
|
} else if (ch === " ") {
|
|
35166
35180
|
name = "tab";
|
|
35167
35181
|
alt = escaped;
|
|
35168
|
-
} else if (ch === "\b") {
|
|
35169
|
-
name = "backspace";
|
|
35170
|
-
if (typeof process !== "undefined" && (process.env?.["OS"] === "Windows_NT" || !!process.env?.["WT_SESSION"])) {
|
|
35171
|
-
ctrl = true;
|
|
35172
|
-
}
|
|
35173
|
-
alt = escaped;
|
|
35174
|
-
} else if (ch === "\x7F") {
|
|
35182
|
+
} else if (ch === "\b" || ch === "\x7F") {
|
|
35175
35183
|
name = "backspace";
|
|
35176
35184
|
alt = escaped;
|
|
35177
35185
|
} else if (ch === ESC3) {
|
|
@@ -39430,7 +39438,7 @@ var import_react34 = __toESM(require_react(), 1);
|
|
|
39430
39438
|
function useIdeTrustListener() {
|
|
39431
39439
|
const settings = useSettings();
|
|
39432
39440
|
const [connectionStatus, setConnectionStatus] = (0, import_react34.useState)(
|
|
39433
|
-
|
|
39441
|
+
IDEConnectionStatus.Disconnected
|
|
39434
39442
|
);
|
|
39435
39443
|
const previousTrust = (0, import_react34.useRef)(void 0);
|
|
39436
39444
|
const [restartReason, setRestartReason] = (0, import_react34.useState)("NONE");
|
|
@@ -39460,7 +39468,7 @@ function useIdeTrustListener() {
|
|
|
39460
39468
|
};
|
|
39461
39469
|
}, []);
|
|
39462
39470
|
const getSnapshot = () => {
|
|
39463
|
-
if (connectionStatus !==
|
|
39471
|
+
if (connectionStatus !== IDEConnectionStatus.Connected) {
|
|
39464
39472
|
return void 0;
|
|
39465
39473
|
}
|
|
39466
39474
|
return ideContextStore.get()?.workspaceState?.isTrusted;
|
|
@@ -39846,7 +39854,7 @@ async function initializeApp(config, settings) {
|
|
|
39846
39854
|
await ideClient.connect();
|
|
39847
39855
|
logIdeConnection(
|
|
39848
39856
|
config,
|
|
39849
|
-
new IdeConnectionEvent(
|
|
39857
|
+
new IdeConnectionEvent(IdeConnectionType.START)
|
|
39850
39858
|
);
|
|
39851
39859
|
}).catch((e) => {
|
|
39852
39860
|
debugLogger.error("Failed to initialize IDE client:", e);
|
|
@@ -39864,16 +39872,16 @@ async function initializeApp(config, settings) {
|
|
|
39864
39872
|
// packages/cli/src/config/auth.ts
|
|
39865
39873
|
function validateAuthMethod(authMethod) {
|
|
39866
39874
|
loadEnvironment(loadSettings().merged, process.cwd());
|
|
39867
|
-
if (authMethod ===
|
|
39875
|
+
if (authMethod === AuthType.LOGIN_WITH_GOOGLE || authMethod === AuthType.COMPUTE_ADC) {
|
|
39868
39876
|
return null;
|
|
39869
39877
|
}
|
|
39870
|
-
if (authMethod ===
|
|
39878
|
+
if (authMethod === AuthType.USE_GEMINI) {
|
|
39871
39879
|
if (!process.env["GEMINI_API_KEY"]) {
|
|
39872
39880
|
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)!";
|
|
39873
39881
|
}
|
|
39874
39882
|
return null;
|
|
39875
39883
|
}
|
|
39876
|
-
if (authMethod ===
|
|
39884
|
+
if (authMethod === AuthType.USE_VERTEX_AI) {
|
|
39877
39885
|
const hasVertexProjectLocationConfig = !!process.env["GOOGLE_CLOUD_PROJECT"] && !!process.env["GOOGLE_CLOUD_LOCATION"];
|
|
39878
39886
|
const hasGoogleApiKey = !!process.env["GOOGLE_API_KEY"];
|
|
39879
39887
|
if (!hasVertexProjectLocationConfig && !hasGoogleApiKey) {
|
|
@@ -44604,7 +44612,7 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
44604
44612
|
const trustedFolders = loadTrustedFolders();
|
|
44605
44613
|
await trustedFolders.setValue(
|
|
44606
44614
|
this.workspaceDir,
|
|
44607
|
-
|
|
44615
|
+
TrustLevel.TRUST_FOLDER
|
|
44608
44616
|
);
|
|
44609
44617
|
} else {
|
|
44610
44618
|
throw new Error(
|
|
@@ -44790,7 +44798,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44790
44798
|
newExtensionConfig.version,
|
|
44791
44799
|
previousExtensionConfig.version,
|
|
44792
44800
|
installMetadata.type,
|
|
44793
|
-
|
|
44801
|
+
CoreToolCallStatus.Success
|
|
44794
44802
|
)
|
|
44795
44803
|
);
|
|
44796
44804
|
if (newExtensionName !== previousName) {
|
|
@@ -44813,7 +44821,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44813
44821
|
getExtensionId(newExtensionConfig, installMetadata),
|
|
44814
44822
|
newExtensionConfig.version,
|
|
44815
44823
|
installMetadata.type,
|
|
44816
|
-
|
|
44824
|
+
CoreToolCallStatus.Success
|
|
44817
44825
|
)
|
|
44818
44826
|
);
|
|
44819
44827
|
await this.enableExtension(
|
|
@@ -44846,7 +44854,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44846
44854
|
newExtensionConfig?.version ?? "",
|
|
44847
44855
|
previousExtensionConfig.version,
|
|
44848
44856
|
installMetadata.type,
|
|
44849
|
-
|
|
44857
|
+
CoreToolCallStatus.Error
|
|
44850
44858
|
)
|
|
44851
44859
|
);
|
|
44852
44860
|
} else {
|
|
@@ -44858,7 +44866,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44858
44866
|
extensionId ?? "",
|
|
44859
44867
|
newExtensionConfig?.version ?? "",
|
|
44860
44868
|
installMetadata.type,
|
|
44861
|
-
|
|
44869
|
+
CoreToolCallStatus.Error
|
|
44862
44870
|
)
|
|
44863
44871
|
);
|
|
44864
44872
|
}
|
|
@@ -44889,7 +44897,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44889
44897
|
extension.name,
|
|
44890
44898
|
hashValue(extension.name),
|
|
44891
44899
|
extension.id,
|
|
44892
|
-
|
|
44900
|
+
CoreToolCallStatus.Success
|
|
44893
44901
|
)
|
|
44894
44902
|
);
|
|
44895
44903
|
}
|
|
@@ -45159,7 +45167,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45159
45167
|
if (eventHooks) {
|
|
45160
45168
|
for (const definition of eventHooks) {
|
|
45161
45169
|
for (const hook of definition.hooks) {
|
|
45162
|
-
if (hook.type ===
|
|
45170
|
+
if (hook.type === HookType.Command) {
|
|
45163
45171
|
hook.env = { ...hook.env, ...hookEnv };
|
|
45164
45172
|
}
|
|
45165
45173
|
}
|
|
@@ -45773,6 +45781,165 @@ var McpServerEnablementManager = class _McpServerEnablementManager {
|
|
|
45773
45781
|
}
|
|
45774
45782
|
};
|
|
45775
45783
|
|
|
45784
|
+
// packages/cli/src/utils/settingsUtils.ts
|
|
45785
|
+
function flattenSchema(schema, prefix = "") {
|
|
45786
|
+
let result = {};
|
|
45787
|
+
for (const key in schema) {
|
|
45788
|
+
const newKey = prefix ? `${prefix}.${key}` : key;
|
|
45789
|
+
const definition = schema[key];
|
|
45790
|
+
result[newKey] = { ...definition, key: newKey };
|
|
45791
|
+
if (definition.properties) {
|
|
45792
|
+
result = { ...result, ...flattenSchema(definition.properties, newKey) };
|
|
45793
|
+
}
|
|
45794
|
+
}
|
|
45795
|
+
return result;
|
|
45796
|
+
}
|
|
45797
|
+
var _FLATTENED_SCHEMA;
|
|
45798
|
+
function getFlattenedSchema() {
|
|
45799
|
+
return _FLATTENED_SCHEMA ?? (_FLATTENED_SCHEMA = flattenSchema(getSettingsSchema()));
|
|
45800
|
+
}
|
|
45801
|
+
function getSettingDefinition(key) {
|
|
45802
|
+
return getFlattenedSchema()[key];
|
|
45803
|
+
}
|
|
45804
|
+
function getDefaultValue(key) {
|
|
45805
|
+
return getFlattenedSchema()[key]?.default;
|
|
45806
|
+
}
|
|
45807
|
+
function getDialogRestartRequiredSettings() {
|
|
45808
|
+
return Object.values(getFlattenedSchema()).filter(
|
|
45809
|
+
(definition) => definition.requiresRestart && definition.showInDialog !== false
|
|
45810
|
+
).map((definition) => definition.key);
|
|
45811
|
+
}
|
|
45812
|
+
function isRecord(value) {
|
|
45813
|
+
return typeof value === "object" && value !== null;
|
|
45814
|
+
}
|
|
45815
|
+
function isSettingsValue(value) {
|
|
45816
|
+
if (value === void 0) return true;
|
|
45817
|
+
if (value === null) return false;
|
|
45818
|
+
const type = typeof value;
|
|
45819
|
+
return type === "string" || type === "number" || type === "boolean" || type === "object";
|
|
45820
|
+
}
|
|
45821
|
+
function getNestedValue(obj, path37) {
|
|
45822
|
+
let current = obj;
|
|
45823
|
+
for (const key of path37) {
|
|
45824
|
+
if (!isRecord(current) || !(key in current)) {
|
|
45825
|
+
return void 0;
|
|
45826
|
+
}
|
|
45827
|
+
current = current[key];
|
|
45828
|
+
}
|
|
45829
|
+
return current;
|
|
45830
|
+
}
|
|
45831
|
+
function getEffectiveValue(key, settings) {
|
|
45832
|
+
const definition = getSettingDefinition(key);
|
|
45833
|
+
if (!definition) {
|
|
45834
|
+
return void 0;
|
|
45835
|
+
}
|
|
45836
|
+
const path37 = key.split(".");
|
|
45837
|
+
const value = getNestedValue(settings, path37);
|
|
45838
|
+
if (value !== void 0 && isSettingsValue(value)) {
|
|
45839
|
+
return value;
|
|
45840
|
+
}
|
|
45841
|
+
return definition.default;
|
|
45842
|
+
}
|
|
45843
|
+
function getDialogSettingKeys() {
|
|
45844
|
+
return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
|
|
45845
|
+
}
|
|
45846
|
+
function isInSettingsScope(key, scopeSettings) {
|
|
45847
|
+
const path37 = key.split(".");
|
|
45848
|
+
const value = getNestedValue(scopeSettings, path37);
|
|
45849
|
+
return value !== void 0;
|
|
45850
|
+
}
|
|
45851
|
+
function getDisplayValue(key, scopeSettings, _mergedSettings) {
|
|
45852
|
+
const definition = getSettingDefinition(key);
|
|
45853
|
+
const existsInScope = isInSettingsScope(key, scopeSettings);
|
|
45854
|
+
let value;
|
|
45855
|
+
if (existsInScope) {
|
|
45856
|
+
value = getEffectiveValue(key, scopeSettings);
|
|
45857
|
+
} else {
|
|
45858
|
+
value = getDefaultValue(key);
|
|
45859
|
+
}
|
|
45860
|
+
let valueString = String(value);
|
|
45861
|
+
if (definition?.type === "object" && value !== null && typeof value === "object") {
|
|
45862
|
+
valueString = JSON.stringify(value);
|
|
45863
|
+
} else if (definition?.type === "enum" && definition.options) {
|
|
45864
|
+
const option = definition.options?.find((option2) => option2.value === value);
|
|
45865
|
+
valueString = option?.label ?? `${value}`;
|
|
45866
|
+
}
|
|
45867
|
+
if (definition?.unit === "%" && typeof value === "number") {
|
|
45868
|
+
valueString = `${value} (${Math.round(value * 100)}%)`;
|
|
45869
|
+
} else if (definition?.unit) {
|
|
45870
|
+
valueString = `${valueString}${definition.unit}`;
|
|
45871
|
+
}
|
|
45872
|
+
if (existsInScope) {
|
|
45873
|
+
return `${valueString}*`;
|
|
45874
|
+
}
|
|
45875
|
+
return valueString;
|
|
45876
|
+
}
|
|
45877
|
+
function tryParseJsonStringArray(input) {
|
|
45878
|
+
try {
|
|
45879
|
+
const parsed = JSON.parse(input);
|
|
45880
|
+
if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
|
|
45881
|
+
return parsed;
|
|
45882
|
+
}
|
|
45883
|
+
return null;
|
|
45884
|
+
} catch {
|
|
45885
|
+
return null;
|
|
45886
|
+
}
|
|
45887
|
+
}
|
|
45888
|
+
function tryParseJsonObject(input) {
|
|
45889
|
+
try {
|
|
45890
|
+
const parsed = JSON.parse(input);
|
|
45891
|
+
if (isRecord(parsed) && !Array.isArray(parsed)) {
|
|
45892
|
+
return parsed;
|
|
45893
|
+
}
|
|
45894
|
+
return null;
|
|
45895
|
+
} catch {
|
|
45896
|
+
return null;
|
|
45897
|
+
}
|
|
45898
|
+
}
|
|
45899
|
+
function parseStringArrayValue(input) {
|
|
45900
|
+
const trimmed = input.trim();
|
|
45901
|
+
if (trimmed === "") return [];
|
|
45902
|
+
return tryParseJsonStringArray(trimmed) ?? input.split(",").map((p2) => p2.trim()).filter((p2) => p2.length > 0);
|
|
45903
|
+
}
|
|
45904
|
+
function parseObjectValue(input) {
|
|
45905
|
+
const trimmed = input.trim();
|
|
45906
|
+
if (trimmed === "") {
|
|
45907
|
+
return null;
|
|
45908
|
+
}
|
|
45909
|
+
return tryParseJsonObject(trimmed);
|
|
45910
|
+
}
|
|
45911
|
+
function parseEditedValue(type, newValue) {
|
|
45912
|
+
if (type === "number") {
|
|
45913
|
+
if (newValue.trim() === "") {
|
|
45914
|
+
return null;
|
|
45915
|
+
}
|
|
45916
|
+
const numParsed = Number(newValue.trim());
|
|
45917
|
+
if (Number.isNaN(numParsed)) {
|
|
45918
|
+
return null;
|
|
45919
|
+
}
|
|
45920
|
+
return numParsed;
|
|
45921
|
+
}
|
|
45922
|
+
if (type === "array") {
|
|
45923
|
+
return parseStringArrayValue(newValue);
|
|
45924
|
+
}
|
|
45925
|
+
if (type === "object") {
|
|
45926
|
+
return parseObjectValue(newValue);
|
|
45927
|
+
}
|
|
45928
|
+
return newValue;
|
|
45929
|
+
}
|
|
45930
|
+
function getEditValue(type, rawValue) {
|
|
45931
|
+
if (rawValue === void 0) {
|
|
45932
|
+
return void 0;
|
|
45933
|
+
}
|
|
45934
|
+
if (type === "array" && Array.isArray(rawValue)) {
|
|
45935
|
+
return rawValue.join(", ");
|
|
45936
|
+
}
|
|
45937
|
+
if (type === "object" && rawValue !== null && typeof rawValue === "object") {
|
|
45938
|
+
return JSON.stringify(rawValue);
|
|
45939
|
+
}
|
|
45940
|
+
return void 0;
|
|
45941
|
+
}
|
|
45942
|
+
|
|
45776
45943
|
// packages/cli/src/ui/hooks/atCommandProcessor.ts
|
|
45777
45944
|
import * as fs19 from "node:fs/promises";
|
|
45778
45945
|
import * as path13 from "node:path";
|
|
@@ -46032,7 +46199,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
46032
46199
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
46033
46200
|
name: `resources/read (${resource.serverName})`,
|
|
46034
46201
|
description: resource.uri,
|
|
46035
|
-
status:
|
|
46202
|
+
status: CoreToolCallStatus.Success,
|
|
46036
46203
|
isClientInitiated: true,
|
|
46037
46204
|
resultDisplay: `Successfully read resource ${resource.uri}`,
|
|
46038
46205
|
confirmationDetails: void 0
|
|
@@ -46047,7 +46214,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
46047
46214
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
46048
46215
|
name: `resources/read (${resource.serverName})`,
|
|
46049
46216
|
description: resource.uri,
|
|
46050
|
-
status:
|
|
46217
|
+
status: CoreToolCallStatus.Error,
|
|
46051
46218
|
isClientInitiated: true,
|
|
46052
46219
|
resultDisplay: `Error reading resource ${resource.uri}: ${getErrorMessage(error)}`,
|
|
46053
46220
|
confirmationDetails: void 0
|
|
@@ -46072,7 +46239,7 @@ Content from @${result.uri}:
|
|
|
46072
46239
|
}
|
|
46073
46240
|
if (hasError) {
|
|
46074
46241
|
const firstError = displays.find(
|
|
46075
|
-
(d) => d.status ===
|
|
46242
|
+
(d) => d.status === CoreToolCallStatus.Error
|
|
46076
46243
|
);
|
|
46077
46244
|
return {
|
|
46078
46245
|
parts: [],
|
|
@@ -46108,7 +46275,7 @@ async function readLocalFiles(resolvedFiles, config, signal, userMessageTimestam
|
|
|
46108
46275
|
callId: `client-read-${userMessageTimestamp}`,
|
|
46109
46276
|
name: readManyFilesTool.displayName,
|
|
46110
46277
|
description: invocation.getDescription(),
|
|
46111
|
-
status:
|
|
46278
|
+
status: CoreToolCallStatus.Success,
|
|
46112
46279
|
isClientInitiated: true,
|
|
46113
46280
|
resultDisplay: result.returnDisplay || `Successfully read: ${fileLabelsForDisplay.join(", ")}`,
|
|
46114
46281
|
confirmationDetails: void 0
|
|
@@ -46155,7 +46322,7 @@ Content from @${displayPath}:
|
|
|
46155
46322
|
callId: `client-read-${userMessageTimestamp}`,
|
|
46156
46323
|
name: readManyFilesTool.displayName,
|
|
46157
46324
|
description: invocation?.getDescription() ?? "Error attempting to execute tool to read files",
|
|
46158
|
-
status:
|
|
46325
|
+
status: CoreToolCallStatus.Error,
|
|
46159
46326
|
isClientInitiated: true,
|
|
46160
46327
|
resultDisplay: `Error reading files (${fileLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,
|
|
46161
46328
|
confirmationDetails: void 0
|
|
@@ -49384,7 +49551,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
49384
49551
|
if (wasRaw) {
|
|
49385
49552
|
setRawMode?.(true);
|
|
49386
49553
|
}
|
|
49387
|
-
coreEvents.emit(
|
|
49554
|
+
coreEvents.emit(CoreEvent.ExternalEditorClosed);
|
|
49388
49555
|
}
|
|
49389
49556
|
}
|
|
49390
49557
|
|
|
@@ -52064,7 +52231,7 @@ async function updateExtension(extension, extensionManager, currentState, dispat
|
|
|
52064
52231
|
extension.name,
|
|
52065
52232
|
installMetadata
|
|
52066
52233
|
);
|
|
52067
|
-
if (status ===
|
|
52234
|
+
if (status === IntegrityDataStatus.INVALID) {
|
|
52068
52235
|
throw new Error("Extension integrity cannot be verified");
|
|
52069
52236
|
}
|
|
52070
52237
|
} catch (e) {
|
|
@@ -54058,7 +54225,7 @@ var MultiFolderTrustDialog = ({
|
|
|
54058
54225
|
if (choice === 1 /* YES_AND_REMEMBER */) {
|
|
54059
54226
|
await trustedFolders.setValue(
|
|
54060
54227
|
expandedPath,
|
|
54061
|
-
|
|
54228
|
+
TrustLevel.TRUST_FOLDER
|
|
54062
54229
|
);
|
|
54063
54230
|
}
|
|
54064
54231
|
workspaceContext.addDirectory(expandedPath);
|
|
@@ -54837,7 +55004,7 @@ var authCommand = {
|
|
|
54837
55004
|
import process29 from "node:process";
|
|
54838
55005
|
|
|
54839
55006
|
// packages/cli/src/generated/git-commit.ts
|
|
54840
|
-
var GIT_COMMIT_INFO = "
|
|
55007
|
+
var GIT_COMMIT_INFO = "31bdf112d";
|
|
54841
55008
|
|
|
54842
55009
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
54843
55010
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -55351,7 +55518,7 @@ var clearCommand = {
|
|
|
55351
55518
|
const config = context.services.agentContext?.config;
|
|
55352
55519
|
const hookSystem = config?.getHookSystem();
|
|
55353
55520
|
if (hookSystem) {
|
|
55354
|
-
await hookSystem.fireSessionEndEvent(
|
|
55521
|
+
await hookSystem.fireSessionEndEvent(SessionEndReason.Clear);
|
|
55355
55522
|
}
|
|
55356
55523
|
config?.injectionService.clear();
|
|
55357
55524
|
let newSessionId;
|
|
@@ -55368,7 +55535,7 @@ var clearCommand = {
|
|
|
55368
55535
|
}
|
|
55369
55536
|
let result;
|
|
55370
55537
|
if (hookSystem) {
|
|
55371
|
-
result = await hookSystem.fireSessionStartEvent(
|
|
55538
|
+
result = await hookSystem.fireSessionStartEvent(SessionStartSource.Clear);
|
|
55372
55539
|
}
|
|
55373
55540
|
await new Promise((resolve8) => setImmediate(resolve8));
|
|
55374
55541
|
if (config) {
|
|
@@ -58224,7 +58391,7 @@ var Footer = () => {
|
|
|
58224
58391
|
case "auth": {
|
|
58225
58392
|
if (!settings.merged.ui.showUserIdentity) break;
|
|
58226
58393
|
if (!authType) break;
|
|
58227
|
-
const displayStr = authType ===
|
|
58394
|
+
const displayStr = authType === AuthType.LOGIN_WITH_GOOGLE ? email ?? "google" : authType;
|
|
58228
58395
|
addCol(
|
|
58229
58396
|
id,
|
|
58230
58397
|
header,
|
|
@@ -59971,12 +60138,12 @@ import path27 from "node:path";
|
|
|
59971
60138
|
function getIdeStatusMessage(ideClient) {
|
|
59972
60139
|
const connection = ideClient.getConnectionStatus();
|
|
59973
60140
|
switch (connection.status) {
|
|
59974
|
-
case
|
|
60141
|
+
case IDEConnectionStatus.Connected:
|
|
59975
60142
|
return {
|
|
59976
60143
|
messageType: "info",
|
|
59977
60144
|
content: `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`
|
|
59978
60145
|
};
|
|
59979
|
-
case
|
|
60146
|
+
case IDEConnectionStatus.Connecting:
|
|
59980
60147
|
return {
|
|
59981
60148
|
messageType: "info",
|
|
59982
60149
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -60017,7 +60184,7 @@ ${infoMessage}`;
|
|
|
60017
60184
|
async function getIdeStatusMessageWithFiles(ideClient) {
|
|
60018
60185
|
const connection = ideClient.getConnectionStatus();
|
|
60019
60186
|
switch (connection.status) {
|
|
60020
|
-
case
|
|
60187
|
+
case IDEConnectionStatus.Connected: {
|
|
60021
60188
|
let content = `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`;
|
|
60022
60189
|
const context = ideContextStore.get();
|
|
60023
60190
|
const openFiles = context?.workspaceState?.openFiles;
|
|
@@ -60029,7 +60196,7 @@ async function getIdeStatusMessageWithFiles(ideClient) {
|
|
|
60029
60196
|
content
|
|
60030
60197
|
};
|
|
60031
60198
|
}
|
|
60032
|
-
case
|
|
60199
|
+
case IDEConnectionStatus.Connecting:
|
|
60033
60200
|
return {
|
|
60034
60201
|
messageType: "info",
|
|
60035
60202
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -60051,7 +60218,7 @@ async function setIdeModeAndSyncConnection(config, value, options = {}) {
|
|
|
60051
60218
|
const ideClient = await IdeClient.getInstance();
|
|
60052
60219
|
if (value) {
|
|
60053
60220
|
await ideClient.connect(options);
|
|
60054
|
-
logIdeConnection(config, new IdeConnectionEvent(
|
|
60221
|
+
logIdeConnection(config, new IdeConnectionEvent(IdeConnectionType.SESSION));
|
|
60055
60222
|
} else {
|
|
60056
60223
|
await ideClient.disconnect();
|
|
60057
60224
|
}
|
|
@@ -60139,7 +60306,7 @@ var ideCommand = async () => {
|
|
|
60139
60306
|
logToConsole: false
|
|
60140
60307
|
}
|
|
60141
60308
|
);
|
|
60142
|
-
if (ideClient.getConnectionStatus().status ===
|
|
60309
|
+
if (ideClient.getConnectionStatus().status === IDEConnectionStatus.Connected) {
|
|
60143
60310
|
break;
|
|
60144
60311
|
}
|
|
60145
60312
|
await new Promise((resolve8) => setTimeout(resolve8, 500));
|
|
@@ -60216,7 +60383,7 @@ var ideCommand = async () => {
|
|
|
60216
60383
|
}
|
|
60217
60384
|
};
|
|
60218
60385
|
const { status } = ideClient.getConnectionStatus();
|
|
60219
|
-
const isConnected = status ===
|
|
60386
|
+
const isConnected = status === IDEConnectionStatus.Connected;
|
|
60220
60387
|
if (isConnected) {
|
|
60221
60388
|
ideSlashCommand.subCommands = [statusCommand2, disableCommand5];
|
|
60222
60389
|
} else {
|
|
@@ -60316,13 +60483,13 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
60316
60483
|
const displayListener = (message) => {
|
|
60317
60484
|
context.ui.addItem({ type: "info", text: message });
|
|
60318
60485
|
};
|
|
60319
|
-
coreEvents.on(
|
|
60486
|
+
coreEvents.on(CoreEvent.OauthDisplayMessage, displayListener);
|
|
60320
60487
|
try {
|
|
60321
60488
|
context.ui.addItem({
|
|
60322
60489
|
type: "info",
|
|
60323
60490
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
60324
60491
|
});
|
|
60325
|
-
const { MCPOAuthProvider } = await import("./
|
|
60492
|
+
const { MCPOAuthProvider } = await import("./dist-RIVCP5ZD.js");
|
|
60326
60493
|
let oauthConfig = server.oauth;
|
|
60327
60494
|
if (!oauthConfig) {
|
|
60328
60495
|
oauthConfig = { enabled: false };
|
|
@@ -60359,7 +60526,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
60359
60526
|
content: `Failed to authenticate with MCP server '${serverName}': ${getErrorMessage(error)}`
|
|
60360
60527
|
};
|
|
60361
60528
|
} finally {
|
|
60362
|
-
coreEvents.removeListener(
|
|
60529
|
+
coreEvents.removeListener(CoreEvent.OauthDisplayMessage, displayListener);
|
|
60363
60530
|
}
|
|
60364
60531
|
},
|
|
60365
60532
|
completion: async (context, partialArg) => {
|
|
@@ -60405,10 +60572,10 @@ var listAction3 = async (context, showDescriptions = false, showSchema = false,
|
|
|
60405
60572
|
}
|
|
60406
60573
|
const serverNames = Object.keys(mcpServers);
|
|
60407
60574
|
const connectingServers = serverNames.filter(
|
|
60408
|
-
(name) => getMCPServerStatus(name) ===
|
|
60575
|
+
(name) => getMCPServerStatus(name) === MCPServerStatus.CONNECTING
|
|
60409
60576
|
);
|
|
60410
60577
|
const discoveryState = getMCPDiscoveryState();
|
|
60411
|
-
const discoveryInProgress = discoveryState ===
|
|
60578
|
+
const discoveryInProgress = discoveryState === MCPDiscoveryState.IN_PROGRESS || connectingServers.length > 0;
|
|
60412
60579
|
const allTools = toolRegistry.getAllTools();
|
|
60413
60580
|
const mcpTools = allTools.filter((tool) => tool instanceof DiscoveredMCPTool);
|
|
60414
60581
|
const promptRegistry = config.getPromptRegistry();
|
|
@@ -75812,7 +75979,7 @@ Return a JSON object with:
|
|
|
75812
75979
|
},
|
|
75813
75980
|
abortSignal: new AbortController().signal,
|
|
75814
75981
|
promptId: "triage-duplicates",
|
|
75815
|
-
role:
|
|
75982
|
+
role: LlmRole.UTILITY_TOOL
|
|
75816
75983
|
});
|
|
75817
75984
|
const rec = response;
|
|
75818
75985
|
let canonical;
|
|
@@ -76646,7 +76813,7 @@ Return a JSON object with:
|
|
|
76646
76813
|
},
|
|
76647
76814
|
abortSignal: abortControllerRef.current.signal,
|
|
76648
76815
|
promptId: "triage-issues",
|
|
76649
|
-
role:
|
|
76816
|
+
role: LlmRole.UTILITY_TOOL
|
|
76650
76817
|
});
|
|
76651
76818
|
return response;
|
|
76652
76819
|
},
|
|
@@ -77220,8 +77387,8 @@ var planCommand = {
|
|
|
77220
77387
|
return;
|
|
77221
77388
|
}
|
|
77222
77389
|
const previousApprovalMode = config.getApprovalMode();
|
|
77223
|
-
config.setApprovalMode(
|
|
77224
|
-
if (previousApprovalMode !==
|
|
77390
|
+
config.setApprovalMode(ApprovalMode.PLAN);
|
|
77391
|
+
if (previousApprovalMode !== ApprovalMode.PLAN) {
|
|
77225
77392
|
coreEvents.emitFeedback("info", "Switched to Plan Mode.");
|
|
77226
77393
|
}
|
|
77227
77394
|
if (context.invocation?.args) {
|
|
@@ -77280,10 +77447,10 @@ var categorizeRulesByMode = (rules) => {
|
|
|
77280
77447
|
rules.forEach((rule) => {
|
|
77281
77448
|
const modes = rule.modes?.length ? rule.modes : ALL_MODES;
|
|
77282
77449
|
const modeSet = new Set(modes);
|
|
77283
|
-
if (modeSet.has(
|
|
77284
|
-
if (modeSet.has(
|
|
77285
|
-
if (modeSet.has(
|
|
77286
|
-
if (modeSet.has(
|
|
77450
|
+
if (modeSet.has(ApprovalMode.DEFAULT)) result.normal.push(rule);
|
|
77451
|
+
if (modeSet.has(ApprovalMode.AUTO_EDIT)) result.autoEdit.push(rule);
|
|
77452
|
+
if (modeSet.has(ApprovalMode.YOLO)) result.yolo.push(rule);
|
|
77453
|
+
if (modeSet.has(ApprovalMode.PLAN)) result.plan.push(rule);
|
|
77287
77454
|
});
|
|
77288
77455
|
return result;
|
|
77289
77456
|
};
|
|
@@ -78632,7 +78799,7 @@ var upgradeCommand = {
|
|
|
78632
78799
|
action: async (context) => {
|
|
78633
78800
|
const config = context.services.agentContext?.config;
|
|
78634
78801
|
const authType = config?.getContentGeneratorConfig()?.authType;
|
|
78635
|
-
if (authType !==
|
|
78802
|
+
if (authType !== AuthType.LOGIN_WITH_GOOGLE) {
|
|
78636
78803
|
return {
|
|
78637
78804
|
type: "message",
|
|
78638
78805
|
messageType: "error",
|
|
@@ -78834,7 +79001,7 @@ var BuiltinCommandLoader = class {
|
|
|
78834
79001
|
vimCommand,
|
|
78835
79002
|
setupGithubCommand,
|
|
78836
79003
|
terminalSetupCommand,
|
|
78837
|
-
...this.config?.getContentGeneratorConfig()?.authType ===
|
|
79004
|
+
...this.config?.getContentGeneratorConfig()?.authType === AuthType.LOGIN_WITH_GOOGLE ? [upgradeCommand] : []
|
|
78838
79005
|
];
|
|
78839
79006
|
handle?.end();
|
|
78840
79007
|
return allDefinitions.filter((cmd) => cmd !== null);
|
|
@@ -78977,11 +79144,11 @@ var ShellProcessor = class {
|
|
|
78977
79144
|
},
|
|
78978
79145
|
void 0
|
|
78979
79146
|
);
|
|
78980
|
-
if (decision ===
|
|
79147
|
+
if (decision === PolicyDecision.DENY) {
|
|
78981
79148
|
throw new Error(
|
|
78982
79149
|
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
78983
79150
|
);
|
|
78984
|
-
} else if (decision ===
|
|
79151
|
+
} else if (decision === PolicyDecision.ASK_USER) {
|
|
78985
79152
|
commandsToConfirm.add(command);
|
|
78986
79153
|
}
|
|
78987
79154
|
}
|
|
@@ -79606,6 +79773,16 @@ export {
|
|
|
79606
79773
|
linkSkill,
|
|
79607
79774
|
uninstallSkill,
|
|
79608
79775
|
statusCommand,
|
|
79776
|
+
getSettingDefinition,
|
|
79777
|
+
getDialogRestartRequiredSettings,
|
|
79778
|
+
isRecord,
|
|
79779
|
+
getNestedValue,
|
|
79780
|
+
getEffectiveValue,
|
|
79781
|
+
getDialogSettingKeys,
|
|
79782
|
+
isInSettingsScope,
|
|
79783
|
+
getDisplayValue,
|
|
79784
|
+
parseEditedValue,
|
|
79785
|
+
getEditValue,
|
|
79609
79786
|
ConsolePatcher,
|
|
79610
79787
|
clipboardy_default,
|
|
79611
79788
|
escapeAtSymbols,
|
|
@@ -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-VQ7N6NVX.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_PORT,
|
|
8
8
|
SERVER_START_WAIT_MS,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
isServerRunning,
|
|
15
15
|
resolveGemmaConfig,
|
|
16
16
|
writeServerProcessInfo
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-M76FWZ5L.js";
|
|
18
18
|
import {
|
|
19
19
|
debugLogger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-UHHRGNIO.js";
|
|
21
21
|
import {
|
|
22
22
|
__toESM
|
|
23
23
|
} from "./chunk-34MYV7JD.js";
|