@adcp/sdk 6.15.0 → 6.15.1

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.
@@ -36,6 +36,19 @@ async function detectA2AOrMcp(url, timeoutMs) {
36
36
  if (url.endsWith('/mcp/') || url.endsWith('/mcp')) {
37
37
  return 'mcp';
38
38
  }
39
+ // adcp-client#1612: classify each well-known card probe into one of three
40
+ // signals so we can distinguish "this is A2A but momentarily 503" from
41
+ // "this is not A2A":
42
+ // - `confirm` : 200/3xx — A2A confirmed
43
+ // - `suspect` : 5xx or transport error — host knows the path but can't
44
+ // serve it right now; still strong evidence of A2A. Falling
45
+ // back to MCP here is what produced the original #1612
46
+ // symptom (425s of MCP retries against an A2A root).
47
+ // - `negative` : 4xx (other than 401/403/429) — host doesn't recognize
48
+ // the well-known path; MCP is the better default.
49
+ // 401/403/429 are auth/rate signals on the well-known path itself, which
50
+ // also indicate "host knows the path" → suspect.
51
+ let suspect = false;
39
52
  for (const path of a2a_discovery_1.A2A_CARD_PATHS) {
40
53
  try {
41
54
  const discoveryUrl = new URL(path, url);
@@ -52,11 +65,21 @@ async function detectA2AOrMcp(url, timeoutMs) {
52
65
  if (response.ok) {
53
66
  return 'a2a';
54
67
  }
68
+ // 5xx or auth-on-the-path: treat as A2A suspicion (host has this route
69
+ // but couldn't return the card right now). Don't return immediately —
70
+ // a later path might confirm with a 200.
71
+ if (response.status >= 500 || response.status === 401 || response.status === 403 || response.status === 429) {
72
+ suspect = true;
73
+ }
74
+ // 4xx (other than the above): negative evidence, leave suspect alone.
55
75
  }
56
- catch (error) {
57
- // Fetch failed - try next path
76
+ catch {
77
+ // Network error or our 5s timeout fired. The host may still be A2A
78
+ // (just slow); upgrade suspicion so we don't fall back to MCP and
79
+ // burn the caller's discovery budget on a non-MCP root.
80
+ suspect = true;
58
81
  }
59
82
  }
60
- return 'mcp';
83
+ return suspect ? 'a2a' : 'mcp';
61
84
  }
62
85
  //# sourceMappingURL=protocol-detection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-detection.js","sourceRoot":"","sources":["../../../src/lib/utils/protocol-detection.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAeH,wCAEC;AASD,8DAEC;AA1BD,mDAAiD;AAEjD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,OAAO,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,yBAAyB,CAAC,GAAW,EAAE,YAAoB,IAAI;IACnF,OAAO,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AACxC,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,SAAiB;IAC1D,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,8BAAc,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACxC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;YACzC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;YAElE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE;gBACpD,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,OAAO,EAAE;oBACP,MAAM,EAAE,uBAAuB;iBAChC;aACF,CAAC,CAAC;YAEH,YAAY,CAAC,SAAS,CAAC,CAAC;YAExB,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,+BAA+B;QACjC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"protocol-detection.js","sourceRoot":"","sources":["../../../src/lib/utils/protocol-detection.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAeH,wCAEC;AASD,8DAEC;AA1BD,mDAAiD;AAEjD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,OAAO,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,yBAAyB,CAAC,GAAW,EAAE,YAAoB,IAAI;IACnF,OAAO,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AACxC,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,SAAiB;IAC1D,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0EAA0E;IAC1E,uEAAuE;IACvE,qBAAqB;IACrB,2CAA2C;IAC3C,0EAA0E;IAC1E,6EAA6E;IAC7E,wEAAwE;IACxE,sEAAsE;IACtE,yEAAyE;IACzE,mEAAmE;IACnE,yEAAyE;IACzE,iDAAiD;IACjD,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,8BAAc,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACxC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;YACzC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;YAElE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE;gBACpD,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,OAAO,EAAE;oBACP,MAAM,EAAE,uBAAuB;iBAChC;aACF,CAAC,CAAC;YAEH,YAAY,CAAC,SAAS,CAAC,CAAC;YAExB,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,OAAO,KAAK,CAAC;YACf,CAAC;YACD,uEAAuE;YACvE,sEAAsE;YACtE,yCAAyC;YACzC,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC5G,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;YACD,sEAAsE;QACxE,CAAC;QAAC,MAAM,CAAC;YACP,mEAAmE;YACnE,kEAAkE;YAClE,wDAAwD;YACxD,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACjC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "6.15.0";
4
+ export declare const LIBRARY_VERSION = "6.15.1";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -29,10 +29,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
29
29
  * Full version information
30
30
  */
31
31
  export declare const VERSION_INFO: {
32
- readonly library: "6.15.0";
32
+ readonly library: "6.15.1";
33
33
  readonly adcp: "3.0.8";
34
34
  readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0-beta.1", "3.0.0-beta.3", "3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8"];
35
- readonly generatedAt: "2026-05-08T17:50:20.998Z";
35
+ readonly generatedAt: "2026-05-09T13:21:46.607Z";
36
36
  };
37
37
  /**
38
38
  * Get the AdCP specification version this library is built for
@@ -11,7 +11,7 @@ exports.parseAdcpMajorVersion = parseAdcpMajorVersion;
11
11
  /**
12
12
  * AdCP SDK library version
13
13
  */
14
- exports.LIBRARY_VERSION = '6.15.0';
14
+ exports.LIBRARY_VERSION = '6.15.1';
15
15
  /**
16
16
  * AdCP specification version this library is built for
17
17
  */
@@ -45,10 +45,10 @@ exports.COMPATIBLE_ADCP_VERSIONS = [
45
45
  * Full version information
46
46
  */
47
47
  exports.VERSION_INFO = {
48
- library: '6.15.0',
48
+ library: '6.15.1',
49
49
  adcp: '3.0.8',
50
50
  compatibleVersions: exports.COMPATIBLE_ADCP_VERSIONS,
51
- generatedAt: '2026-05-08T17:50:20.998Z',
51
+ generatedAt: '2026-05-09T13:21:46.607Z',
52
52
  };
53
53
  /**
54
54
  * Get the AdCP specification version this library is built for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adcp/sdk",
3
- "version": "6.15.0",
3
+ "version": "6.15.1",
4
4
  "description": "AdCP SDK — client, server, and compliance harnesses for the AdContext Protocol (MCP + A2A)",
5
5
  "workspaces": [
6
6
  ".",