@google/gemini-cli-a2a-server 0.13.0-nightly.20251102.d7243fb8 → 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 +89 -11
- 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) {
|
|
@@ -349655,6 +349700,24 @@ var AuthProviderType;
|
|
|
349655
349700
|
AuthProviderType2["GOOGLE_CREDENTIALS"] = "google_credentials";
|
|
349656
349701
|
AuthProviderType2["SERVICE_ACCOUNT_IMPERSONATION"] = "service_account_impersonation";
|
|
349657
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 = {}));
|
|
349658
349721
|
var Config = class {
|
|
349659
349722
|
toolRegistry;
|
|
349660
349723
|
promptRegistry;
|
|
@@ -349743,6 +349806,8 @@ var Config = class {
|
|
|
349743
349806
|
fakeResponses;
|
|
349744
349807
|
recordResponses;
|
|
349745
349808
|
disableYoloMode;
|
|
349809
|
+
enableHooks;
|
|
349810
|
+
hooks;
|
|
349746
349811
|
constructor(params) {
|
|
349747
349812
|
this.sessionId = params.sessionId;
|
|
349748
349813
|
this.embeddingModel = params.embeddingModel ?? DEFAULT_GEMINI_EMBEDDING_MODEL;
|
|
@@ -349819,7 +349884,10 @@ var Config = class {
|
|
|
349819
349884
|
this.initialUseModelRouter = params.useModelRouter ?? false;
|
|
349820
349885
|
this.useModelRouter = this.initialUseModelRouter;
|
|
349821
349886
|
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [];
|
|
349822
|
-
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);
|
|
349823
349891
|
this.codebaseInvestigatorSettings = {
|
|
349824
349892
|
enabled: params.codebaseInvestigatorSettings?.enabled ?? false,
|
|
349825
349893
|
maxNumTurns: params.codebaseInvestigatorSettings?.maxNumTurns ?? 15,
|
|
@@ -349844,6 +349912,7 @@ var Config = class {
|
|
|
349844
349912
|
};
|
|
349845
349913
|
this.retryFetchErrors = params.retryFetchErrors ?? false;
|
|
349846
349914
|
this.disableYoloMode = params.disableYoloMode ?? false;
|
|
349915
|
+
this.hooks = params.hooks;
|
|
349847
349916
|
if (params.contextFileName) {
|
|
349848
349917
|
setGeminiMdFilename(params.contextFileName);
|
|
349849
349918
|
}
|
|
@@ -350273,6 +350342,9 @@ var Config = class {
|
|
|
350273
350342
|
getEnableMessageBusIntegration() {
|
|
350274
350343
|
return this.enableMessageBusIntegration;
|
|
350275
350344
|
}
|
|
350345
|
+
getEnableHooks() {
|
|
350346
|
+
return this.enableHooks;
|
|
350347
|
+
}
|
|
350276
350348
|
getCodebaseInvestigatorSettings() {
|
|
350277
350349
|
return this.codebaseInvestigatorSettings;
|
|
350278
350350
|
}
|
|
@@ -350358,6 +350430,12 @@ var Config = class {
|
|
|
350358
350430
|
await registry.discoverAllTools();
|
|
350359
350431
|
return registry;
|
|
350360
350432
|
}
|
|
350433
|
+
/**
|
|
350434
|
+
* Get hooks configuration
|
|
350435
|
+
*/
|
|
350436
|
+
getHooks() {
|
|
350437
|
+
return this.hooks;
|
|
350438
|
+
}
|
|
350361
350439
|
};
|
|
350362
350440
|
|
|
350363
350441
|
// packages/core/dist/src/commands/extensions.js
|