@integrity-labs/agt-cli 0.26.2-eng5706.1 → 0.26.2

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.
@@ -5675,6 +5675,18 @@ function buildMcpServers(input) {
5675
5675
  const mcpUrl = config["mcp_server_url"];
5676
5676
  if (!mcpUrl)
5677
5677
  continue;
5678
+ const scopePrefix = integration.scope === "team" ? "team" : "agent";
5679
+ const name = `${scopePrefix}-${integration.definition_id.replace(/[^a-z0-9-]/gi, "-").toLowerCase()}`;
5680
+ const preformed = config["mcp_headers"];
5681
+ if (preformed && typeof preformed === "object") {
5682
+ servers.push({
5683
+ type: "url",
5684
+ name,
5685
+ url: mcpUrl,
5686
+ ...Object.keys(preformed).length > 0 ? { headers: preformed } : {}
5687
+ });
5688
+ continue;
5689
+ }
5678
5690
  const connectedAccountId = integration.credentials["connected_account_id"];
5679
5691
  const apiKey = integration.credentials["api_key"];
5680
5692
  const headers = {};
@@ -5684,7 +5696,7 @@ function buildMcpServers(input) {
5684
5696
  headers["X-Connected-Account-Id"] = String(connectedAccountId);
5685
5697
  servers.push({
5686
5698
  type: "url",
5687
- name: integration.definition_id.replace(/[^a-z0-9-]/gi, "-").toLowerCase(),
5699
+ name,
5688
5700
  url: mcpUrl,
5689
5701
  ...Object.keys(headers).length > 0 ? { headers } : {}
5690
5702
  });
@@ -5963,8 +5975,9 @@ var ApiError = class extends Error {
5963
5975
  this.name = "ApiError";
5964
5976
  }
5965
5977
  };
5966
- async function fetchWithRetry(path, method, body) {
5967
- const headers = await buildHeaders();
5978
+ async function fetchWithRetry(path, method, body, extraHeaders) {
5979
+ const baseHeaders = await buildHeaders();
5980
+ const headers = extraHeaders ? { ...baseHeaders, ...extraHeaders } : baseHeaders;
5968
5981
  const url = `${requireHost()}${path}`;
5969
5982
  const init = {
5970
5983
  method,
@@ -5974,7 +5987,8 @@ async function fetchWithRetry(path, method, body) {
5974
5987
  const res = await fetch(url, init);
5975
5988
  if (res.status === 401) {
5976
5989
  invalidateExchange();
5977
- const freshHeaders = await buildHeaders();
5990
+ const freshBase = await buildHeaders();
5991
+ const freshHeaders = extraHeaders ? { ...freshBase, ...extraHeaders } : freshBase;
5978
5992
  return fetch(url, { ...init, headers: freshHeaders });
5979
5993
  }
5980
5994
  return res;
@@ -5991,8 +6005,8 @@ var api = {
5991
6005
  const res = await fetchWithRetry(path, "GET");
5992
6006
  return handleResponse(res);
5993
6007
  },
5994
- async post(path, body) {
5995
- const res = await fetchWithRetry(path, "POST", body);
6008
+ async post(path, body, extraHeaders) {
6009
+ const res = await fetchWithRetry(path, "POST", body, extraHeaders);
5996
6010
  return handleResponse(res);
5997
6011
  },
5998
6012
  async patch(path, body) {
@@ -6680,4 +6694,4 @@ export {
6680
6694
  managerInstallSystemUnitCommand,
6681
6695
  managerUninstallSystemUnitCommand
6682
6696
  };
6683
- //# sourceMappingURL=chunk-LBYU24PW.js.map
6697
+ //# sourceMappingURL=chunk-4CESBZPM.js.map