@cyanheads/browser-compat-mcp-server 0.3.0 → 0.3.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.
- package/AGENTS.md +7 -7
- package/CLAUDE.md +7 -7
- package/README.md +12 -12
- package/THIRD_PARTY_NOTICES.md +7 -7
- package/changelog/0.3.x/0.3.1.md +36 -0
- package/changelog/0.3.x/0.3.2.md +39 -0
- package/changelog/template.md +20 -11
- package/dist/data/browserslist-bcd-map.d.ts +7 -6
- package/dist/data/browserslist-bcd-map.d.ts.map +1 -1
- package/dist/data/browserslist-bcd-map.js +7 -6
- package/dist/data/browserslist-bcd-map.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.d.ts +1 -0
- package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.js +31 -7
- package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.d.ts +13 -2
- package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.js +134 -71
- package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.js +17 -42
- package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.js.map +1 -1
- package/dist/services/bcd/bcd-service.d.ts +10 -3
- package/dist/services/bcd/bcd-service.d.ts.map +1 -1
- package/dist/services/bcd/bcd-service.js +25 -4
- package/dist/services/bcd/bcd-service.js.map +1 -1
- package/dist/services/targets/targets-service.d.ts +32 -11
- package/dist/services/targets/targets-service.d.ts.map +1 -1
- package/dist/services/targets/targets-service.js +92 -25
- package/dist/services/targets/targets-service.js.map +1 -1
- package/dist/services/targets/types.d.ts +23 -6
- package/dist/services/targets/types.d.ts.map +1 -1
- package/package.json +14 -14
- package/server.json +3 -3
- package/skills/browser-compat-guide/SKILL.md +5 -3
|
@@ -12,12 +12,18 @@ import type { TargetResolution } from './types.js';
|
|
|
12
12
|
* agent of the bundled caniuse-lite, to one decimal, derived on dataset load.
|
|
13
13
|
*/
|
|
14
14
|
export declare const CANIUSE_TRACKED_PERCENT: number;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
15
|
+
/** Audience named alongside a usage figure. */
|
|
16
|
+
export declare function usageAudience(region?: string): string;
|
|
17
|
+
/** CC BY 4.0 attribution for global usage figures, used verbatim. */
|
|
19
18
|
export declare const CANIUSE_ATTRIBUTION: string;
|
|
20
19
|
type BrowserslistFn = typeof import('browserslist');
|
|
20
|
+
/** Global traffic a feature excludes, and the part of it a vendor prefix recovers. */
|
|
21
|
+
export interface ExcludedUsage {
|
|
22
|
+
/** Percentage points of global traffic without default, unprefixed, enabled support. */
|
|
23
|
+
excludedPercent: number;
|
|
24
|
+
/** Of `excludedPercent`, the points where the feature works only with a vendor prefix. */
|
|
25
|
+
prefixedPercent: number;
|
|
26
|
+
}
|
|
21
27
|
/** Query resolution and usage weighting over browserslist plus caniuse-lite. */
|
|
22
28
|
export declare class TargetsService {
|
|
23
29
|
readonly agents: Record<string, CaniuseAgent | undefined>;
|
|
@@ -27,7 +33,7 @@ export declare class TargetsService {
|
|
|
27
33
|
private readonly unpacked;
|
|
28
34
|
private readonly usageTotals;
|
|
29
35
|
constructor(browserslistFn: BrowserslistFn, agents: Record<string, CaniuseAgent | undefined>, packedFeatures: Record<string, unknown>, unpack: (packed: unknown) => CaniuseFeature);
|
|
30
|
-
/** Every caniuse agent id the
|
|
36
|
+
/** Every bundled caniuse agent id, plus the Node.js target supported by browserslist. */
|
|
31
37
|
agentIds(): string[];
|
|
32
38
|
/** Percentage points of global traffic attributed to one agent across all its versions. */
|
|
33
39
|
agentUsageTotal(agentId: string): number;
|
|
@@ -40,19 +46,34 @@ export declare class TargetsService {
|
|
|
40
46
|
* depends on the query alone and never on the process working directory.
|
|
41
47
|
*/
|
|
42
48
|
queryTokens(query: string): string[];
|
|
43
|
-
/**
|
|
44
|
-
|
|
49
|
+
/** Validate a bundled region and derive attribution from its complete usage table. */
|
|
50
|
+
regionalUsage(input: string): {
|
|
51
|
+
region: string;
|
|
52
|
+
attribution: string;
|
|
53
|
+
};
|
|
54
|
+
/** Real caniuse-derived market coverage of a token list, global or for a validated region. */
|
|
55
|
+
coverage(tokens: string[], usageRegion?: string): number;
|
|
45
56
|
/**
|
|
46
57
|
* Split browserslist tokens into targets that map onto a concrete BCD release
|
|
47
|
-
* and targets the server declines to evaluate, with the reason for each.
|
|
58
|
+
* and targets the server declines to evaluate, with the reason for each. A
|
|
59
|
+
* grouped token such as `ios_saf 15.0-15.1` maps each endpoint as a single
|
|
60
|
+
* token would, and spans every BCD release from the lower one's through the
|
|
61
|
+
* upper one's.
|
|
48
62
|
*/
|
|
49
|
-
resolveTargets(tokens: string[]): Promise<TargetResolution>;
|
|
63
|
+
resolveTargets(tokens: string[], usageRegion?: string): Promise<TargetResolution>;
|
|
50
64
|
/**
|
|
51
65
|
* Percentage points of global traffic that requiring a feature would exclude:
|
|
52
|
-
* every agent/version pair
|
|
66
|
+
* every agent/version pair where some mapped caniuse stat is not `y`, or
|
|
67
|
+
* carries `x` (prefix required) or `d` (disabled by default). Partial,
|
|
68
|
+
* polyfilled, unknown, and missing stats all exclude. `prefixedPercent` is
|
|
69
|
+
* the excluded share where every stat is `y` without `d` and at least one
|
|
70
|
+
* needs the prefix. `spelledWithPrefix` marks a feature whose own name carries
|
|
71
|
+
* the prefix, so `x` describes it as written and counts as supported. Returns
|
|
53
72
|
* `undefined` when the feature reaches no caniuse id — never zero.
|
|
54
73
|
*/
|
|
55
|
-
excludedUsage(caniuseIds: string[]
|
|
74
|
+
excludedUsage(caniuseIds: string[], { spelledWithPrefix }?: {
|
|
75
|
+
spelledWithPrefix?: boolean;
|
|
76
|
+
}): ExcludedUsage | undefined;
|
|
56
77
|
}
|
|
57
78
|
/** Promise-memoized accessor — the first caller pays the load, everyone else awaits it. */
|
|
58
79
|
export declare function getTargetsService(): Promise<TargetsService>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"targets-service.d.ts","sourceRoot":"","sources":["../../../src/services/targets/targets-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIjE,OAAO,KAAK,EAAkB,gBAAgB,EAAmB,MAAM,YAAY,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAQnC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"targets-service.d.ts","sourceRoot":"","sources":["../../../src/services/targets/targets-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIjE,OAAO,KAAK,EAAkB,gBAAgB,EAAmB,MAAM,YAAY,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAQnC,CAAC;AAEF,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD;AAQD,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,QAA4C,CAAC;AAc7E,KAAK,cAAc,GAAG,cAAc,cAAc,CAAC,CAAC;AAEpD,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,wFAAwF;IACxF,eAAe,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,eAAe,EAAE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EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgDtF;IAED;;;;;;;;;OASG;IACH,aAAa,CACX,UAAU,EAAE,MAAM,EAAE,EACpB,EAAE,iBAAyB,EAAE,GAAE;QAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAO,GAClE,aAAa,GAAG,SAAS,CA2B3B;CACF;AAkBD,2FAA2F;AAC3F,wBAAgB,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC,CAG3D"}
|
|
@@ -16,11 +16,17 @@ import { getBcdService } from '../bcd/bcd-service.js';
|
|
|
16
16
|
export const CANIUSE_TRACKED_PERCENT = Number(Object.values(bundledAgents)
|
|
17
17
|
.reduce((sum, agent) => sum + Object.values(agent?.usage_global ?? {}).reduce((total, usage) => total + usage, 0), 0)
|
|
18
18
|
.toFixed(1));
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
/** Audience named alongside a usage figure. */
|
|
20
|
+
export function usageAudience(region) {
|
|
21
|
+
return region === undefined ? 'global traffic' : `traffic in ${region}`;
|
|
22
|
+
}
|
|
23
|
+
/** Credit caniuse and describe the denominator, including the untracked share. */
|
|
24
|
+
function usageAttribution(trackedPercent, region) {
|
|
25
|
+
const audience = usageAudience(region);
|
|
26
|
+
return `Usage data from caniuse.com, © Can I Use contributors, CC BY 4.0. Figures are percentage points of ${audience}. The bundled data tracks ~${trackedPercent}% of ${audience}; the remainder is untracked and unknown.`;
|
|
27
|
+
}
|
|
28
|
+
/** CC BY 4.0 attribution for global usage figures, used verbatim. */
|
|
29
|
+
export const CANIUSE_ATTRIBUTION = usageAttribution(CANIUSE_TRACKED_PERCENT);
|
|
24
30
|
/** Round a percentage to a stable precision so repeated calls agree byte for byte. */
|
|
25
31
|
function percent(value) {
|
|
26
32
|
return Number(value.toFixed(4));
|
|
@@ -29,6 +35,19 @@ function percent(value) {
|
|
|
29
35
|
function isBrowserslistError(error) {
|
|
30
36
|
return (error instanceof Error && error.browserslist === true);
|
|
31
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* How one caniuse stat answers "does it work by default?". Stats lead with the
|
|
40
|
+
* support letter, then flags (`x` prefix required, `d` disabled by default),
|
|
41
|
+
* then `#n` note markers, which do not affect support.
|
|
42
|
+
*/
|
|
43
|
+
function statSupport(stat) {
|
|
44
|
+
if (stat === undefined)
|
|
45
|
+
return 'none';
|
|
46
|
+
const [letter, ...flags] = stat.split(' ');
|
|
47
|
+
if (letter !== 'y' || flags.includes('d'))
|
|
48
|
+
return 'none';
|
|
49
|
+
return flags.includes('x') ? 'prefixed' : 'default';
|
|
50
|
+
}
|
|
32
51
|
/** Query resolution and usage weighting over browserslist plus caniuse-lite. */
|
|
33
52
|
export class TargetsService {
|
|
34
53
|
agents;
|
|
@@ -43,9 +62,9 @@ export class TargetsService {
|
|
|
43
62
|
this.packedFeatures = packedFeatures;
|
|
44
63
|
this.unpack = unpack;
|
|
45
64
|
}
|
|
46
|
-
/** Every caniuse agent id the
|
|
65
|
+
/** Every bundled caniuse agent id, plus the Node.js target supported by browserslist. */
|
|
47
66
|
agentIds() {
|
|
48
|
-
return Object.keys(this.agents);
|
|
67
|
+
return [...Object.keys(this.agents), 'node'];
|
|
49
68
|
}
|
|
50
69
|
/** Percentage points of global traffic attributed to one agent across all its versions. */
|
|
51
70
|
agentUsageTotal(agentId) {
|
|
@@ -95,17 +114,42 @@ export class TargetsService {
|
|
|
95
114
|
throw validationError(error.message, { reason: 'invalid_target_query' }, { cause: error });
|
|
96
115
|
}
|
|
97
116
|
}
|
|
98
|
-
/**
|
|
99
|
-
|
|
117
|
+
/** Validate a bundled region and derive attribution from its complete usage table. */
|
|
118
|
+
regionalUsage(input) {
|
|
119
|
+
const code = input.trim();
|
|
120
|
+
if (!/^(?:[a-z]{2}|alt-[a-z]{2})$/i.test(code)) {
|
|
121
|
+
throw validationError('Invalid usage region code.', { reason: 'unknown_region' });
|
|
122
|
+
}
|
|
123
|
+
const region = code.length === 2 ? code.toUpperCase() : code.toLowerCase();
|
|
124
|
+
try {
|
|
125
|
+
// Browserslist loads the bundled region even for an empty token list.
|
|
126
|
+
this.browserslist.coverage([], region);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
if (!isBrowserslistError(error))
|
|
130
|
+
throw error;
|
|
131
|
+
throw validationError(error.message, { reason: 'unknown_region' }, { cause: error });
|
|
132
|
+
}
|
|
133
|
+
const usage = this.browserslist.usage[region];
|
|
134
|
+
if (usage == null)
|
|
135
|
+
throw new Error(`Browserslist did not load usage for ${region}`);
|
|
136
|
+
const tracked = Object.values(usage).reduce((total, value) => total + value, 0);
|
|
137
|
+
return { region, attribution: usageAttribution(Number(tracked.toFixed(1)), region) };
|
|
138
|
+
}
|
|
139
|
+
/** Real caniuse-derived market coverage of a token list, global or for a validated region. */
|
|
140
|
+
coverage(tokens, usageRegion) {
|
|
100
141
|
if (tokens.length === 0)
|
|
101
142
|
return 0;
|
|
102
|
-
return percent(this.browserslist.coverage(tokens));
|
|
143
|
+
return percent(this.browserslist.coverage(tokens, usageRegion));
|
|
103
144
|
}
|
|
104
145
|
/**
|
|
105
146
|
* Split browserslist tokens into targets that map onto a concrete BCD release
|
|
106
|
-
* and targets the server declines to evaluate, with the reason for each.
|
|
147
|
+
* and targets the server declines to evaluate, with the reason for each. A
|
|
148
|
+
* grouped token such as `ios_saf 15.0-15.1` maps each endpoint as a single
|
|
149
|
+
* token would, and spans every BCD release from the lower one's through the
|
|
150
|
+
* upper one's.
|
|
107
151
|
*/
|
|
108
|
-
async resolveTargets(tokens) {
|
|
152
|
+
async resolveTargets(tokens, usageRegion) {
|
|
109
153
|
const bcd = await getBcdService();
|
|
110
154
|
const resolved = [];
|
|
111
155
|
const unchecked = [];
|
|
@@ -119,57 +163,80 @@ export class TargetsService {
|
|
|
119
163
|
agent,
|
|
120
164
|
version_token: versionToken,
|
|
121
165
|
reason: 'no_bcd_browser',
|
|
122
|
-
usage_percent: this.coverage([token]),
|
|
166
|
+
usage_percent: this.coverage([token], usageRegion),
|
|
123
167
|
});
|
|
124
168
|
continue;
|
|
125
169
|
}
|
|
126
|
-
const version = bcd.
|
|
127
|
-
|
|
170
|
+
const version = bcd.resolveQueryTargetVersion(bcdBrowser, versionToken);
|
|
171
|
+
const dash = versionToken.indexOf('-');
|
|
172
|
+
const upper = dash > 0
|
|
173
|
+
? bcd.resolveQueryTargetVersion(bcdBrowser, versionToken.slice(dash + 1))
|
|
174
|
+
: version;
|
|
175
|
+
if (!version.resolved || !upper.resolved) {
|
|
128
176
|
unchecked.push({
|
|
129
177
|
agent,
|
|
130
178
|
version_token: versionToken,
|
|
131
179
|
reason: 'unknown_version',
|
|
132
|
-
usage_percent: this.coverage([token]),
|
|
180
|
+
usage_percent: this.coverage([token], usageRegion),
|
|
133
181
|
});
|
|
134
182
|
continue;
|
|
135
183
|
}
|
|
184
|
+
const later = bcd
|
|
185
|
+
.releasesBetween(bcdBrowser, version.index, upper.index)
|
|
186
|
+
.map((release) => ({ index: release.index, version: release.version }));
|
|
136
187
|
resolved.push({
|
|
137
188
|
agent,
|
|
138
189
|
version_token: versionToken,
|
|
139
190
|
bcd_browser: bcdBrowser,
|
|
140
191
|
bcd_version: version.version,
|
|
141
192
|
bcd_release_index: version.index,
|
|
193
|
+
span: [{ index: version.index, version: version.version }, ...later],
|
|
142
194
|
});
|
|
143
195
|
}
|
|
144
196
|
return { resolved, unchecked };
|
|
145
197
|
}
|
|
146
198
|
/**
|
|
147
199
|
* Percentage points of global traffic that requiring a feature would exclude:
|
|
148
|
-
* every agent/version pair
|
|
200
|
+
* every agent/version pair where some mapped caniuse stat is not `y`, or
|
|
201
|
+
* carries `x` (prefix required) or `d` (disabled by default). Partial,
|
|
202
|
+
* polyfilled, unknown, and missing stats all exclude. `prefixedPercent` is
|
|
203
|
+
* the excluded share where every stat is `y` without `d` and at least one
|
|
204
|
+
* needs the prefix. `spelledWithPrefix` marks a feature whose own name carries
|
|
205
|
+
* the prefix, so `x` describes it as written and counts as supported. Returns
|
|
149
206
|
* `undefined` when the feature reaches no caniuse id — never zero.
|
|
150
207
|
*/
|
|
151
|
-
excludedUsage(caniuseIds) {
|
|
208
|
+
excludedUsage(caniuseIds, { spelledWithPrefix = false } = {}) {
|
|
152
209
|
const features = caniuseIds
|
|
153
210
|
.map((id) => this.caniuseFeature(id))
|
|
154
211
|
.filter((feature) => feature !== undefined);
|
|
155
212
|
if (features.length === 0)
|
|
156
213
|
return undefined;
|
|
157
214
|
let excluded = 0;
|
|
215
|
+
let prefixed = 0;
|
|
158
216
|
for (const [agentId, agent] of Object.entries(this.agents)) {
|
|
159
217
|
if (!agent)
|
|
160
218
|
continue;
|
|
161
219
|
for (const [version, usage] of Object.entries(agent.usage_global)) {
|
|
162
220
|
if (usage === 0)
|
|
163
221
|
continue;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
222
|
+
let cell = 'default';
|
|
223
|
+
for (const feature of features) {
|
|
224
|
+
const support = statSupport(feature.stats[agentId]?.[version]);
|
|
225
|
+
if (support === 'none') {
|
|
226
|
+
cell = 'none';
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
if (support === 'prefixed' && !spelledWithPrefix)
|
|
230
|
+
cell = 'prefixed';
|
|
231
|
+
}
|
|
232
|
+
if (cell === 'default')
|
|
233
|
+
continue;
|
|
234
|
+
excluded += usage;
|
|
235
|
+
if (cell === 'prefixed')
|
|
236
|
+
prefixed += usage;
|
|
170
237
|
}
|
|
171
238
|
}
|
|
172
|
-
return percent(excluded);
|
|
239
|
+
return { excludedPercent: percent(excluded), prefixedPercent: percent(prefixed) };
|
|
173
240
|
}
|
|
174
241
|
}
|
|
175
242
|
let servicePromise;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"targets-service.js","sourceRoot":"","sources":["../../../src/services/targets/targets-service.ts"],"names":[],"mappings":"AAAA;;;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,UAAU,CAAC;gBACtE,CAAC;gBACD,IAAI,IAAI,KAAK,SAAS;oBAAE,SAAS;gBACjC,QAAQ,IAAI,KAAK,CAAC;gBAClB,IAAI,IAAI,KAAK,UAAU;oBAAE,QAAQ,IAAI,KAAK,CAAC;YAC7C,CAAC;QACH,CAAC;QACD,OAAO,EAAE,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACpF,CAAC;CACF;AAED,IAAI,cAAmD,CAAC;AAExD,mEAAmE;AACnE,KAAK,UAAU,kBAAkB;IAC/B,MAAM,CAAC,kBAAkB,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACtD,MAAM,CAAC,cAAc,CAAC;QACtB,MAAM,CAAC,cAAc,CAAC;KACvB,CAAC,CAAC;IACH,OAAO,IAAI,cAAc,CACvB,kBAAkB,CAAC,OAAO,EAC1B,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,OAAO,CAChB,CAAC;AACJ,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,iBAAiB;IAC/B,cAAc,KAAK,kBAAkB,EAAE,CAAC;IACxC,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -5,19 +5,36 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Why a query target was not evaluated. The first two come from mapping the
|
|
8
|
-
* token onto a release; `no_bcd_data` means a compared key
|
|
9
|
-
* the
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* token onto a release; `no_bcd_data` means a compared key's data does not
|
|
9
|
+
* establish support either way for the target (the key records nothing for the
|
|
10
|
+
* browser, or the target sits before a `≤` bound), `no_feature_level_data` means
|
|
11
|
+
* a feature judged on web-features' feature-level support has no answer for it
|
|
12
|
+
* (a non-core browser, or a release before a `≤` bound), and
|
|
13
|
+
* `no_comparable_feature` means the call held no feature that could be compared
|
|
14
|
+
* at all.
|
|
13
15
|
*/
|
|
14
16
|
export type UncheckedReason = 'no_bcd_browser' | 'unknown_version' | 'no_bcd_data' | 'no_feature_level_data' | 'no_comparable_feature';
|
|
15
|
-
/**
|
|
17
|
+
/** One BCD release a target covers: its ordinal, and its version or `null` before every release. */
|
|
18
|
+
export interface SpannedRelease {
|
|
19
|
+
index: number;
|
|
20
|
+
version: string | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A browserslist token that mapped onto a concrete BCD release. `bcd_version`
|
|
24
|
+
* and `bcd_release_index` name the release the token maps to — for a grouped
|
|
25
|
+
* token such as `15.0-15.1`, its lower endpoint's.
|
|
26
|
+
*/
|
|
16
27
|
export interface ResolvedTarget {
|
|
17
28
|
agent: string;
|
|
18
29
|
bcd_browser: string;
|
|
19
30
|
bcd_release_index: number;
|
|
20
31
|
bcd_version: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Every BCD release the token covers, oldest first: the release it maps to,
|
|
34
|
+
* then for a grouped token each listed release through the one its upper
|
|
35
|
+
* endpoint maps to. Judged release by release; never an output field.
|
|
36
|
+
*/
|
|
37
|
+
span: readonly SpannedRelease[];
|
|
21
38
|
version_token: string;
|
|
22
39
|
}
|
|
23
40
|
/** A browserslist token the server declined to claim a verdict for. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/targets/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/targets/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GACvB,gBAAgB,GAChB,iBAAiB,GACjB,aAAa,GACb,uBAAuB,GACvB,uBAAuB,CAAC;AAE5B,oGAAoG;AACpG,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;OAIG;IACH,IAAI,EAAE,SAAS,cAAc,EAAE,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,eAAe,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,SAAS,EAAE,eAAe,EAAE,CAAC;CAC9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/browser-compat-mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"mcpName": "io.github.cyanheads/browser-compat-mcp-server",
|
|
5
5
|
"description": "Browser compatibility and Baseline status for any web feature — offline, from MDN's browser-compat-data, web-features, and caniuse. STDIO or Streamable HTTP.",
|
|
6
6
|
"type": "module",
|
|
@@ -75,32 +75,32 @@
|
|
|
75
75
|
"license": "Apache-2.0",
|
|
76
76
|
"packageManager": "bun@1.4.4",
|
|
77
77
|
"engines": {
|
|
78
|
-
"bun": ">=1.4.
|
|
78
|
+
"bun": ">=1.4.4",
|
|
79
79
|
"node": ">=24.0.0"
|
|
80
80
|
},
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@cyanheads/mcp-ts-core": "^0.13.
|
|
86
|
-
"@mdn/browser-compat-data": "^8.1.
|
|
87
|
-
"browserslist": "^4.29.
|
|
88
|
-
"caniuse-lite": "^1.0.
|
|
85
|
+
"@cyanheads/mcp-ts-core": "^0.13.24",
|
|
86
|
+
"@mdn/browser-compat-data": "^8.1.11",
|
|
87
|
+
"browserslist": "^4.29.6",
|
|
88
|
+
"caniuse-lite": "^1.0.30001828",
|
|
89
89
|
"pino-pretty": "^13.2.0",
|
|
90
|
-
"web-features": "^3.
|
|
90
|
+
"web-features": "^3.48.0",
|
|
91
91
|
"zod": "^4.6.7"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@biomejs/biome": "2.6.
|
|
94
|
+
"@biomejs/biome": "2.6.9",
|
|
95
95
|
"@socketsecurity/bun-security-scanner": "^1.1.3",
|
|
96
|
-
"@types/node": "26.6.
|
|
97
|
-
"@vitest/coverage-istanbul": "5.
|
|
96
|
+
"@types/node": "26.6.11",
|
|
97
|
+
"@vitest/coverage-istanbul": "^5.1.2",
|
|
98
98
|
"depcheck": "^1.4.7",
|
|
99
|
-
"fast-check": "^4.
|
|
100
|
-
"ignore": "^7.0.
|
|
101
|
-
"tsc-alias": "^1.9.
|
|
99
|
+
"fast-check": "^4.11.0",
|
|
100
|
+
"ignore": "^7.0.17",
|
|
101
|
+
"tsc-alias": "^1.9.11",
|
|
102
102
|
"typescript": "^7.0.2",
|
|
103
|
-
"vitest": "^5.
|
|
103
|
+
"vitest": "^5.1.2"
|
|
104
104
|
},
|
|
105
105
|
"author": "Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)",
|
|
106
106
|
"funding": [
|
package/server.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/cyanheads/browser-compat-mcp-server.git",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.2",
|
|
10
10
|
"remotes": [
|
|
11
11
|
{
|
|
12
12
|
"type": "streamable-http",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
20
20
|
"identifier": "@cyanheads/browser-compat-mcp-server",
|
|
21
21
|
"runtimeHint": "npx",
|
|
22
|
-
"version": "0.3.
|
|
22
|
+
"version": "0.3.2",
|
|
23
23
|
"environmentVariables": [
|
|
24
24
|
{
|
|
25
25
|
"name": "MCP_LOG_LEVEL",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
39
39
|
"identifier": "@cyanheads/browser-compat-mcp-server",
|
|
40
40
|
"runtimeHint": "npx",
|
|
41
|
-
"version": "0.3.
|
|
41
|
+
"version": "0.3.2",
|
|
42
42
|
"environmentVariables": [
|
|
43
43
|
{
|
|
44
44
|
"name": "MCP_TRANSPORT_TYPE",
|
|
@@ -4,7 +4,7 @@ description: Assess concrete web code against a project's browser target policy
|
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: "cyanheads"
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.1"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## Scope
|
|
@@ -21,7 +21,7 @@ Choose the identifier that matches the code's dependency. A feature id such as `
|
|
|
21
21
|
|
|
22
22
|
1. Establish the project's browser target policy before making a project shipping claim. Baseline describes general availability across its core browsers; it does not replace the project's explicit targets. If the policy is unknown, report the available evidence and leave the project verdict unresolved.
|
|
23
23
|
2. Match the evidence to the code's behavior before accepting a feature-level answer. When a multi-key id cannot answer for the required browser or subfeature, inspect its keys and compare the relevant BCD key. Keep the target policy intact; excluding unchecked browsers to obtain a pass changes the question.
|
|
24
|
-
3. Separate lack of evidence from evidence of no support. A miss asks for identifier discovery; `not_mapped` means no Baseline mapping; `no_compat_data` means no per-browser compatibility record; an unchecked target remains unresolved. None alone proves that the browser cannot run the feature.
|
|
24
|
+
3. Separate lack of evidence from evidence of no support. A miss asks for identifier discovery; `not_mapped` means no Baseline mapping; `no_compat_data` means no per-browser compatibility record; an unchecked target remains unresolved. None alone proves that the browser cannot run the feature. When a search names matches outside the active filters, drop those filters to inspect them. If the query has no matches anywhere, try the property, method, or element name on its own.
|
|
25
25
|
4. Assess deprecation and discouragement separately from availability. `all_widely_available` does not account for either advisory, and an omitted status field does not establish that a feature is recommended.
|
|
26
26
|
5. For an older target, inspect the statement behind its verdict before recommending a prefix, flag, or fallback. A current-browser support row can select a different statement from the one relevant to that historical release. Preserve partial-support qualifiers and version bounds when describing the result.
|
|
27
27
|
6. Complete the requested feature set before giving an aggregate decision: entries in `omitted_features` still need another call. Use whole-query verdicts and failure totals for the decision; page target rows only when their individual evidence is needed.
|
|
@@ -35,7 +35,7 @@ Read the code to identify the exact API, property value, attribute, or subfeatur
|
|
|
35
35
|
|
|
36
36
|
### Review a change for shipping
|
|
37
37
|
|
|
38
|
-
Use `browsercompat_check_baseline` for availability and advisories across the identified features, then `browsercompat_compare_support` for the project's targets.
|
|
38
|
+
Use `browsercompat_check_baseline` for availability and advisories across the identified features, then `browsercompat_compare_support` for the project's targets. Read `failing_coverage_percent` for the traffic a failure affects, then use `failing_ranges` to identify the affected versions. Pass `usage_region` when weighing a regional audience. A regional clause in `targets` selects versions and leaves the default weights global. Inspect target rows and the full feature record only where needed to decide whether the code requires a fallback, a different feature, or a stated browser restriction. A fallback needs its own compatibility assessment; this server does not prove that the application selects it correctly.
|
|
39
39
|
|
|
40
40
|
### Diagnose a historical browser failure
|
|
41
41
|
|
|
@@ -45,4 +45,6 @@ Compare the exact failing browser version and the BCD key for the failing behavi
|
|
|
45
45
|
|
|
46
46
|
Pass a self-contained browserslist expression. Use explicit browser versions for a reproduction and the project's actual expression for a shipping review. A comma or `or` forms a union (`chrome 100, firefox 100`); `and` intersects selections (`last 2 versions and > 0.5%`). Do not turn a union into an intersection to reduce failures. `defaults` is a browserslist policy, not a way to load the project's configuration.
|
|
47
47
|
|
|
48
|
+
For Node.js, compare the specific BCD key. Node contributes zero to browser traffic, even when the feature fails there. A version beyond the newest recorded release stays unchecked, and a feature-level Baseline record alone cannot establish Node support.
|
|
49
|
+
|
|
48
50
|
Resolve configuration packages and custom usage statistics in the project's own environment before calling this server; it cannot read the caller's project configuration. Preserve the resulting browser/version targets when expressing them explicitly. Follow the tool's current query validation and recovery guidance.
|