@google/gemini-cli 0.64.0-preview.0 → 0.65.0-nightly.20261007.gef59c532f
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-EDVFNWRG.js → chunk-2QX7AFU2.js} +1 -1
- package/bundle/{chunk-EDYPRCAA.js → chunk-354KMHUX.js} +2 -2
- package/bundle/{chunk-UFQDAROY.js → chunk-3F7OA7UU.js} +1 -1
- package/bundle/{chunk-HN74ORTP.js → chunk-46A63GIT.js} +27 -4
- package/bundle/{chunk-ZQW7OGUO.js → chunk-6FH32SR7.js} +184 -45
- package/bundle/{chunk-SDWOC67Z.js → chunk-7NUXN3UV.js} +1 -1
- package/bundle/{chunk-Y2HXXBXI.js → chunk-ASQYH7O3.js} +1 -1
- package/bundle/{chunk-EBP6K2WG.js → chunk-BT4BJCGX.js} +32 -16
- package/bundle/{chunk-UBGF6JU5.js → chunk-CIKQQ32X.js} +1 -1
- package/bundle/chunk-DIMRHS5O.js +154 -0
- package/bundle/{chunk-NX7TO2DU.js → chunk-EIHDEZQ3.js} +1 -1
- package/bundle/{chunk-QUCRASYB.js → chunk-FE5UXCSL.js} +1 -1
- package/bundle/{chunk-EFX5XL6M.js → chunk-FTB4FVEK.js} +2 -2
- package/bundle/{chunk-A4TO2DY2.js → chunk-HYF74TEA.js} +8018 -14883
- package/bundle/{chunk-6OFXOGEG.js → chunk-JYWQ73Z5.js} +193 -47
- package/bundle/{chunk-HSZIYPL6.js → chunk-KHG7NKQK.js} +3 -3
- package/bundle/chunk-KTOZF7BG.js +401335 -0
- package/bundle/{chunk-2NQXIWQK.js → chunk-KV6RPWUP.js} +27 -4
- package/bundle/{chunk-KCCVXZ52.js → chunk-LNFN3PQL.js} +32 -16
- package/bundle/{chunk-MLSLNORV.js → chunk-LS355CSQ.js} +3 -3
- package/bundle/{chunk-2VN53SWW.js → chunk-NDVLWD4V.js} +9 -8
- package/bundle/{chunk-ZOHM7BPT.js → chunk-NUWDVBI7.js} +1 -1
- package/bundle/{chunk-VJYKQD5D.js → chunk-PYD373NJ.js} +3 -3
- package/bundle/{chunk-VBVCLWLA.js → chunk-QTGBWTWR.js} +2 -2
- package/bundle/chunk-U6ZQ2RUE.js +1571 -0
- package/bundle/chunk-UV4NDIKL.js +118 -0
- package/bundle/{chunk-U76XPSKR.js → chunk-VAONEIPY.js} +96 -67
- package/bundle/chunk-WGJZZTZY.js +425 -0
- package/bundle/{chunk-ZPLFLZQA.js → chunk-WXXOP3OP.js} +33 -8
- package/bundle/chunk-XOG2HJ3Y.js +17530 -0
- package/bundle/chunk-YSKY65XX.js +512 -0
- package/bundle/chunk-ZTPICUAP.js +103137 -0
- package/bundle/{cleanup-GGCB2LVD.js → cleanup-3V27AYOD.js} +2 -2
- package/bundle/{cleanup-JRDG3OTL.js → cleanup-4G3NPQT4.js} +2 -2
- package/bundle/{cleanup-SSW6IXTR.js → cleanup-5XQCOW5U.js} +2 -2
- package/bundle/cleanup-BBUUFPW4.js +32 -0
- package/bundle/{core-IUIZE6JW.js → core-AAGHH24E.js} +1 -1
- package/bundle/{devtoolsService-XZCKFZP5.js → devtoolsService-EVGTOLCK.js} +2 -2
- package/bundle/{devtoolsService-3SADPKKB.js → devtoolsService-J7VIMPHG.js} +2 -2
- package/bundle/{devtoolsService-MF6JKRUV.js → devtoolsService-PZBHHYCE.js} +4 -3
- package/bundle/devtoolsService-Z4ND55GM.js +4359 -0
- package/bundle/{dist-7L3BRW6V.js → dist-6PBUOORE.js} +1 -1
- package/bundle/{core-6HRWFQZW.js → dist-Q7B3BSZW.js} +1 -1
- package/bundle/dist-Z23CJKTC.js +2252 -0
- package/bundle/docs/changelogs/index.md +14 -0
- package/bundle/docs/changelogs/latest.md +55 -34
- package/bundle/docs/changelogs/preview.md +59 -54
- package/bundle/docs/tools/mcp-server.md +41 -12
- package/bundle/{gemini-JPMMQ3KA.js → gemini-2ZS4H5D5.js} +41 -21
- package/bundle/{gemini-QOQNG5VY.js → gemini-NHT6XRJ6.js} +241 -205
- package/bundle/gemini-ORQLMSXW.js +17954 -0
- package/bundle/{gemini-ZMMDUAQJ.js → gemini-YDK3BHCP.js} +41 -21
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-R3P4A3FC.js → interactiveCli-22MUJI66.js} +23 -14
- package/bundle/{interactiveCli-UDWGRVJL.js → interactiveCli-2JNS4RJW.js} +23 -14
- package/bundle/{interactiveCli-3I4TG5SK.js → interactiveCli-EHUGFQPB.js} +327 -299
- package/bundle/interactiveCli-YANG53MI.js +34988 -0
- package/bundle/{liteRtServerManager-OVPUSK2T.js → liteRtServerManager-PGT3WQWS.js} +4 -4
- package/bundle/{liteRtServerManager-RAV63AGE.js → liteRtServerManager-TW45VSAX.js} +4 -4
- package/bundle/{liteRtServerManager-4MWCEVVM.js → liteRtServerManager-VCTOOEN4.js} +4 -4
- package/bundle/liteRtServerManager-Y2QFKZ5W.js +65 -0
- package/bundle/{oauth2-provider-XFP63FGJ.js → oauth2-provider-4AK74O2H.js} +1 -1
- package/bundle/{oauth2-provider-FVTRRJZR.js → oauth2-provider-IUYZ2A7H.js} +1 -1
- package/bundle/{oauth2-provider-EWOA64PR.js → oauth2-provider-JCJGEWMM.js} +38 -72
- package/bundle/oauth2-provider-QTTPZS6I.js +235 -0
- package/bundle/{start-DJAIXPPY.js → start-4O4IKUM4.js} +6 -6
- package/bundle/{start-VQQ2Q5KT.js → start-74BH6SEW.js} +6 -6
- package/bundle/{start-5O7TBK5L.js → start-EDAVUSEX.js} +6 -6
- package/bundle/start-Q6WRPG2O.js +18 -0
- package/package.json +1 -1
|
@@ -283844,8 +283844,8 @@ function isValidToolName(name3, options = {}) {
|
|
|
283844
283844
|
}
|
|
283845
283845
|
|
|
283846
283846
|
// packages/core/src/generated/git-commit.ts
|
|
283847
|
-
var GIT_COMMIT_INFO = "
|
|
283848
|
-
var CLI_VERSION = "0.
|
|
283847
|
+
var GIT_COMMIT_INFO = "ef59c532f";
|
|
283848
|
+
var CLI_VERSION = "0.65.0-nightly.20261006.gfb972b2f8";
|
|
283849
283849
|
|
|
283850
283850
|
// packages/core/src/ide/detect-ide.ts
|
|
283851
283851
|
var IDE_DEFINITIONS = {
|
|
@@ -286476,24 +286476,52 @@ function isIgnoredUserContent(trimmedContent) {
|
|
|
286476
286476
|
}
|
|
286477
286477
|
function convertSessionToClientHistory(messages) {
|
|
286478
286478
|
const clientHistory = [];
|
|
286479
|
-
|
|
286479
|
+
const seenFunctionResponseIds = /* @__PURE__ */ new Set();
|
|
286480
|
+
const pendingPartsToAppend = /* @__PURE__ */ new Map();
|
|
286481
|
+
for (let i3 = 0; i3 < messages.length; i3++) {
|
|
286482
|
+
const msg = messages[i3];
|
|
286480
286483
|
if (msg.type === "info" || msg.type === "error" || msg.type === "warning") {
|
|
286481
286484
|
continue;
|
|
286482
286485
|
}
|
|
286483
286486
|
if (msg.type === "user") {
|
|
286484
|
-
const
|
|
286485
|
-
|
|
286486
|
-
if (
|
|
286487
|
+
const extraParts = pendingPartsToAppend.get(msg.id) || [];
|
|
286488
|
+
pendingPartsToAppend.delete(msg.id);
|
|
286489
|
+
if (extraParts.length === 0) {
|
|
286490
|
+
if (!msg.content) {
|
|
286491
|
+
continue;
|
|
286492
|
+
}
|
|
286493
|
+
const contentString = partListUnionToString(msg.content);
|
|
286494
|
+
const trimmedContent = contentString.trim();
|
|
286495
|
+
if (isIgnoredUserContent(trimmedContent)) {
|
|
286496
|
+
continue;
|
|
286497
|
+
}
|
|
286498
|
+
}
|
|
286499
|
+
const parts2 = [
|
|
286500
|
+
...msg.content ? ensurePartArray(msg.content) : [],
|
|
286501
|
+
...extraParts
|
|
286502
|
+
].filter((part) => {
|
|
286503
|
+
const respId = part?.functionResponse?.id;
|
|
286504
|
+
if (!respId) {
|
|
286505
|
+
return true;
|
|
286506
|
+
}
|
|
286507
|
+
if (seenFunctionResponseIds.has(respId)) {
|
|
286508
|
+
return false;
|
|
286509
|
+
}
|
|
286510
|
+
seenFunctionResponseIds.add(respId);
|
|
286511
|
+
return true;
|
|
286512
|
+
});
|
|
286513
|
+
if (parts2.length === 0) {
|
|
286487
286514
|
continue;
|
|
286488
286515
|
}
|
|
286489
286516
|
clientHistory.push({
|
|
286490
286517
|
id: msg.id,
|
|
286491
286518
|
content: {
|
|
286492
286519
|
role: "user",
|
|
286493
|
-
parts:
|
|
286520
|
+
parts: parts2
|
|
286494
286521
|
}
|
|
286495
286522
|
});
|
|
286496
286523
|
} else if (msg.type === "gemini") {
|
|
286524
|
+
seenFunctionResponseIds.clear();
|
|
286497
286525
|
const modelParts = [];
|
|
286498
286526
|
const contentParts = msg.content ? ensurePartArray(msg.content) : [];
|
|
286499
286527
|
const hasCallsInContent = contentParts.some((p) => !!p.functionCall);
|
|
@@ -286532,9 +286560,31 @@ function convertSessionToClientHistory(messages) {
|
|
|
286532
286560
|
}
|
|
286533
286561
|
});
|
|
286534
286562
|
if (msg.toolCalls && msg.toolCalls.length > 0) {
|
|
286563
|
+
const recordedResponseIds = /* @__PURE__ */ new Set();
|
|
286564
|
+
let hasUntrackedFunctionResponse = false;
|
|
286565
|
+
let targetUserMsgId;
|
|
286566
|
+
for (let j = i3 + 1; j < messages.length; j++) {
|
|
286567
|
+
const nextMsg = messages[j];
|
|
286568
|
+
if (nextMsg.type === "gemini") {
|
|
286569
|
+
break;
|
|
286570
|
+
}
|
|
286571
|
+
if (nextMsg.type === "user" && nextMsg.content) {
|
|
286572
|
+
for (const part of ensurePartArray(nextMsg.content)) {
|
|
286573
|
+
if (part?.functionResponse) {
|
|
286574
|
+
targetUserMsgId ??= nextMsg.id;
|
|
286575
|
+
if (part.functionResponse.id) {
|
|
286576
|
+
recordedResponseIds.add(part.functionResponse.id);
|
|
286577
|
+
} else {
|
|
286578
|
+
hasUntrackedFunctionResponse = true;
|
|
286579
|
+
}
|
|
286580
|
+
}
|
|
286581
|
+
}
|
|
286582
|
+
}
|
|
286583
|
+
}
|
|
286535
286584
|
const functionResponseParts = [];
|
|
286536
286585
|
for (const toolCall of msg.toolCalls) {
|
|
286537
|
-
|
|
286586
|
+
const isAlreadyRecorded = toolCall.id ? recordedResponseIds.has(toolCall.id) : hasUntrackedFunctionResponse;
|
|
286587
|
+
if (toolCall.result && !isAlreadyRecorded) {
|
|
286538
286588
|
let responseData;
|
|
286539
286589
|
if (typeof toolCall.result === "string") {
|
|
286540
286590
|
responseData = {
|
|
@@ -286556,13 +286606,36 @@ function convertSessionToClientHistory(messages) {
|
|
|
286556
286606
|
}
|
|
286557
286607
|
}
|
|
286558
286608
|
if (functionResponseParts.length > 0) {
|
|
286559
|
-
|
|
286560
|
-
|
|
286561
|
-
|
|
286562
|
-
|
|
286563
|
-
|
|
286609
|
+
if (targetUserMsgId) {
|
|
286610
|
+
const existingPending = pendingPartsToAppend.get(targetUserMsgId) || [];
|
|
286611
|
+
pendingPartsToAppend.set(targetUserMsgId, [
|
|
286612
|
+
...existingPending,
|
|
286613
|
+
...functionResponseParts
|
|
286614
|
+
]);
|
|
286615
|
+
} else {
|
|
286616
|
+
const dedupedResponseParts = functionResponseParts.filter(
|
|
286617
|
+
(part) => {
|
|
286618
|
+
const respId = part?.functionResponse?.id;
|
|
286619
|
+
if (!respId) {
|
|
286620
|
+
return true;
|
|
286621
|
+
}
|
|
286622
|
+
if (seenFunctionResponseIds.has(respId)) {
|
|
286623
|
+
return false;
|
|
286624
|
+
}
|
|
286625
|
+
seenFunctionResponseIds.add(respId);
|
|
286626
|
+
return true;
|
|
286627
|
+
}
|
|
286628
|
+
);
|
|
286629
|
+
if (dedupedResponseParts.length > 0) {
|
|
286630
|
+
clientHistory.push({
|
|
286631
|
+
id: `${msg.id}_response`,
|
|
286632
|
+
content: {
|
|
286633
|
+
role: "user",
|
|
286634
|
+
parts: dedupedResponseParts
|
|
286635
|
+
}
|
|
286636
|
+
});
|
|
286564
286637
|
}
|
|
286565
|
-
}
|
|
286638
|
+
}
|
|
286566
286639
|
}
|
|
286567
286640
|
}
|
|
286568
286641
|
}
|
|
@@ -286682,7 +286755,7 @@ function isResumableMessageRecord(message) {
|
|
|
286682
286755
|
return false;
|
|
286683
286756
|
}
|
|
286684
286757
|
function hasResumableConversationContent(messages) {
|
|
286685
|
-
return messages
|
|
286758
|
+
return messages?.some((message) => isResumableMessageRecord(message)) ?? false;
|
|
286686
286759
|
}
|
|
286687
286760
|
function createJsonlRecordAccumulator(options) {
|
|
286688
286761
|
let metadata2 = {};
|
|
@@ -287024,6 +287097,8 @@ var ChatRecordingService = class {
|
|
|
287024
287097
|
queuedThoughts = [];
|
|
287025
287098
|
queuedTokens = null;
|
|
287026
287099
|
context;
|
|
287100
|
+
isResumedSession = false;
|
|
287101
|
+
initializationPromise = null;
|
|
287027
287102
|
messageOrder = [];
|
|
287028
287103
|
messageMetaMap = /* @__PURE__ */ new Map();
|
|
287029
287104
|
toolCallMetaMap = /* @__PURE__ */ new Map();
|
|
@@ -287035,7 +287110,18 @@ var ChatRecordingService = class {
|
|
|
287035
287110
|
this.sessionId = context2.promptId;
|
|
287036
287111
|
this.projectHash = getProjectHash(context2.config.getProjectRoot());
|
|
287037
287112
|
}
|
|
287113
|
+
getIsResumedSession() {
|
|
287114
|
+
return this.isResumedSession;
|
|
287115
|
+
}
|
|
287116
|
+
setIsResumedSession(isResumed) {
|
|
287117
|
+
this.isResumedSession = isResumed;
|
|
287118
|
+
}
|
|
287038
287119
|
async initialize(resumedSessionData, kind) {
|
|
287120
|
+
this.isResumedSession = Boolean(resumedSessionData);
|
|
287121
|
+
this.initializationPromise = this.doInitialize(resumedSessionData, kind);
|
|
287122
|
+
return this.initializationPromise;
|
|
287123
|
+
}
|
|
287124
|
+
async doInitialize(resumedSessionData, kind) {
|
|
287039
287125
|
try {
|
|
287040
287126
|
this.kind = kind;
|
|
287041
287127
|
if (resumedSessionData) {
|
|
@@ -287046,7 +287132,10 @@ var ChatRecordingService = class {
|
|
|
287046
287132
|
this.conversationFile
|
|
287047
287133
|
);
|
|
287048
287134
|
if (loadedRecord) {
|
|
287049
|
-
this.cachedConversation =
|
|
287135
|
+
this.cachedConversation = {
|
|
287136
|
+
...loadedRecord,
|
|
287137
|
+
messages: loadedRecord.messages ?? []
|
|
287138
|
+
};
|
|
287050
287139
|
this.projectHash = this.cachedConversation.projectHash;
|
|
287051
287140
|
if (this.conversationFile.endsWith(".json")) {
|
|
287052
287141
|
this.conversationFile = this.conversationFile + "l";
|
|
@@ -287125,20 +287214,41 @@ var ChatRecordingService = class {
|
|
|
287125
287214
|
const directories = this.kind === "subagent" ? [
|
|
287126
287215
|
...this.context.config.getWorkspaceContext()?.getDirectories() ?? []
|
|
287127
287216
|
] : void 0;
|
|
287128
|
-
|
|
287129
|
-
|
|
287130
|
-
|
|
287131
|
-
|
|
287132
|
-
|
|
287133
|
-
|
|
287134
|
-
|
|
287135
|
-
|
|
287136
|
-
|
|
287137
|
-
|
|
287138
|
-
|
|
287139
|
-
|
|
287140
|
-
|
|
287141
|
-
|
|
287217
|
+
let fileAlreadyExisted = false;
|
|
287218
|
+
if (fs32.existsSync(this.conversationFile)) {
|
|
287219
|
+
fileAlreadyExisted = true;
|
|
287220
|
+
const loadedRecord = await loadConversationRecord(
|
|
287221
|
+
this.conversationFile
|
|
287222
|
+
);
|
|
287223
|
+
if (loadedRecord) {
|
|
287224
|
+
this.cachedConversation = {
|
|
287225
|
+
...loadedRecord,
|
|
287226
|
+
messages: loadedRecord.messages ?? []
|
|
287227
|
+
};
|
|
287228
|
+
this.projectHash = this.cachedConversation.projectHash;
|
|
287229
|
+
if (loadedRecord.hasResumableContent || hasResumableConversationContent(this.cachedConversation.messages)) {
|
|
287230
|
+
this.isResumedSession = true;
|
|
287231
|
+
}
|
|
287232
|
+
}
|
|
287233
|
+
}
|
|
287234
|
+
if (!fileAlreadyExisted || !this.cachedConversation) {
|
|
287235
|
+
const initialMetadata = {
|
|
287236
|
+
sessionId: this.sessionId,
|
|
287237
|
+
projectHash: this.projectHash,
|
|
287238
|
+
startTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
287239
|
+
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
287240
|
+
kind: this.kind,
|
|
287241
|
+
directories
|
|
287242
|
+
};
|
|
287243
|
+
this.appendRecord(initialMetadata);
|
|
287244
|
+
this.cachedConversation = {
|
|
287245
|
+
...initialMetadata,
|
|
287246
|
+
messages: []
|
|
287247
|
+
};
|
|
287248
|
+
this.rebuildIndexAndWindow([]);
|
|
287249
|
+
} else {
|
|
287250
|
+
this.rebuildIndexAndWindow(this.cachedConversation.messages);
|
|
287251
|
+
}
|
|
287142
287252
|
}
|
|
287143
287253
|
this.queuedThoughts = [];
|
|
287144
287254
|
this.queuedTokens = null;
|
|
@@ -287182,14 +287292,15 @@ var ChatRecordingService = class {
|
|
|
287182
287292
|
this.hasEvictedMessages = msgs.length < this.messageOrder.length;
|
|
287183
287293
|
}
|
|
287184
287294
|
rebuildIndexAndWindow(messages) {
|
|
287295
|
+
const safeMessages = messages ?? [];
|
|
287185
287296
|
this.messageOrder = [];
|
|
287186
287297
|
this.messageMetaMap.clear();
|
|
287187
287298
|
this.toolCallMetaMap.clear();
|
|
287188
|
-
for (const msg of
|
|
287299
|
+
for (const msg of safeMessages) {
|
|
287189
287300
|
this.indexMessage(msg);
|
|
287190
287301
|
}
|
|
287191
287302
|
if (this.cachedConversation) {
|
|
287192
|
-
this.cachedConversation.messages =
|
|
287303
|
+
this.cachedConversation.messages = safeMessages.length > MAX_HISTORY_MESSAGES ? safeMessages.slice(-MAX_HISTORY_MESSAGES) : [...safeMessages];
|
|
287193
287304
|
this.hasEvictedMessages = this.cachedConversation.messages.length < this.messageOrder.length;
|
|
287194
287305
|
} else {
|
|
287195
287306
|
this.hasEvictedMessages = false;
|
|
@@ -287506,12 +287617,32 @@ var ChatRecordingService = class {
|
|
|
287506
287617
|
* session with a real user prompt, model response, or tool activity.
|
|
287507
287618
|
*/
|
|
287508
287619
|
async deleteCurrentSessionIfNotResumableAsync() {
|
|
287509
|
-
if (
|
|
287620
|
+
if (this.initializationPromise) {
|
|
287621
|
+
try {
|
|
287622
|
+
await this.initializationPromise;
|
|
287623
|
+
} catch {
|
|
287624
|
+
}
|
|
287625
|
+
}
|
|
287626
|
+
if (this.isResumedSession) {
|
|
287510
287627
|
return;
|
|
287511
287628
|
}
|
|
287512
|
-
if (
|
|
287629
|
+
if (!this.conversationFile) {
|
|
287513
287630
|
return;
|
|
287514
287631
|
}
|
|
287632
|
+
if (this.cachedConversation && hasResumableConversationContent(
|
|
287633
|
+
this.cachedConversation.messages ?? []
|
|
287634
|
+
) || Array.from(this.messageMetaMap.values()).some((m) => m.isResumable)) {
|
|
287635
|
+
return;
|
|
287636
|
+
}
|
|
287637
|
+
if (fs32.existsSync(this.conversationFile)) {
|
|
287638
|
+
try {
|
|
287639
|
+
const fileRecord = await loadConversationRecord(this.conversationFile);
|
|
287640
|
+
if (fileRecord && (fileRecord.hasResumableContent || hasResumableConversationContent(fileRecord.messages ?? []))) {
|
|
287641
|
+
return;
|
|
287642
|
+
}
|
|
287643
|
+
} catch {
|
|
287644
|
+
}
|
|
287645
|
+
}
|
|
287515
287646
|
await this.deleteCurrentSessionAsync();
|
|
287516
287647
|
}
|
|
287517
287648
|
/**
|
|
@@ -307961,7 +308092,7 @@ function getVersion() {
|
|
|
307961
308092
|
}
|
|
307962
308093
|
versionPromise = (async () => {
|
|
307963
308094
|
const pkgJson = await getPackageJson(__dirname4);
|
|
307964
|
-
return "0.
|
|
308095
|
+
return "0.65.0-nightly.20261006.gfb972b2f8";
|
|
307965
308096
|
})();
|
|
307966
308097
|
return versionPromise;
|
|
307967
308098
|
}
|
|
@@ -344038,7 +344169,13 @@ var OAuthUtils = class {
|
|
|
344038
344169
|
issuer: metadata2.issuer,
|
|
344039
344170
|
tokenUrl: metadata2.token_endpoint,
|
|
344040
344171
|
scopes: metadata2.scopes_supported || [],
|
|
344041
|
-
registrationUrl: metadata2.registration_endpoint
|
|
344172
|
+
registrationUrl: metadata2.registration_endpoint,
|
|
344173
|
+
// RFC 9207 Section 3: the flag defaults to false when omitted. Discovered
|
|
344174
|
+
// configurations therefore always carry an explicit boolean, which lets
|
|
344175
|
+
// the callback policy distinguish them from an explicitly configured issuer.
|
|
344176
|
+
// Only a literal boolean `true` enables the flag, so loosely typed values
|
|
344177
|
+
// returned by some servers (e.g. "false" or "0") are not coerced to true.
|
|
344178
|
+
authorizationResponseIssParameterSupported: metadata2.authorization_response_iss_parameter_supported === true
|
|
344042
344179
|
};
|
|
344043
344180
|
}
|
|
344044
344181
|
/**
|
|
@@ -344439,7 +344576,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
|
|
|
344439
344576
|
return provider;
|
|
344440
344577
|
}
|
|
344441
344578
|
case "oauth2": {
|
|
344442
|
-
const { OAuth2AuthProvider } = await import("./oauth2-provider-
|
|
344579
|
+
const { OAuth2AuthProvider } = await import("./oauth2-provider-4AK74O2H.js");
|
|
344443
344580
|
const provider = new OAuth2AuthProvider(
|
|
344444
344581
|
authConfig,
|
|
344445
344582
|
options.agentName ?? "unknown",
|
|
@@ -375428,7 +375565,7 @@ function areIssuersEqual(issuerA, issuerB) {
|
|
|
375428
375565
|
}
|
|
375429
375566
|
return normA === normB;
|
|
375430
375567
|
}
|
|
375431
|
-
function startCallbackServer(expectedState, port, expectedIssuer) {
|
|
375568
|
+
function startCallbackServer(expectedState, port, expectedIssuer, requireIssInResponse) {
|
|
375432
375569
|
let portResolve;
|
|
375433
375570
|
let portReject;
|
|
375434
375571
|
const portPromise = new Promise((resolve29, reject) => {
|
|
@@ -375488,9 +375625,10 @@ function startCallbackServer(expectedState, port, expectedIssuer) {
|
|
|
375488
375625
|
return;
|
|
375489
375626
|
}
|
|
375490
375627
|
if (expectedIssuer) {
|
|
375491
|
-
|
|
375628
|
+
const requireIss = requireIssInResponse ?? true;
|
|
375629
|
+
if (requireIss && !iss) {
|
|
375492
375630
|
debugLogger.error(
|
|
375493
|
-
'OAuth callback rejected: Missing required "iss" parameter
|
|
375631
|
+
'OAuth callback rejected: Missing required "iss" parameter for the expected authorization server (RFC 9207).'
|
|
375494
375632
|
);
|
|
375495
375633
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
375496
375634
|
res.end(`
|
|
@@ -375510,7 +375648,7 @@ function startCallbackServer(expectedState, port, expectedIssuer) {
|
|
|
375510
375648
|
);
|
|
375511
375649
|
return;
|
|
375512
375650
|
}
|
|
375513
|
-
if (!areIssuersEqual(iss, expectedIssuer)) {
|
|
375651
|
+
if (iss && !areIssuersEqual(iss, expectedIssuer)) {
|
|
375514
375652
|
debugLogger.error(
|
|
375515
375653
|
"OAuth callback rejected: Issuer mismatch between authorization response and expected authorization server. Possible IdP mix-up attack (RFC 9207)."
|
|
375516
375654
|
);
|
|
@@ -375532,9 +375670,11 @@ function startCallbackServer(expectedState, port, expectedIssuer) {
|
|
|
375532
375670
|
);
|
|
375533
375671
|
return;
|
|
375534
375672
|
}
|
|
375535
|
-
|
|
375536
|
-
|
|
375537
|
-
|
|
375673
|
+
if (iss) {
|
|
375674
|
+
debugLogger.debug(
|
|
375675
|
+
"\u2713 OAuth callback issuer validated successfully."
|
|
375676
|
+
);
|
|
375677
|
+
}
|
|
375538
375678
|
} else if (iss) {
|
|
375539
375679
|
debugLogger.debug(
|
|
375540
375680
|
'OAuth callback received "iss" parameter (no expected issuer was configured).'
|
|
@@ -375980,6 +376120,7 @@ var MCPOAuthProvider = class {
|
|
|
375980
376120
|
issuer: discoveredConfig.issuer,
|
|
375981
376121
|
tokenUrl: discoveredConfig.tokenUrl,
|
|
375982
376122
|
scopes: config2.scopes || discoveredConfig.scopes || [],
|
|
376123
|
+
authorizationResponseIssParameterSupported: config2.authorizationResponseIssParameterSupported ?? discoveredConfig.authorizationResponseIssParameterSupported,
|
|
375983
376124
|
// Preserve existing client credentials
|
|
375984
376125
|
clientId: config2.clientId,
|
|
375985
376126
|
clientSecret: config2.clientSecret
|
|
@@ -376005,6 +376146,7 @@ var MCPOAuthProvider = class {
|
|
|
376005
376146
|
issuer: discoveredConfig.issuer,
|
|
376006
376147
|
scopes: config2.scopes || discoveredConfig.scopes || [],
|
|
376007
376148
|
registrationUrl: discoveredConfig.registrationUrl,
|
|
376149
|
+
authorizationResponseIssParameterSupported: config2.authorizationResponseIssParameterSupported ?? discoveredConfig.authorizationResponseIssParameterSupported,
|
|
376008
376150
|
// Preserve existing client credentials
|
|
376009
376151
|
clientId: config2.clientId,
|
|
376010
376152
|
clientSecret: config2.clientSecret
|
|
@@ -376021,10 +376163,12 @@ var MCPOAuthProvider = class {
|
|
|
376021
376163
|
debugLogger.debug(
|
|
376022
376164
|
`Starting callback server for "${serverName}" (expected issuer: ${config2.issuer || "none"})...`
|
|
376023
376165
|
);
|
|
376166
|
+
const requireIssInResponse = config2.authorizationResponseIssParameterSupported ?? Boolean(config2.issuer);
|
|
376024
376167
|
const callbackServer = startCallbackServer(
|
|
376025
376168
|
pkceParams.state,
|
|
376026
376169
|
preferredPort,
|
|
376027
|
-
config2.issuer
|
|
376170
|
+
config2.issuer,
|
|
376171
|
+
requireIssInResponse
|
|
376028
376172
|
);
|
|
376029
376173
|
const redirectPort = await callbackServer.port;
|
|
376030
376174
|
debugLogger.debug(`Callback server listening on port ${redirectPort}`);
|
|
@@ -376980,7 +377124,8 @@ async function handleAutomaticOAuth(mcpServerName, mcpServerConfig, wwwAuthentic
|
|
|
376980
377124
|
authorizationUrl: oauthConfig.authorizationUrl,
|
|
376981
377125
|
issuer: oauthConfig.issuer,
|
|
376982
377126
|
tokenUrl: oauthConfig.tokenUrl,
|
|
376983
|
-
scopes: oauthConfig.scopes || []
|
|
377127
|
+
scopes: oauthConfig.scopes || [],
|
|
377128
|
+
authorizationResponseIssParameterSupported: mcpServerConfig.oauth?.authorizationResponseIssParameterSupported ?? oauthConfig.authorizationResponseIssParameterSupported
|
|
376984
377129
|
};
|
|
376985
377130
|
debugLogger.log(
|
|
376986
377131
|
`Starting OAuth authentication for server '${mcpServerName}'...`
|
|
@@ -377714,7 +377859,8 @@ async function connectToMcpServer(clientVersion, mcpServerName, mcpServerConfig,
|
|
|
377714
377859
|
authorizationUrl: oauthConfig.authorizationUrl,
|
|
377715
377860
|
issuer: oauthConfig.issuer,
|
|
377716
377861
|
tokenUrl: oauthConfig.tokenUrl,
|
|
377717
|
-
scopes: oauthConfig.scopes || []
|
|
377862
|
+
scopes: oauthConfig.scopes || [],
|
|
377863
|
+
authorizationResponseIssParameterSupported: mcpServerConfig.oauth?.authorizationResponseIssParameterSupported ?? oauthConfig.authorizationResponseIssParameterSupported
|
|
377718
377864
|
};
|
|
377719
377865
|
const authServerUrl = mcpServerConfig.httpUrl || mcpServerConfig.url;
|
|
377720
377866
|
debugLogger.log(
|
|
@@ -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-U6ZQ2RUE.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-WXXOP3OP.js";
|
|
18
18
|
import {
|
|
19
19
|
debugLogger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KTOZF7BG.js";
|
|
21
21
|
import {
|
|
22
22
|
__toESM
|
|
23
23
|
} from "./chunk-34MYV7JD.js";
|