@google/gemini-cli 0.36.0-preview.3 → 0.36.0-preview.5

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.
Files changed (28) hide show
  1. package/bundle/{chunk-2RPVSGOE.js → chunk-3TVPPX4I.js} +250 -177
  2. package/bundle/{chunk-OVFZ4PPB.js → chunk-73XBEEKU.js} +3 -3
  3. package/bundle/{chunk-FACTELEP.js → chunk-GXKW2PIT.js} +253 -175
  4. package/bundle/{chunk-PDS477H6.js → chunk-JVWUC5YF.js} +3 -3
  5. package/bundle/{chunk-SE7S5EFV.js → chunk-QT5UMCOV.js} +3 -3
  6. package/bundle/{chunk-4ZPLYY3L.js → chunk-RPB34XBS.js} +250 -177
  7. package/bundle/{chunk-Y5DDI4MA.js → chunk-UOIPVPAN.js} +3 -3
  8. package/bundle/{chunk-FJHYKR2O.js → chunk-Z65JXKXO.js} +250 -177
  9. package/bundle/{core-RSKPPZFK.js → core-YUBXJKN2.js} +5 -1
  10. package/bundle/{devtoolsService-F3X4NCW2.js → devtoolsService-H6BMMMDD.js} +2 -2
  11. package/bundle/{devtoolsService-Q3IGIXA7.js → devtoolsService-LJ5G2C2N.js} +2 -2
  12. package/bundle/{devtoolsService-SBQKROJQ.js → devtoolsService-S23HMHOP.js} +2 -2
  13. package/bundle/{devtoolsService-VZGEDJ2H.js → devtoolsService-XJE4SD6Y.js} +2 -2
  14. package/bundle/{dist-5ZYQVUMO.js → dist-26FBDZJL.js} +5 -1
  15. package/bundle/{dist-BYRHFNNX.js → dist-HZG3MZJJ.js} +5 -1
  16. package/bundle/{dist-DGLGMJBV.js → dist-NWO4TPRO.js} +5 -1
  17. package/bundle/docs/core/remote-agents.md +96 -6
  18. package/bundle/gemini.js +6 -6
  19. package/bundle/{interactiveCli-2CPHR4GH.js → interactiveCli-H722RT7T.js} +3 -3
  20. package/bundle/{interactiveCli-FJD2UDE7.js → interactiveCli-NDBO5LFJ.js} +3 -3
  21. package/bundle/{interactiveCli-HKCAHWZ2.js → interactiveCli-Q24D75I6.js} +3 -3
  22. package/bundle/{interactiveCli-J2NVKRYX.js → interactiveCli-XLIK7J4T.js} +3 -3
  23. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  24. package/bundle/{oauth2-provider-VHUD4ICS.js → oauth2-provider-GQA3CRCL.js} +1 -1
  25. package/bundle/{oauth2-provider-UMWJMSPF.js → oauth2-provider-J2PS4AXL.js} +1 -1
  26. package/bundle/{oauth2-provider-VAAF5BS7.js → oauth2-provider-MZZUQG5T.js} +1 -1
  27. package/bundle/{oauth2-provider-ZVPXIEIS.js → oauth2-provider-PVUYATDU.js} +1 -1
  28. package/package.json +1 -1
@@ -7643,22 +7643,22 @@ var require_crypto2 = __commonJS({
7643
7643
  "use strict";
7644
7644
  Object.defineProperty(exports2, "__esModule", { value: true });
7645
7645
  exports2.NodeCrypto = void 0;
7646
- var crypto22 = __require("crypto");
7646
+ var crypto23 = __require("crypto");
7647
7647
  var NodeCrypto = class {
7648
7648
  async sha256DigestBase64(str2) {
7649
- return crypto22.createHash("sha256").update(str2).digest("base64");
7649
+ return crypto23.createHash("sha256").update(str2).digest("base64");
7650
7650
  }
7651
7651
  randomBytesBase64(count2) {
7652
- return crypto22.randomBytes(count2).toString("base64");
7652
+ return crypto23.randomBytes(count2).toString("base64");
7653
7653
  }
7654
7654
  async verify(pubkey, data, signature) {
7655
- const verifier = crypto22.createVerify("RSA-SHA256");
7655
+ const verifier = crypto23.createVerify("RSA-SHA256");
7656
7656
  verifier.update(data);
7657
7657
  verifier.end();
7658
7658
  return verifier.verify(pubkey, signature, "base64");
7659
7659
  }
7660
7660
  async sign(privateKey, data) {
7661
- const signer = crypto22.createSign("RSA-SHA256");
7661
+ const signer = crypto23.createSign("RSA-SHA256");
7662
7662
  signer.update(data);
7663
7663
  signer.end();
7664
7664
  return signer.sign(privateKey, "base64");
@@ -7676,7 +7676,7 @@ var require_crypto2 = __commonJS({
7676
7676
  * string in hexadecimal encoding.
7677
7677
  */
7678
7678
  async sha256DigestHex(str2) {
7679
- return crypto22.createHash("sha256").update(str2).digest("hex");
7679
+ return crypto23.createHash("sha256").update(str2).digest("hex");
7680
7680
  }
7681
7681
  /**
7682
7682
  * Computes the HMAC hash of a message using the provided crypto key and the
@@ -7688,7 +7688,7 @@ var require_crypto2 = __commonJS({
7688
7688
  */
7689
7689
  async signWithHmacSha256(key, msg) {
7690
7690
  const cryptoKey = typeof key === "string" ? key : toBuffer(key);
7691
- return toArrayBuffer(crypto22.createHmac("sha256", cryptoKey).update(msg).digest());
7691
+ return toArrayBuffer(crypto23.createHmac("sha256", cryptoKey).update(msg).digest());
7692
7692
  }
7693
7693
  };
7694
7694
  exports2.NodeCrypto = NodeCrypto;
@@ -8244,10 +8244,10 @@ var require_oauth2client = __commonJS({
8244
8244
  * https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2-codeVerifier.js
8245
8245
  */
8246
8246
  async generateCodeVerifierAsync() {
8247
- const crypto22 = (0, crypto_1.createCrypto)();
8248
- const randomString2 = crypto22.randomBytesBase64(96);
8247
+ const crypto23 = (0, crypto_1.createCrypto)();
8248
+ const randomString2 = crypto23.randomBytesBase64(96);
8249
8249
  const codeVerifier = randomString2.replace(/\+/g, "~").replace(/=/g, "_").replace(/\//g, "-");
8250
- const unencodedCodeChallenge = await crypto22.sha256DigestBase64(codeVerifier);
8250
+ const unencodedCodeChallenge = await crypto23.sha256DigestBase64(codeVerifier);
8251
8251
  const codeChallenge = unencodedCodeChallenge.split("=")[0].replace(/\+/g, "-").replace(/\//g, "_");
8252
8252
  return { codeVerifier, codeChallenge };
8253
8253
  }
@@ -8691,7 +8691,7 @@ var require_oauth2client = __commonJS({
8691
8691
  * @return Returns a promise resolving to LoginTicket on verification.
8692
8692
  */
8693
8693
  async verifySignedJwtWithCertsAsync(jwt2, certs, requiredAudience, issuers, maxExpiry) {
8694
- const crypto22 = (0, crypto_1.createCrypto)();
8694
+ const crypto23 = (0, crypto_1.createCrypto)();
8695
8695
  if (!maxExpiry) {
8696
8696
  maxExpiry = _OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;
8697
8697
  }
@@ -8704,7 +8704,7 @@ var require_oauth2client = __commonJS({
8704
8704
  let envelope;
8705
8705
  let payload;
8706
8706
  try {
8707
- envelope = JSON.parse(crypto22.decodeBase64StringUtf8(segments[0]));
8707
+ envelope = JSON.parse(crypto23.decodeBase64StringUtf8(segments[0]));
8708
8708
  } catch (err2) {
8709
8709
  if (err2 instanceof Error) {
8710
8710
  err2.message = `Can't parse token envelope: ${segments[0]}': ${err2.message}`;
@@ -8715,7 +8715,7 @@ var require_oauth2client = __commonJS({
8715
8715
  throw new Error("Can't parse token envelope: " + segments[0]);
8716
8716
  }
8717
8717
  try {
8718
- payload = JSON.parse(crypto22.decodeBase64StringUtf8(segments[1]));
8718
+ payload = JSON.parse(crypto23.decodeBase64StringUtf8(segments[1]));
8719
8719
  } catch (err2) {
8720
8720
  if (err2 instanceof Error) {
8721
8721
  err2.message = `Can't parse token payload '${segments[0]}`;
@@ -8732,7 +8732,7 @@ var require_oauth2client = __commonJS({
8732
8732
  if (envelope.alg === "ES256") {
8733
8733
  signature = formatEcdsa.joseToDer(signature, "ES256").toString("base64");
8734
8734
  }
8735
- const verified = await crypto22.verify(cert, signed, signature);
8735
+ const verified = await crypto23.verify(cert, signed, signature);
8736
8736
  if (!verified) {
8737
8737
  throw new Error("Invalid token signature: " + jwt2);
8738
8738
  }
@@ -10877,14 +10877,14 @@ var require_awsrequestsigner = __commonJS({
10877
10877
  }
10878
10878
  };
10879
10879
  exports2.AwsRequestSigner = AwsRequestSigner;
10880
- async function sign(crypto22, key, msg) {
10881
- return await crypto22.signWithHmacSha256(key, msg);
10882
- }
10883
- async function getSigningKey(crypto22, key, dateStamp, region, serviceName) {
10884
- const kDate = await sign(crypto22, `AWS4${key}`, dateStamp);
10885
- const kRegion = await sign(crypto22, kDate, region);
10886
- const kService = await sign(crypto22, kRegion, serviceName);
10887
- const kSigning = await sign(crypto22, kService, "aws4_request");
10880
+ async function sign(crypto23, key, msg) {
10881
+ return await crypto23.signWithHmacSha256(key, msg);
10882
+ }
10883
+ async function getSigningKey(crypto23, key, dateStamp, region, serviceName) {
10884
+ const kDate = await sign(crypto23, `AWS4${key}`, dateStamp);
10885
+ const kRegion = await sign(crypto23, kDate, region);
10886
+ const kService = await sign(crypto23, kRegion, serviceName);
10887
+ const kSigning = await sign(crypto23, kService, "aws4_request");
10888
10888
  return kSigning;
10889
10889
  }
10890
10890
  async function generateAuthenticationHeaderMap(options) {
@@ -12469,24 +12469,24 @@ var require_googleauth = __commonJS({
12469
12469
  const signed = await client.sign(data);
12470
12470
  return signed.signedBlob;
12471
12471
  }
12472
- const crypto22 = (0, crypto_1.createCrypto)();
12472
+ const crypto23 = (0, crypto_1.createCrypto)();
12473
12473
  if (client instanceof jwtclient_1.JWT && client.key) {
12474
- const sign = await crypto22.sign(client.key, data);
12474
+ const sign = await crypto23.sign(client.key, data);
12475
12475
  return sign;
12476
12476
  }
12477
12477
  const creds = await this.getCredentials();
12478
12478
  if (!creds.client_email) {
12479
12479
  throw new Error("Cannot sign data without `client_email`.");
12480
12480
  }
12481
- return this.signBlob(crypto22, creds.client_email, data, endpoint);
12481
+ return this.signBlob(crypto23, creds.client_email, data, endpoint);
12482
12482
  }
12483
- async signBlob(crypto22, emailOrUniqueId, data, endpoint) {
12483
+ async signBlob(crypto23, emailOrUniqueId, data, endpoint) {
12484
12484
  const url3 = new URL(endpoint + `${emailOrUniqueId}:signBlob`);
12485
12485
  const res = await this.request({
12486
12486
  method: "POST",
12487
12487
  url: url3.href,
12488
12488
  data: {
12489
- payload: crypto22.encodeBase64StringUtf8(data)
12489
+ payload: crypto23.encodeBase64StringUtf8(data)
12490
12490
  },
12491
12491
  retry: true,
12492
12492
  retryConfig: {
@@ -108724,7 +108724,7 @@ var require_src48 = __commonJS({
108724
108724
  var require_object_hash = __commonJS({
108725
108725
  "node_modules/object-hash/index.js"(exports2, module2) {
108726
108726
  "use strict";
108727
- var crypto22 = __require("crypto");
108727
+ var crypto23 = __require("crypto");
108728
108728
  exports2 = module2.exports = objectHash;
108729
108729
  function objectHash(object3, options) {
108730
108730
  options = applyDefaults(object3, options);
@@ -108742,7 +108742,7 @@ var require_object_hash = __commonJS({
108742
108742
  exports2.keysMD5 = function(object3) {
108743
108743
  return objectHash(object3, { algorithm: "md5", encoding: "hex", excludeValues: true });
108744
108744
  };
108745
- var hashes = crypto22.getHashes ? crypto22.getHashes().slice() : ["sha1", "md5"];
108745
+ var hashes = crypto23.getHashes ? crypto23.getHashes().slice() : ["sha1", "md5"];
108746
108746
  hashes.push("passthrough");
108747
108747
  var encodings = ["buffer", "hex", "binary", "base64"];
108748
108748
  function applyDefaults(object3, sourceOptions) {
@@ -108788,7 +108788,7 @@ var require_object_hash = __commonJS({
108788
108788
  function hash(object3, options) {
108789
108789
  var hashingStream;
108790
108790
  if (options.algorithm !== "passthrough") {
108791
- hashingStream = crypto22.createHash(options.algorithm);
108791
+ hashingStream = crypto23.createHash(options.algorithm);
108792
108792
  } else {
108793
108793
  hashingStream = new PassThrough3();
108794
108794
  }
@@ -125275,13 +125275,13 @@ var require_context = __commonJS({
125275
125275
  exports2.parseXCloudTraceHeader = parseXCloudTraceHeader;
125276
125276
  exports2.parseTraceParentHeader = parseTraceParentHeader;
125277
125277
  var uuid3 = (init_esm_node(), __toCommonJS(esm_node_exports));
125278
- var crypto22 = __require("crypto");
125278
+ var crypto23 = __require("crypto");
125279
125279
  var api_1 = (init_esm(), __toCommonJS(esm_exports));
125280
125280
  exports2.X_CLOUD_TRACE_HEADER = "x-cloud-trace-context";
125281
125281
  var SPAN_ID_RANDOM_BYTES = 8;
125282
125282
  var spanIdBuffer = Buffer.alloc(SPAN_ID_RANDOM_BYTES);
125283
- var randomFillSync2 = crypto22.randomFillSync;
125284
- var randomBytes7 = crypto22.randomBytes;
125283
+ var randomFillSync2 = crypto23.randomFillSync;
125284
+ var randomBytes7 = crypto23.randomBytes;
125285
125285
  var spanRandomBuffer = randomFillSync2 ? () => randomFillSync2(spanIdBuffer) : () => randomBytes7(SPAN_ID_RANDOM_BYTES);
125286
125286
  exports2.W3C_TRACE_PARENT_HEADER = "traceparent";
125287
125287
  function makeHeaderWrapper(req) {
@@ -187684,8 +187684,8 @@ var require_snapshot_utils = __commonJS({
187684
187684
  match: new Set(matchHeaders.map((header) => caseSensitive ? header : header.toLowerCase()))
187685
187685
  };
187686
187686
  }
187687
- var crypto22 = runtimeFeatures.has("crypto") ? __require("node:crypto") : null;
187688
- var hashId = crypto22?.hash ? (value) => crypto22.hash("sha256", value, "base64url") : (value) => Buffer.from(value).toString("base64url");
187687
+ var crypto23 = runtimeFeatures.has("crypto") ? __require("node:crypto") : null;
187688
+ var hashId = crypto23?.hash ? (value) => crypto23.hash("sha256", value, "base64url") : (value) => Buffer.from(value).toString("base64url");
187689
187689
  function isUndiciHeaders(headers) {
187690
187690
  return Array.isArray(headers) && (headers.length & 1) === 0;
187691
187691
  }
@@ -193740,10 +193740,10 @@ var require_subresource_integrity = __commonJS({
193740
193740
  var assert4 = __require("node:assert");
193741
193741
  var { runtimeFeatures } = require_runtime_features();
193742
193742
  var validSRIHashAlgorithmTokenSet = /* @__PURE__ */ new Map([["sha256", 0], ["sha384", 1], ["sha512", 2]]);
193743
- var crypto22;
193743
+ var crypto23;
193744
193744
  if (runtimeFeatures.has("crypto")) {
193745
- crypto22 = __require("node:crypto");
193746
- const cryptoHashes = crypto22.getHashes();
193745
+ crypto23 = __require("node:crypto");
193746
+ const cryptoHashes = crypto23.getHashes();
193747
193747
  if (cryptoHashes.length === 0) {
193748
193748
  validSRIHashAlgorithmTokenSet.clear();
193749
193749
  }
@@ -193833,7 +193833,7 @@ var require_subresource_integrity = __commonJS({
193833
193833
  return result2;
193834
193834
  }
193835
193835
  var applyAlgorithmToBytes = (algorithm, bytes) => {
193836
- return crypto22.hash(algorithm, bytes, "base64");
193836
+ return crypto23.hash(algorithm, bytes, "base64");
193837
193837
  };
193838
193838
  function caseSensitiveMatch(actualValue, expectedValue) {
193839
193839
  let actualValueLength = actualValue.length;
@@ -196767,7 +196767,7 @@ var require_connection = __commonJS({
196767
196767
  var { WebsocketFrameSend } = require_frame();
196768
196768
  var assert4 = __require("node:assert");
196769
196769
  var { runtimeFeatures } = require_runtime_features();
196770
- var crypto22 = runtimeFeatures.has("crypto") ? __require("node:crypto") : null;
196770
+ var crypto23 = runtimeFeatures.has("crypto") ? __require("node:crypto") : null;
196771
196771
  var warningEmitted = false;
196772
196772
  function establishWebSocketConnection(url3, protocols, client, handler, options) {
196773
196773
  const requestURL = url3;
@@ -196787,7 +196787,7 @@ var require_connection = __commonJS({
196787
196787
  const headersList = getHeadersList(new Headers2(options.headers));
196788
196788
  request.headersList = headersList;
196789
196789
  }
196790
- const keyValue = crypto22.randomBytes(16).toString("base64");
196790
+ const keyValue = crypto23.randomBytes(16).toString("base64");
196791
196791
  request.headersList.append("sec-websocket-key", keyValue, true);
196792
196792
  request.headersList.append("sec-websocket-version", "13", true);
196793
196793
  for (const protocol of protocols) {
@@ -196827,7 +196827,7 @@ var require_connection = __commonJS({
196827
196827
  return;
196828
196828
  }
196829
196829
  const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");
196830
- const digest = crypto22.hash("sha1", keyValue + uid, "base64");
196830
+ const digest = crypto23.hash("sha1", keyValue + uid, "base64");
196831
196831
  if (secWSAccept !== digest) {
196832
196832
  failWebsocketConnection(handler, 1002, "Incorrect hash received in Sec-WebSocket-Accept header.");
196833
196833
  return;
@@ -250034,8 +250034,8 @@ var Float64Vector = import_vector.default.Float64Vector;
250034
250034
  var PointerVector = import_vector.default.PointerVector;
250035
250035
 
250036
250036
  // packages/core/src/generated/git-commit.ts
250037
- var GIT_COMMIT_INFO = "146442f2a";
250038
- var CLI_VERSION = "0.36.0-preview.0";
250037
+ var GIT_COMMIT_INFO = "310db3b82";
250038
+ var CLI_VERSION = "0.36.0-preview.4";
250039
250039
 
250040
250040
  // packages/core/src/ide/detect-ide.ts
250041
250041
  var IDE_DEFINITIONS = {
@@ -276488,7 +276488,7 @@ function getVersion() {
276488
276488
  }
276489
276489
  versionPromise = (async () => {
276490
276490
  const pkgJson = await getPackageJson(__dirname4);
276491
- return "0.36.0-preview.0";
276491
+ return "0.36.0-preview.4";
276492
276492
  })();
276493
276493
  return versionPromise;
276494
276494
  }
@@ -325542,6 +325542,64 @@ function parseExperiments(response) {
325542
325542
  };
325543
325543
  }
325544
325544
 
325545
+ // packages/core/src/agents/registry.ts
325546
+ import * as crypto17 from "node:crypto";
325547
+
325548
+ // packages/core/src/agents/types.ts
325549
+ var AgentTerminateMode = /* @__PURE__ */ ((AgentTerminateMode2) => {
325550
+ AgentTerminateMode2["ERROR"] = "ERROR";
325551
+ AgentTerminateMode2["TIMEOUT"] = "TIMEOUT";
325552
+ AgentTerminateMode2["GOAL"] = "GOAL";
325553
+ AgentTerminateMode2["MAX_TURNS"] = "MAX_TURNS";
325554
+ AgentTerminateMode2["ABORTED"] = "ABORTED";
325555
+ AgentTerminateMode2["ERROR_NO_COMPLETE_TASK_CALL"] = "ERROR_NO_COMPLETE_TASK_CALL";
325556
+ return AgentTerminateMode2;
325557
+ })(AgentTerminateMode || {});
325558
+ var DEFAULT_QUERY_STRING = "Get Started!";
325559
+ var DEFAULT_MAX_TURNS = 30;
325560
+ var DEFAULT_MAX_TIME_MINUTES = 10;
325561
+ var SubagentActivityErrorType = /* @__PURE__ */ ((SubagentActivityErrorType2) => {
325562
+ SubagentActivityErrorType2["REJECTED"] = "REJECTED";
325563
+ SubagentActivityErrorType2["CANCELLED"] = "CANCELLED";
325564
+ SubagentActivityErrorType2["GENERIC"] = "GENERIC";
325565
+ return SubagentActivityErrorType2;
325566
+ })(SubagentActivityErrorType || {});
325567
+ var SUBAGENT_REJECTED_ERROR_PREFIX = "User rejected this operation.";
325568
+ var SUBAGENT_CANCELLED_ERROR_MESSAGE = "Request cancelled.";
325569
+ function isSubagentProgress(obj) {
325570
+ return typeof obj === "object" && obj !== null && "isSubagentProgress" in obj && obj.isSubagentProgress === true;
325571
+ }
325572
+ function isToolActivityError(data) {
325573
+ return data !== null && typeof data === "object" && "isError" in data && data.isError === true;
325574
+ }
325575
+ function getAgentCardLoadOptions(def) {
325576
+ if (def.agentCardJson) {
325577
+ return { type: "json", json: def.agentCardJson };
325578
+ }
325579
+ if (def.agentCardUrl) {
325580
+ return { type: "url", url: def.agentCardUrl };
325581
+ }
325582
+ throw new Error(
325583
+ `Remote agent '${def.name}' has neither agentCardUrl nor agentCardJson`
325584
+ );
325585
+ }
325586
+ function getRemoteAgentTargetUrl(def) {
325587
+ if (def.agentCardUrl) {
325588
+ return def.agentCardUrl;
325589
+ }
325590
+ if (def.agentCardJson) {
325591
+ try {
325592
+ const parsed = JSON.parse(def.agentCardJson);
325593
+ const card = parsed;
325594
+ if (card.url) {
325595
+ return card.url;
325596
+ }
325597
+ } catch {
325598
+ }
325599
+ }
325600
+ return void 0;
325601
+ }
325602
+
325545
325603
  // node_modules/js-yaml/dist/js-yaml.mjs
325546
325604
  function isNothing(subject) {
325547
325605
  return typeof subject === "undefined" || subject === null;
@@ -328133,34 +328191,6 @@ import * as fs46 from "node:fs/promises";
328133
328191
  import * as path61 from "node:path";
328134
328192
  import * as crypto16 from "node:crypto";
328135
328193
 
328136
- // packages/core/src/agents/types.ts
328137
- var AgentTerminateMode = /* @__PURE__ */ ((AgentTerminateMode2) => {
328138
- AgentTerminateMode2["ERROR"] = "ERROR";
328139
- AgentTerminateMode2["TIMEOUT"] = "TIMEOUT";
328140
- AgentTerminateMode2["GOAL"] = "GOAL";
328141
- AgentTerminateMode2["MAX_TURNS"] = "MAX_TURNS";
328142
- AgentTerminateMode2["ABORTED"] = "ABORTED";
328143
- AgentTerminateMode2["ERROR_NO_COMPLETE_TASK_CALL"] = "ERROR_NO_COMPLETE_TASK_CALL";
328144
- return AgentTerminateMode2;
328145
- })(AgentTerminateMode || {});
328146
- var DEFAULT_QUERY_STRING = "Get Started!";
328147
- var DEFAULT_MAX_TURNS = 30;
328148
- var DEFAULT_MAX_TIME_MINUTES = 10;
328149
- var SubagentActivityErrorType = /* @__PURE__ */ ((SubagentActivityErrorType2) => {
328150
- SubagentActivityErrorType2["REJECTED"] = "REJECTED";
328151
- SubagentActivityErrorType2["CANCELLED"] = "CANCELLED";
328152
- SubagentActivityErrorType2["GENERIC"] = "GENERIC";
328153
- return SubagentActivityErrorType2;
328154
- })(SubagentActivityErrorType || {});
328155
- var SUBAGENT_REJECTED_ERROR_PREFIX = "User rejected this operation.";
328156
- var SUBAGENT_CANCELLED_ERROR_MESSAGE = "Request cancelled.";
328157
- function isSubagentProgress(obj) {
328158
- return typeof obj === "object" && obj !== null && "isSubagentProgress" in obj && obj.isSubagentProgress === true;
328159
- }
328160
- function isToolActivityError(data) {
328161
- return data !== null && typeof data === "object" && "isError" in data && data.isError === true;
328162
- }
328163
-
328164
328194
  // packages/core/src/skills/skillLoader.ts
328165
328195
  import * as fs45 from "node:fs/promises";
328166
328196
  import * as path60 from "node:path";
@@ -328354,17 +328384,16 @@ var authConfigSchema = external_exports.discriminatedUnion("type", [
328354
328384
  oauth2AuthSchema
328355
328385
  ]).superRefine((data, ctx) => {
328356
328386
  if (data.type === "http") {
328357
- if (data.value) {
328358
- return;
328359
- }
328360
- if (data.scheme === "Bearer" && !data.token) {
328361
- ctx.addIssue({
328362
- code: external_exports.ZodIssueCode.custom,
328363
- message: 'Bearer scheme requires "token"',
328364
- path: ["token"]
328365
- });
328366
- }
328367
- if (data.scheme === "Basic") {
328387
+ if (data.value) return;
328388
+ if (data.scheme === "Bearer") {
328389
+ if (!data.token) {
328390
+ ctx.addIssue({
328391
+ code: external_exports.ZodIssueCode.custom,
328392
+ message: 'Bearer scheme requires "token"',
328393
+ path: ["token"]
328394
+ });
328395
+ }
328396
+ } else if (data.scheme === "Basic") {
328368
328397
  if (!data.username) {
328369
328398
  ctx.addIssue({
328370
328399
  code: external_exports.ZodIssueCode.custom,
@@ -328379,39 +328408,84 @@ var authConfigSchema = external_exports.discriminatedUnion("type", [
328379
328408
  path: ["password"]
328380
328409
  });
328381
328410
  }
328411
+ } else {
328412
+ ctx.addIssue({
328413
+ code: external_exports.ZodIssueCode.custom,
328414
+ message: `HTTP scheme "${data.scheme}" requires "value"`,
328415
+ path: ["value"]
328416
+ });
328382
328417
  }
328383
328418
  }
328384
328419
  });
328385
- var remoteAgentSchema = external_exports.object({
328420
+ var baseRemoteAgentSchema = external_exports.object({
328386
328421
  kind: external_exports.literal("remote").optional().default("remote"),
328387
328422
  name: nameSchema,
328388
328423
  description: external_exports.string().optional(),
328389
328424
  display_name: external_exports.string().optional(),
328390
- agent_card_url: external_exports.string().url(),
328391
328425
  auth: authConfigSchema.optional()
328426
+ });
328427
+ var remoteAgentUrlSchema = baseRemoteAgentSchema.extend({
328428
+ agent_card_url: external_exports.string().url(),
328429
+ agent_card_json: external_exports.undefined().optional()
328430
+ }).strict();
328431
+ var remoteAgentJsonSchema = baseRemoteAgentSchema.extend({
328432
+ agent_card_url: external_exports.undefined().optional(),
328433
+ agent_card_json: external_exports.string().refine(
328434
+ (val) => {
328435
+ try {
328436
+ JSON.parse(val);
328437
+ return true;
328438
+ } catch {
328439
+ return false;
328440
+ }
328441
+ },
328442
+ { message: "agent_card_json must be valid JSON" }
328443
+ )
328392
328444
  }).strict();
328445
+ var remoteAgentSchema = external_exports.union([
328446
+ remoteAgentUrlSchema,
328447
+ remoteAgentJsonSchema
328448
+ ]);
328393
328449
  var agentUnionOptions = [
328394
- { schema: localAgentSchema, label: "Local Agent" },
328395
- { schema: remoteAgentSchema, label: "Remote Agent" }
328450
+ { label: "Local Agent" },
328451
+ { label: "Remote Agent" },
328452
+ { label: "Remote Agent" }
328396
328453
  ];
328397
328454
  var remoteAgentsListSchema = external_exports.array(remoteAgentSchema);
328398
328455
  var markdownFrontmatterSchema = external_exports.union([
328399
- agentUnionOptions[0].schema,
328400
- agentUnionOptions[1].schema
328456
+ localAgentSchema,
328457
+ remoteAgentUrlSchema,
328458
+ remoteAgentJsonSchema
328401
328459
  ]);
328402
- function formatZodError(error40, context2) {
328403
- const issues = error40.issues.map((i3) => {
328460
+ function guessIntendedKind(rawInput) {
328461
+ if (typeof rawInput !== "object" || rawInput === null) return void 0;
328462
+ const input = rawInput;
328463
+ if (input.kind === "local") return "local";
328464
+ if (input.kind === "remote") return "remote";
328465
+ const hasLocalKeys = "tools" in input || "mcp_servers" in input || "model" in input || "temperature" in input || "max_turns" in input || "timeout_mins" in input;
328466
+ const hasRemoteKeys = "agent_card_url" in input || "auth" in input || "agent_card_json" in input;
328467
+ if (hasLocalKeys && !hasRemoteKeys) return "local";
328468
+ if (hasRemoteKeys && !hasLocalKeys) return "remote";
328469
+ return void 0;
328470
+ }
328471
+ function formatZodError(error40, context2, rawInput) {
328472
+ const intendedKind = rawInput ? guessIntendedKind(rawInput) : void 0;
328473
+ const formatIssues = (issues, unionPrefix) => issues.flatMap((i3) => {
328404
328474
  if (i3.code === external_exports.ZodIssueCode.invalid_union) {
328405
- return i3.unionErrors.map((unionError, index) => {
328406
- const label = agentUnionOptions[index]?.label ?? `Agent type #${index + 1}`;
328407
- const unionIssues = unionError.issues.map((u2) => `${u2.path.join(".")}: ${u2.message}`).join(", ");
328408
- return `(${label}) ${unionIssues}`;
328409
- }).join("\n");
328475
+ return i3.unionErrors.flatMap((unionError, index) => {
328476
+ const label = unionPrefix ? unionPrefix : agentUnionOptions[index]?.label ?? `Branch #${index + 1}`;
328477
+ if (intendedKind === "local" && label === "Remote Agent") return [];
328478
+ if (intendedKind === "remote" && label === "Local Agent") return [];
328479
+ return formatIssues(unionError.issues, label);
328480
+ });
328410
328481
  }
328411
- return `${i3.path.join(".")}: ${i3.message}`;
328412
- }).join("\n");
328482
+ const prefix = unionPrefix ? `(${unionPrefix}) ` : "";
328483
+ const path85 = i3.path.length > 0 ? `${i3.path.join(".")}: ` : "";
328484
+ return `${prefix}${path85}${i3.message}`;
328485
+ });
328486
+ const formatted = Array.from(new Set(formatIssues(error40.issues))).join("\n");
328413
328487
  return `${context2}:
328414
- ${issues}`;
328488
+ ${formatted}`;
328415
328489
  }
328416
328490
  async function parseAgentMarkdown(filePath, content) {
328417
328491
  let fileContent;
@@ -328442,8 +328516,7 @@ async function parseAgentMarkdown(filePath, content) {
328442
328516
  } catch (error40) {
328443
328517
  throw new AgentLoadError(
328444
328518
  filePath,
328445
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
328446
- `YAML frontmatter parsing failed: ${error40.message}`
328519
+ `YAML frontmatter parsing failed: ${getErrorMessage(error40)}`
328447
328520
  );
328448
328521
  }
328449
328522
  if (Array.isArray(rawFrontmatter)) {
@@ -328463,7 +328536,7 @@ async function parseAgentMarkdown(filePath, content) {
328463
328536
  if (!result2.success) {
328464
328537
  throw new AgentLoadError(
328465
328538
  filePath,
328466
- `Validation failed: ${formatZodError(result2.error, "Agent Definition")}`
328539
+ `Validation failed: ${formatZodError(result2.error, "Agent Definition", rawFrontmatter)}`
328467
328540
  );
328468
328541
  }
328469
328542
  const frontmatter = result2.data;
@@ -328475,41 +328548,30 @@ async function parseAgentMarkdown(filePath, content) {
328475
328548
  }
328476
328549
  ];
328477
328550
  }
328478
- const agentDef = {
328479
- ...frontmatter,
328480
- kind: "local",
328481
- system_prompt: body2.trim()
328482
- };
328483
- return [agentDef];
328551
+ return [
328552
+ {
328553
+ ...frontmatter,
328554
+ kind: "local",
328555
+ system_prompt: body2.trim()
328556
+ }
328557
+ ];
328484
328558
  }
328485
328559
  function convertFrontmatterAuthToConfig(frontmatter) {
328486
- const base = {};
328487
328560
  switch (frontmatter.type) {
328488
328561
  case "apiKey":
328489
- if (!frontmatter.key) {
328490
- throw new Error("Internal error: API key missing after validation.");
328491
- }
328492
328562
  return {
328493
- ...base,
328494
328563
  type: "apiKey",
328495
328564
  key: frontmatter.key,
328496
328565
  name: frontmatter.name
328497
328566
  };
328498
328567
  case "google-credentials":
328499
328568
  return {
328500
- ...base,
328501
328569
  type: "google-credentials",
328502
328570
  scopes: frontmatter.scopes
328503
328571
  };
328504
- case "http": {
328505
- if (!frontmatter.scheme) {
328506
- throw new Error(
328507
- "Internal error: HTTP scheme missing after validation."
328508
- );
328509
- }
328572
+ case "http":
328510
328573
  if (frontmatter.value) {
328511
328574
  return {
328512
- ...base,
328513
328575
  type: "http",
328514
328576
  scheme: frontmatter.scheme,
328515
328577
  value: frontmatter.value
@@ -328517,38 +328579,23 @@ function convertFrontmatterAuthToConfig(frontmatter) {
328517
328579
  }
328518
328580
  switch (frontmatter.scheme) {
328519
328581
  case "Bearer":
328520
- if (!frontmatter.token) {
328521
- throw new Error(
328522
- "Internal error: Bearer token missing after validation."
328523
- );
328524
- }
328525
328582
  return {
328526
- ...base,
328527
328583
  type: "http",
328528
328584
  scheme: "Bearer",
328529
328585
  token: frontmatter.token
328530
328586
  };
328531
328587
  case "Basic":
328532
- if (!frontmatter.username || !frontmatter.password) {
328533
- throw new Error(
328534
- "Internal error: Basic auth credentials missing after validation."
328535
- );
328536
- }
328537
328588
  return {
328538
- ...base,
328539
328589
  type: "http",
328540
328590
  scheme: "Basic",
328541
328591
  username: frontmatter.username,
328542
328592
  password: frontmatter.password
328543
328593
  };
328544
- default: {
328594
+ default:
328545
328595
  throw new Error(`Unknown HTTP scheme: ${frontmatter.scheme}`);
328546
- }
328547
328596
  }
328548
- }
328549
328597
  case "oauth":
328550
328598
  return {
328551
- ...base,
328552
328599
  type: "oauth2",
328553
328600
  client_id: frontmatter.client_id,
328554
328601
  client_secret: frontmatter.client_secret,
@@ -328557,8 +328604,12 @@ function convertFrontmatterAuthToConfig(frontmatter) {
328557
328604
  token_url: frontmatter.token_url
328558
328605
  };
328559
328606
  default: {
328560
- const exhaustive = frontmatter.type;
328561
- throw new Error(`Unknown auth type: ${exhaustive}`);
328607
+ const exhaustive = frontmatter;
328608
+ const raw = exhaustive;
328609
+ if (typeof raw === "object" && raw !== null && "type" in raw) {
328610
+ throw new Error(`Unknown auth type: ${String(raw["type"])}`);
328611
+ }
328612
+ throw new Error("Unknown auth type");
328562
328613
  }
328563
328614
  }
328564
328615
  }
@@ -328577,20 +328628,31 @@ function markdownToAgentDefinition(markdown, metadata2) {
328577
328628
  }
328578
328629
  };
328579
328630
  if (markdown.kind === "remote") {
328580
- return {
328631
+ const base = {
328581
328632
  kind: "remote",
328582
328633
  name: markdown.name,
328583
328634
  description: markdown.description || "",
328584
328635
  displayName: markdown.display_name,
328585
- agentCardUrl: markdown.agent_card_url,
328586
328636
  auth: markdown.auth ? convertFrontmatterAuthToConfig(markdown.auth) : void 0,
328587
328637
  inputConfig,
328588
328638
  metadata: metadata2
328589
328639
  };
328640
+ if ("agent_card_json" in markdown && markdown.agent_card_json !== void 0) {
328641
+ base.agentCardJson = markdown.agent_card_json;
328642
+ return base;
328643
+ }
328644
+ if ("agent_card_url" in markdown && markdown.agent_card_url !== void 0) {
328645
+ base.agentCardUrl = markdown.agent_card_url;
328646
+ return base;
328647
+ }
328648
+ throw new AgentLoadError(
328649
+ metadata2?.filePath || "unknown",
328650
+ "Unexpected state: neither agent_card_json nor agent_card_url present on remote agent"
328651
+ );
328590
328652
  }
328591
328653
  const modelName = markdown.model || "inherit";
328592
328654
  const mcpServers = {};
328593
- if (markdown.kind === "local" && markdown.mcp_servers) {
328655
+ if (markdown.mcp_servers) {
328594
328656
  for (const [name3, config2] of Object.entries(markdown.mcp_servers)) {
328595
328657
  mcpServers[name3] = new MCPServerConfig(
328596
328658
  config2.command,
@@ -328647,14 +328709,13 @@ async function loadAgentsFromDirectory(dir) {
328647
328709
  try {
328648
328710
  dirEntries = await fs46.readdir(dir, { withFileTypes: true });
328649
328711
  } catch (error40) {
328650
- if (error40.code === "ENOENT") {
328712
+ if (error40 instanceof Error && "code" in error40 && error40.code === "ENOENT") {
328651
328713
  return result2;
328652
328714
  }
328653
328715
  result2.errors.push(
328654
328716
  new AgentLoadError(
328655
328717
  dir,
328656
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
328657
- `Could not list directory: ${error40.message}`
328718
+ `Could not list directory: ${getErrorMessage(error40)}`
328658
328719
  )
328659
328720
  );
328660
328721
  return result2;
@@ -328679,8 +328740,7 @@ async function loadAgentsFromDirectory(dir) {
328679
328740
  result2.errors.push(
328680
328741
  new AgentLoadError(
328681
328742
  filePath,
328682
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
328683
- `Unexpected error: ${error40.message}`
328743
+ `Unexpected error: ${getErrorMessage(error40)}`
328684
328744
  )
328685
328745
  );
328686
328746
  }
@@ -329820,7 +329880,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
329820
329880
  return provider;
329821
329881
  }
329822
329882
  case "oauth2": {
329823
- const { OAuth2AuthProvider } = await import("./oauth2-provider-VHUD4ICS.js");
329883
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-GQA3CRCL.js");
329824
329884
  const provider = new OAuth2AuthProvider(
329825
329885
  authConfig,
329826
329886
  options.agentName ?? "unknown",
@@ -330193,7 +330253,7 @@ var AgentRegistry = class {
330193
330253
  if (!agent.metadata) {
330194
330254
  agent.metadata = {};
330195
330255
  }
330196
- agent.metadata.hash = agent.agentCardUrl;
330256
+ agent.metadata.hash = agent.agentCardUrl ?? (agent.agentCardJson ? crypto17.createHash("sha256").update(agent.agentCardJson).digest("hex") : void 0);
330197
330257
  }
330198
330258
  if (!agent.metadata?.hash) {
330199
330259
  agentsToRegister.push(agent);
@@ -330405,12 +330465,13 @@ var AgentRegistry = class {
330405
330465
  );
330406
330466
  return;
330407
330467
  }
330468
+ const targetUrl = getRemoteAgentTargetUrl(remoteDef);
330408
330469
  let authHandler;
330409
330470
  if (definition.auth) {
330410
330471
  const provider = await A2AAuthProviderFactory.create({
330411
330472
  authConfig: definition.auth,
330412
330473
  agentName: definition.name,
330413
- targetUrl: definition.agentCardUrl,
330474
+ targetUrl,
330414
330475
  agentCardUrl: remoteDef.agentCardUrl
330415
330476
  });
330416
330477
  if (!provider) {
@@ -330422,7 +330483,7 @@ var AgentRegistry = class {
330422
330483
  }
330423
330484
  const agentCard = await clientManager.loadAgent(
330424
330485
  remoteDef.name,
330425
- remoteDef.agentCardUrl,
330486
+ getAgentCardLoadOptions(remoteDef),
330426
330487
  authHandler
330427
330488
  );
330428
330489
  if (agentCard.securitySchemes) {
@@ -330467,7 +330528,7 @@ ${skillsList}`);
330467
330528
  }
330468
330529
  if (this.config.getDebugMode()) {
330469
330530
  debugLogger.log(
330470
- `[AgentRegistry] Registered remote agent '${definition.name}' with card: ${definition.agentCardUrl}`
330531
+ `[AgentRegistry] Registered remote agent '${definition.name}' with card: ${definition.agentCardUrl ?? "inline JSON"}`
330471
330532
  );
330472
330533
  }
330473
330534
  this.agents.set(definition.name, definition);
@@ -334621,10 +334682,11 @@ var RemoteAgentInvocation = class _RemoteAgentInvocation extends BaseToolInvocat
334621
334682
  return this.authHandler;
334622
334683
  }
334623
334684
  if (this.definition.auth) {
334685
+ const targetUrl = getRemoteAgentTargetUrl(this.definition);
334624
334686
  const provider = await A2AAuthProviderFactory.create({
334625
334687
  authConfig: this.definition.auth,
334626
334688
  agentName: this.definition.name,
334627
- targetUrl: this.definition.agentCardUrl,
334689
+ targetUrl,
334628
334690
  agentCardUrl: this.definition.agentCardUrl
334629
334691
  });
334630
334692
  if (!provider) {
@@ -334675,7 +334737,7 @@ var RemoteAgentInvocation = class _RemoteAgentInvocation extends BaseToolInvocat
334675
334737
  if (!this.clientManager.getClient(this.definition.name)) {
334676
334738
  await this.clientManager.loadAgent(
334677
334739
  this.definition.name,
334678
- this.definition.agentCardUrl,
334740
+ getAgentCardLoadOptions(this.definition),
334679
334741
  authHandler
334680
334742
  );
334681
334743
  }
@@ -336951,7 +337013,7 @@ var InjectionService = class {
336951
337013
  // packages/core/src/policy/config.ts
336952
337014
  import * as fs53 from "node:fs/promises";
336953
337015
  import * as path68 from "node:path";
336954
- import * as crypto17 from "node:crypto";
337016
+ import * as crypto18 from "node:crypto";
336955
337017
  import { fileURLToPath as fileURLToPath17 } from "node:url";
336956
337018
 
336957
337019
  // packages/core/src/policy/toml-loader.ts
@@ -337883,7 +337945,7 @@ function createPolicyUpdater(policyEngine, messageBus, storage2) {
337883
337945
  }
337884
337946
  existingData.rule.push(newRule);
337885
337947
  const newContent = import_toml3.default.stringify(existingData);
337886
- const tmpSuffix = crypto17.randomBytes(8).toString("hex");
337948
+ const tmpSuffix = crypto18.randomBytes(8).toString("hex");
337887
337949
  const tmpFile = `${policyFile}.${tmpSuffix}.tmp`;
337888
337950
  let handle2;
337889
337951
  try {
@@ -339711,7 +339773,7 @@ import { pathToFileURL } from "node:url";
339711
339773
  import { randomUUID as randomUUID8 } from "node:crypto";
339712
339774
 
339713
339775
  // packages/core/src/mcp/oauth-provider.ts
339714
- import * as crypto19 from "node:crypto";
339776
+ import * as crypto20 from "node:crypto";
339715
339777
  import { URL as URL7 } from "node:url";
339716
339778
 
339717
339779
  // packages/core/src/mcp/oauth-token-storage.ts
@@ -339903,14 +339965,14 @@ var MCPOAuthTokenStorage = class {
339903
339965
 
339904
339966
  // packages/core/src/utils/oauth-flow.ts
339905
339967
  import * as http4 from "node:http";
339906
- import * as crypto18 from "node:crypto";
339968
+ import * as crypto19 from "node:crypto";
339907
339969
  import { URL as URL6 } from "node:url";
339908
339970
  var REDIRECT_PATH = "/oauth/callback";
339909
339971
  var HTTP_OK = 200;
339910
339972
  function generatePKCEParams() {
339911
- const codeVerifier = crypto18.randomBytes(64).toString("base64url");
339912
- const codeChallenge = crypto18.createHash("sha256").update(codeVerifier).digest("base64url");
339913
- const state = crypto18.randomBytes(16).toString("base64url");
339973
+ const codeVerifier = crypto19.randomBytes(64).toString("base64url");
339974
+ const codeChallenge = crypto19.createHash("sha256").update(codeVerifier).digest("base64url");
339975
+ const state = crypto19.randomBytes(16).toString("base64url");
339914
339976
  return { codeVerifier, codeChallenge, state };
339915
339977
  }
339916
339978
  function startCallbackServer(expectedState, port) {
@@ -340516,7 +340578,7 @@ ${authUrl}
340516
340578
  debugLogger.debug("\u2713 Authentication successful! Token saved.");
340517
340579
  const savedToken = await this.tokenStorage.getCredentials(serverName);
340518
340580
  if (savedToken && savedToken.token && savedToken.token.accessToken) {
340519
- const tokenFingerprint = crypto19.createHash("sha256").update(savedToken.token.accessToken).digest("hex").slice(0, 8);
340581
+ const tokenFingerprint = crypto20.createHash("sha256").update(savedToken.token.accessToken).digest("hex").slice(0, 8);
340520
340582
  debugLogger.debug(
340521
340583
  `\u2713 Token verification successful (fingerprint: ${tokenFingerprint})`
340522
340584
  );
@@ -342149,7 +342211,7 @@ function isEnabled(funcDecl, mcpServerName, mcpServerConfig) {
342149
342211
  }
342150
342212
 
342151
342213
  // packages/core/src/tools/mcp-client-manager.ts
342152
- import { createHash as createHash8 } from "node:crypto";
342214
+ import { createHash as createHash9 } from "node:crypto";
342153
342215
  var McpClientManager = class {
342154
342216
  clients = /* @__PURE__ */ new Map();
342155
342217
  // Track all configured servers (including disabled ones) for UI display
@@ -342352,7 +342414,7 @@ var McpClientManager = class {
342352
342414
  config: rest,
342353
342415
  extensionId: extension?.id
342354
342416
  };
342355
- return createHash8("sha256").update(stableStringify(keyData)).digest("hex");
342417
+ return createHash9("sha256").update(stableStringify(keyData)).digest("hex");
342356
342418
  }
342357
342419
  /**
342358
342420
  * Merges two MCP configurations. The second configuration (override)
@@ -350277,7 +350339,7 @@ var A2AClientManager = class {
350277
350339
  * @param authHandler Optional authentication handler to use for this agent.
350278
350340
  * @returns The loaded AgentCard.
350279
350341
  */
350280
- async loadAgent(name3, agentCardUrl, authHandler) {
350342
+ async loadAgent(name3, options, authHandler) {
350281
350343
  if (this.clients.has(name3) && this.agentCards.has(name3)) {
350282
350344
  throw new Error(`Agent with name '${name3}' is already loaded.`);
350283
350345
  }
@@ -350296,7 +350358,21 @@ var A2AClientManager = class {
350296
350358
  return response;
350297
350359
  };
350298
350360
  const resolver = new DefaultAgentCardResolver({ fetchImpl: cardFetch });
350299
- const rawCard = await resolver.resolve(agentCardUrl, "");
350361
+ let rawCard;
350362
+ let urlIdentifier = "inline JSON";
350363
+ if (options.type === "json") {
350364
+ try {
350365
+ rawCard = JSON.parse(options.json);
350366
+ } catch (error40) {
350367
+ const msg = error40 instanceof Error ? error40.message : String(error40);
350368
+ throw new Error(
350369
+ `Failed to parse inline agent card JSON for agent '${name3}': ${msg}`
350370
+ );
350371
+ }
350372
+ } else {
350373
+ urlIdentifier = options.url;
350374
+ rawCard = await resolver.resolve(options.url, "");
350375
+ }
350300
350376
  const agentCard = normalizeAgentCard(rawCard);
350301
350377
  const grpcUrl = agentCard.additionalInterfaces?.find((i3) => i3.transport === "GRPC")?.url ?? agentCard.url;
350302
350378
  const clientOptions = ClientFactoryOptions.createFrom(
@@ -350318,11 +350394,11 @@ var A2AClientManager = class {
350318
350394
  this.clients.set(name3, client);
350319
350395
  this.agentCards.set(name3, agentCard);
350320
350396
  debugLogger.debug(
350321
- `[A2AClientManager] Loaded agent '${name3}' from ${agentCardUrl}`
350397
+ `[A2AClientManager] Loaded agent '${name3}' from ${urlIdentifier}`
350322
350398
  );
350323
350399
  return agentCard;
350324
350400
  } catch (error40) {
350325
- throw classifyAgentError(name3, agentCardUrl, error40);
350401
+ throw classifyAgentError(name3, urlIdentifier, error40);
350326
350402
  }
350327
350403
  }
350328
350404
  /**
@@ -352779,7 +352855,7 @@ var StreamJsonFormatter = class {
352779
352855
  };
352780
352856
 
352781
352857
  // packages/core/src/policy/integrity.ts
352782
- import * as crypto20 from "node:crypto";
352858
+ import * as crypto21 from "node:crypto";
352783
352859
  import * as fs58 from "node:fs/promises";
352784
352860
  import * as path73 from "node:path";
352785
352861
  var IntegrityStatus = /* @__PURE__ */ ((IntegrityStatus2) => {
@@ -352834,7 +352910,7 @@ var PolicyIntegrityManager = class _PolicyIntegrityManager {
352834
352910
  try {
352835
352911
  const files = await readPolicyFiles(policyDir);
352836
352912
  files.sort((a2, b) => a2.path.localeCompare(b.path));
352837
- const hash = crypto20.createHash("sha256");
352913
+ const hash = crypto21.createHash("sha256");
352838
352914
  for (const file2 of files) {
352839
352915
  const relativePath = path73.relative(policyDir, file2.path);
352840
352916
  hash.update(relativePath);
@@ -352885,7 +352961,7 @@ var PolicyIntegrityManager = class _PolicyIntegrityManager {
352885
352961
  import * as fs59 from "node:fs";
352886
352962
  import * as path74 from "node:path";
352887
352963
  import {
352888
- createHash as createHash10,
352964
+ createHash as createHash11,
352889
352965
  createHmac,
352890
352966
  randomBytes as randomBytes6,
352891
352967
  timingSafeEqual
@@ -353028,7 +353104,7 @@ var ExtensionIntegrityStore = class {
353028
353104
  */
353029
353105
  generateHash(metadata2) {
353030
353106
  const content = (0, import_json_stable_stringify.default)(metadata2) ?? "";
353031
- return createHash10("sha256").update(content).digest("hex");
353107
+ return createHash11("sha256").update(content).digest("hex");
353032
353108
  }
353033
353109
  /**
353034
353110
  * Generates an HMAC-SHA256 signature using the master secret key.
@@ -354012,11 +354088,11 @@ var import_fdir = __toESM(require_dist9(), 1);
354012
354088
  import path77 from "node:path";
354013
354089
 
354014
354090
  // packages/core/src/utils/filesearch/crawlCache.ts
354015
- import crypto21 from "node:crypto";
354091
+ import crypto22 from "node:crypto";
354016
354092
  var crawlCache = /* @__PURE__ */ new Map();
354017
354093
  var cacheTimers = /* @__PURE__ */ new Map();
354018
354094
  var getCacheKey = (directory, ignoreContent, maxDepth) => {
354019
- const hash = crypto21.createHash("sha256");
354095
+ const hash = crypto22.createHash("sha256");
354020
354096
  hash.update(directory);
354021
354097
  hash.update(ignoreContent);
354022
354098
  if (maxDepth !== void 0) {
@@ -358335,6 +358411,8 @@ export {
358335
358411
  SUBAGENT_CANCELLED_ERROR_MESSAGE,
358336
358412
  isSubagentProgress,
358337
358413
  isToolActivityError,
358414
+ getAgentCardLoadOptions,
358415
+ getRemoteAgentTargetUrl,
358338
358416
  FRONTMATTER_REGEX,
358339
358417
  loadSkillsFromDir,
358340
358418
  loadSkillFromFile,