@google/gemini-cli-a2a-server 0.13.0-nightly.20251101.caf2ca14 → 0.13.0-nightly.20251103.9187f6f6
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/dist/a2a-server.mjs +114 -14
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -289004,8 +289004,8 @@ var Float64Vector = import_vector.default.Float64Vector;
|
|
|
289004
289004
|
var PointerVector = import_vector.default.PointerVector;
|
|
289005
289005
|
|
|
289006
289006
|
// packages/core/dist/src/generated/git-commit.js
|
|
289007
|
-
var GIT_COMMIT_INFO = "
|
|
289008
|
-
var CLI_VERSION = "0.13.0-nightly.
|
|
289007
|
+
var GIT_COMMIT_INFO = "9187f6f6";
|
|
289008
|
+
var CLI_VERSION = "0.13.0-nightly.20251103.9187f6f6";
|
|
289009
289009
|
|
|
289010
289010
|
// packages/core/dist/src/ide/detect-ide.js
|
|
289011
289011
|
var IDE_DEFINITIONS = {
|
|
@@ -291765,7 +291765,7 @@ async function createContentGenerator(config2, gcConfig, sessionId2) {
|
|
|
291765
291765
|
if (gcConfig.fakeResponses) {
|
|
291766
291766
|
return FakeContentGenerator.fromFile(gcConfig.fakeResponses);
|
|
291767
291767
|
}
|
|
291768
|
-
const version3 = "0.13.0-nightly.
|
|
291768
|
+
const version3 = "0.13.0-nightly.20251103.9187f6f6";
|
|
291769
291769
|
const userAgent = `GeminiCLI/${version3} (${process.platform}; ${process.arch})`;
|
|
291770
291770
|
const baseHeaders = {
|
|
291771
291771
|
"User-Agent": userAgent
|
|
@@ -299751,7 +299751,6 @@ var MCPOAuthProvider = class {
|
|
|
299751
299751
|
response_types: ["code"],
|
|
299752
299752
|
token_endpoint_auth_method: "none",
|
|
299753
299753
|
// Public client
|
|
299754
|
-
code_challenge_method: ["S256"],
|
|
299755
299754
|
scope: config2.scopes?.join(" ") || ""
|
|
299756
299755
|
};
|
|
299757
299756
|
const response = await fetch(registrationUrl, {
|
|
@@ -299776,6 +299775,57 @@ var MCPOAuthProvider = class {
|
|
|
299776
299775
|
async discoverOAuthFromMCPServer(mcpServerUrl) {
|
|
299777
299776
|
return OAuthUtils.discoverOAuthConfig(mcpServerUrl);
|
|
299778
299777
|
}
|
|
299778
|
+
async discoverAuthServerMetadataForRegistration(authorizationUrl) {
|
|
299779
|
+
const authUrl = new URL7(authorizationUrl);
|
|
299780
|
+
const oidcPatterns = [
|
|
299781
|
+
"/protocol/openid-connect/auth",
|
|
299782
|
+
"/protocol/openid-connect/authorize",
|
|
299783
|
+
"/oauth2/authorize",
|
|
299784
|
+
"/oauth/authorize",
|
|
299785
|
+
"/authorize"
|
|
299786
|
+
];
|
|
299787
|
+
let pathname = authUrl.pathname.replace(/\/$/, "");
|
|
299788
|
+
for (const pattern of oidcPatterns) {
|
|
299789
|
+
if (pathname.endsWith(pattern)) {
|
|
299790
|
+
pathname = pathname.slice(0, -pattern.length);
|
|
299791
|
+
break;
|
|
299792
|
+
}
|
|
299793
|
+
}
|
|
299794
|
+
const issuerCandidates = /* @__PURE__ */ new Set();
|
|
299795
|
+
issuerCandidates.add(authUrl.origin);
|
|
299796
|
+
if (pathname) {
|
|
299797
|
+
issuerCandidates.add(`${authUrl.origin}${pathname}`);
|
|
299798
|
+
const versionSegmentPattern = /^v\d+(\.\d+)?$/i;
|
|
299799
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
299800
|
+
const lastSegment = segments.at(-1);
|
|
299801
|
+
if (lastSegment && versionSegmentPattern.test(lastSegment)) {
|
|
299802
|
+
const withoutVersionPath = segments.slice(0, -1);
|
|
299803
|
+
if (withoutVersionPath.length) {
|
|
299804
|
+
issuerCandidates.add(`${authUrl.origin}/${withoutVersionPath.join("/")}`);
|
|
299805
|
+
}
|
|
299806
|
+
}
|
|
299807
|
+
}
|
|
299808
|
+
const attemptedIssuers = Array.from(issuerCandidates);
|
|
299809
|
+
let selectedIssuer = attemptedIssuers[0];
|
|
299810
|
+
let discoveredMetadata = null;
|
|
299811
|
+
for (const issuer of attemptedIssuers) {
|
|
299812
|
+
debugLogger.debug(` Trying issuer URL: ${issuer}`);
|
|
299813
|
+
const metadata2 = await OAuthUtils.discoverAuthorizationServerMetadata(issuer);
|
|
299814
|
+
if (metadata2) {
|
|
299815
|
+
selectedIssuer = issuer;
|
|
299816
|
+
discoveredMetadata = metadata2;
|
|
299817
|
+
break;
|
|
299818
|
+
}
|
|
299819
|
+
}
|
|
299820
|
+
if (!discoveredMetadata) {
|
|
299821
|
+
throw new Error(`Failed to fetch authorization server metadata for client registration (attempted issuers: ${attemptedIssuers.join(", ")})`);
|
|
299822
|
+
}
|
|
299823
|
+
debugLogger.debug(` Selected issuer URL: ${selectedIssuer}`);
|
|
299824
|
+
return {
|
|
299825
|
+
issuerUrl: selectedIssuer,
|
|
299826
|
+
metadata: discoveredMetadata
|
|
299827
|
+
};
|
|
299828
|
+
}
|
|
299779
299829
|
/**
|
|
299780
299830
|
* Generate PKCE parameters for OAuth flow.
|
|
299781
299831
|
*
|
|
@@ -300129,13 +300179,8 @@ var MCPOAuthProvider = class {
|
|
|
300129
300179
|
if (!config2.authorizationUrl) {
|
|
300130
300180
|
throw new Error("Cannot perform dynamic registration without authorization URL");
|
|
300131
300181
|
}
|
|
300132
|
-
const authUrl2 = new URL7(config2.authorizationUrl);
|
|
300133
|
-
const serverUrl = `${authUrl2.protocol}//${authUrl2.host}`;
|
|
300134
300182
|
debugLogger.debug("\u2192 Attempting dynamic client registration...");
|
|
300135
|
-
const authServerMetadata = await
|
|
300136
|
-
if (!authServerMetadata) {
|
|
300137
|
-
throw new Error("Failed to fetch authorization server metadata for client registration");
|
|
300138
|
-
}
|
|
300183
|
+
const { metadata: authServerMetadata } = await this.discoverAuthServerMetadataForRegistration(config2.authorizationUrl);
|
|
300139
300184
|
registrationUrl = authServerMetadata.registration_endpoint;
|
|
300140
300185
|
}
|
|
300141
300186
|
if (registrationUrl) {
|
|
@@ -341849,11 +341894,17 @@ var import_ignore3 = __toESM(require_ignore(), 1);
|
|
|
341849
341894
|
import * as fs48 from "node:fs";
|
|
341850
341895
|
import * as path50 from "node:path";
|
|
341851
341896
|
var GitIgnoreParser = class {
|
|
341897
|
+
extraPatterns;
|
|
341852
341898
|
projectRoot;
|
|
341853
341899
|
cache = /* @__PURE__ */ new Map();
|
|
341854
341900
|
globalPatterns;
|
|
341855
|
-
|
|
341901
|
+
processedExtraPatterns = [];
|
|
341902
|
+
constructor(projectRoot, extraPatterns) {
|
|
341903
|
+
this.extraPatterns = extraPatterns;
|
|
341856
341904
|
this.projectRoot = path50.resolve(projectRoot);
|
|
341905
|
+
if (this.extraPatterns) {
|
|
341906
|
+
this.processedExtraPatterns = this.processPatterns(this.extraPatterns, ".");
|
|
341907
|
+
}
|
|
341857
341908
|
}
|
|
341858
341909
|
loadPatternsForFile(patternsFilePath) {
|
|
341859
341910
|
let content;
|
|
@@ -341864,7 +341915,11 @@ var GitIgnoreParser = class {
|
|
|
341864
341915
|
}
|
|
341865
341916
|
const isExcludeFile = patternsFilePath.endsWith(path50.join(".git", "info", "exclude"));
|
|
341866
341917
|
const relativeBaseDir = isExcludeFile ? "." : path50.dirname(path50.relative(this.projectRoot, patternsFilePath)).split(path50.sep).join(path50.posix.sep);
|
|
341867
|
-
|
|
341918
|
+
const rawPatterns = content.split("\n");
|
|
341919
|
+
return this.processPatterns(rawPatterns, relativeBaseDir);
|
|
341920
|
+
}
|
|
341921
|
+
processPatterns(rawPatterns, relativeBaseDir) {
|
|
341922
|
+
return rawPatterns.map((p) => p.trimStart()).filter((p) => p !== "" && !p.startsWith("#")).map((p) => {
|
|
341868
341923
|
const isNegative = p.startsWith("!");
|
|
341869
341924
|
if (isNegative) {
|
|
341870
341925
|
p = p.substring(1);
|
|
@@ -341931,7 +341986,8 @@ var GitIgnoreParser = class {
|
|
|
341931
341986
|
const relativeDir = path50.relative(this.projectRoot, dir);
|
|
341932
341987
|
if (relativeDir) {
|
|
341933
341988
|
const normalizedRelativeDir = relativeDir.replace(/\\/g, "/");
|
|
341934
|
-
|
|
341989
|
+
const igPlusExtras = (0, import_ignore3.default)().add(ig).add(this.processedExtraPatterns);
|
|
341990
|
+
if (igPlusExtras.ignores(normalizedRelativeDir)) {
|
|
341935
341991
|
break;
|
|
341936
341992
|
}
|
|
341937
341993
|
}
|
|
@@ -341951,6 +342007,9 @@ var GitIgnoreParser = class {
|
|
|
341951
342007
|
}
|
|
341952
342008
|
}
|
|
341953
342009
|
}
|
|
342010
|
+
if (this.processedExtraPatterns.length > 0) {
|
|
342011
|
+
ig.add(this.processedExtraPatterns);
|
|
342012
|
+
}
|
|
341954
342013
|
return ig.ignores(normalizedPath);
|
|
341955
342014
|
} catch (_error) {
|
|
341956
342015
|
return false;
|
|
@@ -342012,6 +342071,7 @@ import * as path52 from "node:path";
|
|
|
342012
342071
|
var FileDiscoveryService = class {
|
|
342013
342072
|
gitIgnoreFilter = null;
|
|
342014
342073
|
geminiIgnoreFilter = null;
|
|
342074
|
+
combinedIgnoreFilter = null;
|
|
342015
342075
|
projectRoot;
|
|
342016
342076
|
constructor(projectRoot) {
|
|
342017
342077
|
this.projectRoot = path52.resolve(projectRoot);
|
|
@@ -342019,6 +342079,10 @@ var FileDiscoveryService = class {
|
|
|
342019
342079
|
this.gitIgnoreFilter = new GitIgnoreParser(this.projectRoot);
|
|
342020
342080
|
}
|
|
342021
342081
|
this.geminiIgnoreFilter = new GeminiIgnoreParser(this.projectRoot);
|
|
342082
|
+
if (this.gitIgnoreFilter) {
|
|
342083
|
+
const geminiPatterns = this.geminiIgnoreFilter.getPatterns();
|
|
342084
|
+
this.combinedIgnoreFilter = new GitIgnoreParser(this.projectRoot, geminiPatterns);
|
|
342085
|
+
}
|
|
342022
342086
|
}
|
|
342023
342087
|
/**
|
|
342024
342088
|
* Filters a list of file paths based on git ignore rules
|
|
@@ -342026,6 +342090,9 @@ var FileDiscoveryService = class {
|
|
|
342026
342090
|
filterFiles(filePaths, options2 = {}) {
|
|
342027
342091
|
const { respectGitIgnore = true, respectGeminiIgnore = true } = options2;
|
|
342028
342092
|
return filePaths.filter((filePath) => {
|
|
342093
|
+
if (respectGitIgnore && respectGeminiIgnore && this.combinedIgnoreFilter) {
|
|
342094
|
+
return !this.combinedIgnoreFilter.isIgnored(filePath);
|
|
342095
|
+
}
|
|
342029
342096
|
if (respectGitIgnore && this.gitIgnoreFilter?.isIgnored(filePath)) {
|
|
342030
342097
|
return false;
|
|
342031
342098
|
}
|
|
@@ -349633,6 +349700,24 @@ var AuthProviderType;
|
|
|
349633
349700
|
AuthProviderType2["GOOGLE_CREDENTIALS"] = "google_credentials";
|
|
349634
349701
|
AuthProviderType2["SERVICE_ACCOUNT_IMPERSONATION"] = "service_account_impersonation";
|
|
349635
349702
|
})(AuthProviderType || (AuthProviderType = {}));
|
|
349703
|
+
var HookEventName;
|
|
349704
|
+
(function(HookEventName2) {
|
|
349705
|
+
HookEventName2["BeforeTool"] = "BeforeTool";
|
|
349706
|
+
HookEventName2["AfterTool"] = "AfterTool";
|
|
349707
|
+
HookEventName2["BeforeAgent"] = "BeforeAgent";
|
|
349708
|
+
HookEventName2["Notification"] = "Notification";
|
|
349709
|
+
HookEventName2["AfterAgent"] = "AfterAgent";
|
|
349710
|
+
HookEventName2["SessionStart"] = "SessionStart";
|
|
349711
|
+
HookEventName2["SessionEnd"] = "SessionEnd";
|
|
349712
|
+
HookEventName2["PreCompress"] = "PreCompress";
|
|
349713
|
+
HookEventName2["BeforeModel"] = "BeforeModel";
|
|
349714
|
+
HookEventName2["AfterModel"] = "AfterModel";
|
|
349715
|
+
HookEventName2["BeforeToolSelection"] = "BeforeToolSelection";
|
|
349716
|
+
})(HookEventName || (HookEventName = {}));
|
|
349717
|
+
var HookType;
|
|
349718
|
+
(function(HookType2) {
|
|
349719
|
+
HookType2["Command"] = "command";
|
|
349720
|
+
})(HookType || (HookType = {}));
|
|
349636
349721
|
var Config = class {
|
|
349637
349722
|
toolRegistry;
|
|
349638
349723
|
promptRegistry;
|
|
@@ -349721,6 +349806,8 @@ var Config = class {
|
|
|
349721
349806
|
fakeResponses;
|
|
349722
349807
|
recordResponses;
|
|
349723
349808
|
disableYoloMode;
|
|
349809
|
+
enableHooks;
|
|
349810
|
+
hooks;
|
|
349724
349811
|
constructor(params) {
|
|
349725
349812
|
this.sessionId = params.sessionId;
|
|
349726
349813
|
this.embeddingModel = params.embeddingModel ?? DEFAULT_GEMINI_EMBEDDING_MODEL;
|
|
@@ -349797,7 +349884,10 @@ var Config = class {
|
|
|
349797
349884
|
this.initialUseModelRouter = params.useModelRouter ?? false;
|
|
349798
349885
|
this.useModelRouter = this.initialUseModelRouter;
|
|
349799
349886
|
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [];
|
|
349800
|
-
this.
|
|
349887
|
+
this.enableHooks = params.enableHooks ?? false;
|
|
349888
|
+
const hasHooks = params.hooks && Object.keys(params.hooks).length > 0;
|
|
349889
|
+
const hooksNeedMessageBus = this.enableHooks && hasHooks;
|
|
349890
|
+
this.enableMessageBusIntegration = params.enableMessageBusIntegration ?? (hooksNeedMessageBus ? true : false);
|
|
349801
349891
|
this.codebaseInvestigatorSettings = {
|
|
349802
349892
|
enabled: params.codebaseInvestigatorSettings?.enabled ?? false,
|
|
349803
349893
|
maxNumTurns: params.codebaseInvestigatorSettings?.maxNumTurns ?? 15,
|
|
@@ -349822,6 +349912,7 @@ var Config = class {
|
|
|
349822
349912
|
};
|
|
349823
349913
|
this.retryFetchErrors = params.retryFetchErrors ?? false;
|
|
349824
349914
|
this.disableYoloMode = params.disableYoloMode ?? false;
|
|
349915
|
+
this.hooks = params.hooks;
|
|
349825
349916
|
if (params.contextFileName) {
|
|
349826
349917
|
setGeminiMdFilename(params.contextFileName);
|
|
349827
349918
|
}
|
|
@@ -350251,6 +350342,9 @@ var Config = class {
|
|
|
350251
350342
|
getEnableMessageBusIntegration() {
|
|
350252
350343
|
return this.enableMessageBusIntegration;
|
|
350253
350344
|
}
|
|
350345
|
+
getEnableHooks() {
|
|
350346
|
+
return this.enableHooks;
|
|
350347
|
+
}
|
|
350254
350348
|
getCodebaseInvestigatorSettings() {
|
|
350255
350349
|
return this.codebaseInvestigatorSettings;
|
|
350256
350350
|
}
|
|
@@ -350336,6 +350430,12 @@ var Config = class {
|
|
|
350336
350430
|
await registry.discoverAllTools();
|
|
350337
350431
|
return registry;
|
|
350338
350432
|
}
|
|
350433
|
+
/**
|
|
350434
|
+
* Get hooks configuration
|
|
350435
|
+
*/
|
|
350436
|
+
getHooks() {
|
|
350437
|
+
return this.hooks;
|
|
350438
|
+
}
|
|
350339
350439
|
};
|
|
350340
350440
|
|
|
350341
350441
|
// packages/core/dist/src/commands/extensions.js
|