@browserstack/mcp-server 1.5.1-beta.2 → 2.0.0-beta.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.
Files changed (38) hide show
  1. package/README.md +54 -1
  2. package/capability/tm.capability-index.json +50420 -0
  3. package/capability/tra.capability-index.json +52096 -0
  4. package/dist/lib/central-oauth.d.ts +133 -0
  5. package/dist/lib/central-oauth.js +246 -0
  6. package/dist/lib/instrumentation.d.ts +14 -1
  7. package/dist/lib/instrumentation.js +8 -1
  8. package/dist/server-factory.js +5 -0
  9. package/dist/tools/ask-browserstack/central-oauth.d.ts +25 -46
  10. package/dist/tools/ask-browserstack/central-oauth.js +55 -177
  11. package/dist/tools/capability-registry/bind.d.ts +28 -0
  12. package/dist/tools/capability-registry/bind.js +407 -0
  13. package/dist/tools/capability-registry/config.d.ts +62 -0
  14. package/dist/tools/capability-registry/config.js +218 -0
  15. package/dist/tools/capability-registry/discovery.d.ts +44 -0
  16. package/dist/tools/capability-registry/discovery.js +101 -0
  17. package/dist/tools/capability-registry/egress.d.ts +51 -0
  18. package/dist/tools/capability-registry/egress.js +197 -0
  19. package/dist/tools/capability-registry/index-loader.d.ts +162 -0
  20. package/dist/tools/capability-registry/index-loader.js +523 -0
  21. package/dist/tools/capability-registry/oauth.d.ts +63 -0
  22. package/dist/tools/capability-registry/oauth.js +176 -0
  23. package/dist/tools/capability-registry/redact.d.ts +34 -0
  24. package/dist/tools/capability-registry/redact.js +98 -0
  25. package/dist/tools/capability-registry/register.d.ts +48 -0
  26. package/dist/tools/capability-registry/register.js +956 -0
  27. package/dist/tools/capability-registry/resolve.d.ts +38 -0
  28. package/dist/tools/capability-registry/resolve.js +104 -0
  29. package/dist/tools/capability-registry/routing-token.d.ts +25 -0
  30. package/dist/tools/capability-registry/routing-token.js +87 -0
  31. package/dist/tools/capability-registry/search.d.ts +197 -0
  32. package/dist/tools/capability-registry/search.js +907 -0
  33. package/dist/tools/capability-registry/types.d.ts +341 -0
  34. package/dist/tools/capability-registry/types.js +33 -0
  35. package/dist/tools/testmanagement.js +5 -5
  36. package/dist/tools/tool-handoff.d.ts +15 -12
  37. package/dist/tools/tool-handoff.js +21 -18
  38. package/package.json +10 -3
@@ -0,0 +1,407 @@
1
+ /**
2
+ * Turn grouped caller arguments into a path, a query and a body.
3
+ *
4
+ * Arguments arrive GROUPED — {path_params, query, body} — because spec parameter names
5
+ * collide across locations: four tm operations declare one name in two places (`bulk-move`
6
+ * has `folder_id` as both a path parameter and a body field). A flat map cannot say which
7
+ * one is meant, which is exactly why the Python side used to rename body fields `body_*`.
8
+ * Grouping removes the collision AND the rename, so a caller sends the spec's own names.
9
+ */
10
+ import { InvocationError } from "./index-loader.js";
11
+ /**
12
+ * String formats worth ENFORCING, as opposed to merely publishing.
13
+ *
14
+ * A validator that rejects a correct value is worse than no validator: the caller cannot
15
+ * route around it, and the request that would have worked never leaves. So this covers only
16
+ * the formats where "wrong" is unambiguous and a legitimate value cannot trip it.
17
+ *
18
+ * tm declares eight formats. `date`, `date-time` and `uuid` are here. `email` and `uri` are
19
+ * deliberately NOT — every compact regex for either rejects addresses and URLs that servers
20
+ * accept, and being wrong in that direction blocks real work. `int64`, `float` and `binary`
21
+ * say what a number or blob is, which `type` already covers.
22
+ */
23
+ const FORMATS = {
24
+ date: {
25
+ // A real calendar date, so 2026-02-31 fails rather than being reformatted.
26
+ test: (v) => /^\d{4}-\d{2}-\d{2}$/.test(v) &&
27
+ !Number.isNaN(Date.parse(`${v}T00:00:00Z`)) &&
28
+ new Date(`${v}T00:00:00Z`).toISOString().startsWith(v),
29
+ want: "a date (YYYY-MM-DD)",
30
+ },
31
+ "date-time": {
32
+ // Permissive on purpose: offset or Z, optional fractional seconds. Tightening this
33
+ // buys nothing and starts rejecting timestamps the product would have taken.
34
+ test: (v) => /^\d{4}-\d{2}-\d{2}[Tt ]\d{2}:\d{2}:\d{2}(\.\d+)?([Zz]|[+-]\d{2}:?\d{2})?$/.test(v) && !Number.isNaN(Date.parse(v)),
35
+ want: "a date-time (e.g. 2026-01-31T09:30:00Z)",
36
+ },
37
+ uuid: {
38
+ test: (v) => /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(v),
39
+ want: "a UUID",
40
+ },
41
+ };
42
+ /**
43
+ * A declared `pattern`, compiled once, or undefined if it will not compile here.
44
+ *
45
+ * `u` because tm's patterns use `\p{L}`/`\p{N}`, which are a syntax error without it. A
46
+ * pattern this engine cannot compile is SKIPPED rather than thrown: the index is generated
47
+ * from someone else's spec, and refusing to invoke a working endpoint because its regex
48
+ * dialect differs would be our bug landing on the caller.
49
+ */
50
+ const patternCache = new Map();
51
+ function compiled(pattern) {
52
+ if (!patternCache.has(pattern)) {
53
+ let regex;
54
+ try {
55
+ regex = new RegExp(pattern, "u");
56
+ }
57
+ catch {
58
+ try {
59
+ regex = new RegExp(pattern);
60
+ }
61
+ catch {
62
+ regex = undefined;
63
+ }
64
+ }
65
+ patternCache.set(pattern, regex);
66
+ }
67
+ return patternCache.get(pattern);
68
+ }
69
+ /**
70
+ * Every constraint the parameter declares, checked against the COERCED value.
71
+ *
72
+ * Runs inside `bind`, which register.ts calls dry before the write-consent gate — so a
73
+ * value that breaks a constraint is refused before the user is asked to approve anything,
74
+ * and nothing reaches egress.
75
+ *
76
+ * `label` carries the parent name for a nested field, so the message names `test_case.name`
77
+ * rather than a bare `name` the caller would have to go looking for.
78
+ */
79
+ function checkConstraints(value, param, label = param.name) {
80
+ const fail = (what) => {
81
+ throw new InvocationError(`'${label}' ${what}`);
82
+ };
83
+ if (typeof value === "number") {
84
+ if (param.minimum !== undefined && value < param.minimum)
85
+ fail(`must be at least ${param.minimum}`);
86
+ if (param.maximum !== undefined && value > param.maximum)
87
+ fail(`must be at most ${param.maximum}`);
88
+ if (param.multipleOf !== undefined && param.multipleOf > 0) {
89
+ // Scale BOTH to integers before the modulo: 0.3 % 0.1 is 0.09999… in binary floating
90
+ // point and would reject a value the product accepts. The scale has to cover the
91
+ // value's decimals as well as the step's — scaling by the step alone rounds 0.25 to
92
+ // 3 against a step of 1, which then divides evenly and lets a bad value through.
93
+ const scale = 10 ** Math.max(decimals(param.multipleOf), decimals(value));
94
+ if (Math.round(value * scale) % Math.round(param.multipleOf * scale) !==
95
+ 0)
96
+ fail(`must be a multiple of ${param.multipleOf}`);
97
+ }
98
+ }
99
+ if (typeof value === "string") {
100
+ if (param.minLength !== undefined && value.length < param.minLength)
101
+ fail(`must be at least ${param.minLength} character(s)`);
102
+ if (param.maxLength !== undefined && value.length > param.maxLength)
103
+ fail(`must be at most ${param.maxLength} character(s)`);
104
+ if (param.pattern) {
105
+ const regex = compiled(param.pattern);
106
+ if (regex && !regex.test(value))
107
+ fail(`must match ${param.pattern}`);
108
+ }
109
+ const format = param.format ? FORMATS[param.format] : undefined;
110
+ if (format && !format.test(value))
111
+ fail(`must be ${format.want}`);
112
+ }
113
+ if (Array.isArray(value)) {
114
+ if (param.minItems !== undefined && value.length < param.minItems)
115
+ fail(`must have at least ${param.minItems} item(s)`);
116
+ if (param.maxItems !== undefined && value.length > param.maxItems)
117
+ fail(`must have at most ${param.maxItems} item(s)`);
118
+ if (param.uniqueItems) {
119
+ const seen = new Set(value.map((item) => JSON.stringify(item)));
120
+ if (seen.size !== value.length)
121
+ fail("must not contain duplicate items");
122
+ }
123
+ }
124
+ }
125
+ /** Decimal places, for scaling `multipleOf` out of floating point. */
126
+ function decimals(n) {
127
+ const text = String(n);
128
+ const dot = text.indexOf(".");
129
+ return dot < 0 ? 0 : text.length - dot - 1;
130
+ }
131
+ /**
132
+ * The declared fields one level inside an object, or inside each item of an array.
133
+ *
134
+ * Only what `fields` names is checked, and an undeclared key is left alone — `fields` is a
135
+ * projection of the shape, not a closed contract, so rejecting the rest would refuse valid
136
+ * bodies. That is the opposite of the top level, where the full parameter list IS known and
137
+ * an unknown name is an error.
138
+ */
139
+ function checkFields(value, param) {
140
+ if (!param.fields?.length)
141
+ return;
142
+ const items = Array.isArray(value) ? value : [value];
143
+ for (const item of items) {
144
+ if (typeof item !== "object" || item === null || Array.isArray(item))
145
+ continue;
146
+ const record = item;
147
+ for (const field of param.fields) {
148
+ if (!(field.name in record)) {
149
+ if (field.required)
150
+ throw new InvocationError(`missing required parameter(s): ${param.name}.${field.name}`);
151
+ continue;
152
+ }
153
+ const label = `${param.name}.${field.name}`;
154
+ const coerced = coerceType(record[field.name], field, label);
155
+ checkConstraints(coerced, field, label);
156
+ }
157
+ }
158
+ }
159
+ /**
160
+ * One path value, checked for the segments that silently retarget the request.
161
+ *
162
+ * `encodeURIComponent` does NOT escape a dot, and `new URL()` in egress resolves `.` and
163
+ * `..` the way a filesystem would. So a string path parameter carrying `..` walks up a
164
+ * segment and the call lands somewhere else entirely:
165
+ *
166
+ * update_test_case { project_id: "PR-1", test_case_id: ".." }
167
+ * -> PATCH /api/v2/projects/PR-1/ (the PROJECT, not a test case)
168
+ *
169
+ * That is worse than a failed call. The human approved "update this test case" and gave a
170
+ * change_summary saying so, and the request edits a different resource — with the approval
171
+ * already banked. A prompt injection sitting in test-case content is enough to steer an
172
+ * agent into it.
173
+ *
174
+ * Empty and `.` are refused for the same reason: both collapse the segment and leave the
175
+ * request pointing at the collection.
176
+ *
177
+ * TYPE CHECKING IS NOT THE DEFENCE HERE, though a comment used to claim it was. It holds
178
+ * only for `type: integer` ids; eleven enabled capabilities take a STRING path parameter
179
+ * with no pattern, enum or format, and every one of those values reaches the URL as given.
180
+ */
181
+ function pathSegment(value, name) {
182
+ const text = String(value);
183
+ const trimmed = text.trim();
184
+ if (trimmed === "" || trimmed === "." || trimmed === "..") {
185
+ throw new InvocationError(`'${name}' is not a usable path value: ${JSON.stringify(text)} would ` +
186
+ `retarget the request at a different resource rather than identify one. ` +
187
+ `Pass the id exactly as a read returned it.`);
188
+ }
189
+ return text;
190
+ }
191
+ /**
192
+ * Check one argument against its declared schema, raising a caller-safe error.
193
+ *
194
+ * For path parameters this is only half the defence — see `pathSegment`, which covers the
195
+ * string ids that carry no type constraint worth the name.
196
+ */
197
+ export function coerce(value, param) {
198
+ const coerced = coerceType(value, param);
199
+ checkConstraints(coerced, param);
200
+ checkFields(coerced, param);
201
+ return coerced;
202
+ }
203
+ function coerceType(value, param, label = param.name) {
204
+ const expected = param.type;
205
+ if (expected === "object" || expected === "array") {
206
+ // An opaque body object is passed through as given: the spec does not describe its
207
+ // fields, so validating or reshaping it would mean inventing a contract.
208
+ if (expected === "object" &&
209
+ (typeof value !== "object" || value === null || Array.isArray(value))) {
210
+ throw new InvocationError(`'${label}' must be an object`);
211
+ }
212
+ if (expected === "array" && !Array.isArray(value)) {
213
+ throw new InvocationError(`'${label}' must be a list`);
214
+ }
215
+ return value;
216
+ }
217
+ if (expected === "integer" || expected === "number") {
218
+ // `Number("")` and `Number(" ")` are both 0, so a blank id silently became id 0 and the
219
+ // call went to whatever that resolves to. Refuse instead of inventing a value.
220
+ const raw = String(value).trim();
221
+ if (raw === "") {
222
+ throw new InvocationError(`'${label}' must be a number, and was empty`);
223
+ }
224
+ const parsed = Number(raw);
225
+ if (!Number.isFinite(parsed)) {
226
+ throw new InvocationError(`'${label}' must be a number`);
227
+ }
228
+ // `Math.trunc` turned "1.9" into 1 without a word. An id is either an integer or it is
229
+ // the wrong id, and quietly rounding it addresses the wrong record.
230
+ if (expected === "integer" && !Number.isInteger(parsed)) {
231
+ throw new InvocationError(`'${label}' must be a whole number, not ${JSON.stringify(raw)}`);
232
+ }
233
+ // Past 2^53 `Number` rounds: TRA's 17-digit unique-error cluster ids came back as a
234
+ // neighbouring id, so the call silently targeted the wrong cluster. Keep the caller's
235
+ // exact digits instead — path and query serialise a string identically, and a JSON body
236
+ // carrying a digit string still binds to a Long on the server.
237
+ if (expected === "integer" &&
238
+ !Number.isSafeInteger(parsed) &&
239
+ /^-?\d+$/.test(raw)) {
240
+ return raw;
241
+ }
242
+ return parsed;
243
+ }
244
+ if (expected === "boolean") {
245
+ if (typeof value === "boolean")
246
+ return value;
247
+ const text = String(value).trim().toLowerCase();
248
+ if (["true", "1", "yes"].includes(text))
249
+ return true;
250
+ if (["false", "0", "no"].includes(text))
251
+ return false;
252
+ throw new InvocationError(`'${label}' must be true or false`);
253
+ }
254
+ // NO DECLARED TYPE: pass the value through as given.
255
+ //
256
+ // The fallthrough below is String(value), which is right for a declared string and
257
+ // silently destructive for anything the spec left untyped. create_report declares
258
+ // `mail_to` and `report_filters` with no type and the API wants objects for both, so a
259
+ // correct payload was serialised to the literal "[object Object]" and refused:
260
+ //
261
+ // The property '#/mail_to' of type string did not match the following type: object
262
+ //
263
+ // The caller sent the right thing, this layer broke it, and the server's message blames
264
+ // the caller for a string it never wrote. An untyped parameter means the spec declines to
265
+ // say what shape it is — which is a reason to leave it alone, not to guess "string".
266
+ const untyped = !expected;
267
+ if (untyped && (typeof value === "object" || typeof value === "boolean")) {
268
+ return value;
269
+ }
270
+ const text = String(value);
271
+ if (param.values && param.values.length > 0) {
272
+ const allowed = param.values.map((v) => String(v));
273
+ if (!allowed.includes(text)) {
274
+ throw new InvocationError(`'${label}' must be one of: ${allowed.join(", ")}`);
275
+ }
276
+ }
277
+ return text;
278
+ }
279
+ /** Place a value at a JSON-pointer-ish path, creating the objects on the way. */
280
+ function place(root, pointer, value) {
281
+ const segments = pointer.split("/").filter((segment) => segment !== "");
282
+ let cursor = root;
283
+ for (const segment of segments.slice(0, -1)) {
284
+ const next = cursor[segment];
285
+ if (typeof next !== "object" || next === null || Array.isArray(next)) {
286
+ cursor[segment] = {};
287
+ }
288
+ cursor = cursor[segment];
289
+ }
290
+ cursor[segments[segments.length - 1]] = value;
291
+ }
292
+ const MAP_KEY = /^[A-Za-z0-9][\w.-]*$/;
293
+ function keyedParam(group, params) {
294
+ if (group !== "body")
295
+ return undefined;
296
+ return params.find((param) => /^\{\w+\}$/.test(param.name));
297
+ }
298
+ const GROUPS = [
299
+ { group: "path_params", declared: "path_params" },
300
+ { group: "query", declared: "query" },
301
+ { group: "body", declared: "body" },
302
+ ];
303
+ export function bind(capability, args) {
304
+ let path = capability.path;
305
+ const query = {};
306
+ const body = {};
307
+ for (const { group, declared } of GROUPS) {
308
+ const supplied = args[group] || {};
309
+ if (typeof supplied !== "object" ||
310
+ supplied === null ||
311
+ Array.isArray(supplied)) {
312
+ throw new InvocationError(`${group} must be an object of name -> value`);
313
+ }
314
+ const params = capability[declared] || [];
315
+ const byName = new Map(params.map((param) => [param.name, param]));
316
+ const keyed = keyedParam(group, params);
317
+ // Unknown arguments are an error rather than being dropped: silently ignoring a
318
+ // misspelled filter would return a larger result set that looks like a correct answer.
319
+ const unknown = Object.keys(supplied).filter((name) => !byName.has(name) && !keyed);
320
+ if (unknown.length > 0) {
321
+ // A CALLER WHO SENT THE WRAPPER WE BUILD DESERVES TO BE TOLD SO.
322
+ //
323
+ // Most of these endpoints want a nested body — Rails `params.require(:test_case)` —
324
+ // and the fields declare that as `json_path: /test_case/name`, so this layer
325
+ // assembles the wrapper itself and the caller sends the fields flat. A caller who
326
+ // wraps it by hand therefore sends a key that is never a declared param, and the
327
+ // bare message reads as "that field does not exist" when the truth is the opposite:
328
+ // it exists, and building it is our job.
329
+ //
330
+ // Worth special-casing because the guidance itself has been telling callers to wrap:
331
+ // 25 tm capabilities carried a line describing the WIRE format to a caller who never
332
+ // writes the wire. Those lines are being corrected, but an agent working from an
333
+ // older artifact, or reasoning from the Rails convention, lands here either way.
334
+ const wrappers = new Set(params
335
+ .map((param) => param.json_path)
336
+ .filter((path) => Boolean(path))
337
+ .map((path) => path.replace(/^\//, "").split("/")[0])
338
+ .filter((segment) => segment && !byName.has(segment)));
339
+ const sentAWrapper = unknown.filter((name) => wrappers.has(name));
340
+ throw new InvocationError(`unknown ${group}: ${unknown.sort().join(", ")}. accepted: ` +
341
+ `${[...byName.keys()].sort().join(", ") || "none"}` +
342
+ (sentAWrapper.length > 0
343
+ ? `. ${sentAWrapper.sort().join(" and ")} ` +
344
+ `${sentAWrapper.length > 1 ? "are wrappers" : "is a wrapper"} this ` +
345
+ `surface builds for you from each field's json_path — send the fields ` +
346
+ `directly instead of nesting them`
347
+ : ""));
348
+ }
349
+ for (const [name, raw] of Object.entries(supplied)) {
350
+ const param = byName.get(name) ?? keyed;
351
+ if (param === keyed && !MAP_KEY.test(name)) {
352
+ throw new InvocationError(`'${name}' is not a usable ${keyed.name} key: use the id exactly as a read returned it`);
353
+ }
354
+ const value = coerce(raw, param);
355
+ if (group === "path_params") {
356
+ // Encode with nothing exempt: a `/` inside a path value would otherwise rewrite the
357
+ // route. Schema checking already stops this for integer ids; this covers strings.
358
+ path = path.replaceAll(`{${name}}`, encodeURIComponent(pathSegment(value, name)));
359
+ }
360
+ else if (group === "body") {
361
+ const pointer = param.json_path || `/${param.name}`;
362
+ place(body, param === keyed && !byName.has(name)
363
+ ? pointer.replace(keyed.name, name)
364
+ : pointer, value);
365
+ }
366
+ else {
367
+ query[name] = value;
368
+ }
369
+ }
370
+ }
371
+ // `required` is enforced for BODY as well as path. It was path-only on the Python side at
372
+ // first, so a missing required body field passed silently and the product answered with a
373
+ // 4xx that read like the caller's fault.
374
+ const missing = [];
375
+ for (const { group, declared } of GROUPS) {
376
+ if (group === "query")
377
+ continue;
378
+ const supplied = args[group] || {};
379
+ const params = capability[declared] || [];
380
+ const keyed = keyedParam(group, params);
381
+ const declaredNames = new Set(params.map((param) => param.name));
382
+ for (const param of params) {
383
+ const present = param.name in supplied ||
384
+ (param === keyed &&
385
+ Object.keys(supplied).some((name) => !declaredNames.has(name)));
386
+ if (param.required && !present)
387
+ missing.push(param.name);
388
+ }
389
+ }
390
+ if (missing.length > 0) {
391
+ throw new InvocationError(`missing required parameter(s): ${missing.sort().join(", ")}`);
392
+ }
393
+ const leftover = path.match(/\{[a-z_]+\}/gi);
394
+ if (leftover) {
395
+ throw new InvocationError(`path placeholder(s) not supplied: ${leftover.join(", ")}`);
396
+ }
397
+ // An explicitly supplied empty body is still a body. Dropping it sent no request body at
398
+ // all, and a route with a required @RequestBody (TRA close_build, whose guidance says to
399
+ // send `{}`) answered 400 "Invalid request payload". GET/HEAD never carry one.
400
+ const sentEmptyBody = args.body !== undefined &&
401
+ !["GET", "HEAD"].includes(capability.method.toUpperCase());
402
+ return {
403
+ path,
404
+ query,
405
+ body: Object.keys(body).length > 0 || sentEmptyBody ? body : undefined,
406
+ };
407
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Where the index comes from, and where each product lives.
3
+ *
4
+ * A product may DECLARE its host in its own index file (`<product>.base_url`, authored in
5
+ * the harness's product.yaml and carried through by the export). That is the default, not
6
+ * the last word: config overrides it, and for a region-sharded product account discovery
7
+ * outranks it — see `resolveBaseUrl`. The same artifact therefore still ships to every
8
+ * environment, because anything environment- or account-specific is resolved here.
9
+ */
10
+ import { BrowserStackConfig } from "../../lib/types.js";
11
+ import { HostSource } from "./discovery.js";
12
+ import { Transport } from "./egress.js";
13
+ /**
14
+ * The environment this DEPLOYMENT points at, e.g. "preprod".
15
+ *
16
+ * Process-level on purpose, and the distinction from region matters: an environment is a
17
+ * property of the deployment (this instance talks to preprod), whereas a REGION is a
18
+ * property of the account (this user's data lives in EU). That is why region discovery is
19
+ * per request and never cached under REMOTE_MCP, while the environment is read once here.
20
+ */
21
+ export declare function selectedEnvironment(): string;
22
+ /** True when this product's host is account-specific and must be discovered per call. */
23
+ export declare function isRegionSharded(product: string, source?: HostSource): boolean;
24
+ /**
25
+ * Resolve a product's host.
26
+ *
27
+ * Atlas resolves: an explicit per-session override, then the host for the session's
28
+ * environment (`harness.extra_environments[env][product]`), then the profile's own
29
+ * `base_url`. The same rungs, in the same order, with one addition:
30
+ *
31
+ * 1. CAPABILITY_REGISTRY_BASE_URL_<PRODUCT> explicit, environment-agnostic
32
+ * 2. CAPABILITY_REGISTRY_BASE_URL_<PRODUCT>_<ENV> this environment's host
33
+ * 3. CAPABILITY_REGISTRY_BASE_URLS {product:{env:url}} the same, as one map
34
+ * 4. account discovery — the index's `base_urls`, probed
35
+ * 5. the single host declared in the index, `base_url`
36
+ * 6. refuse, by name
37
+ *
38
+ * DISCOVERY OUTRANKS THE DECLARED HOST, which is where this departs from Atlas. A declared
39
+ * host is one fixed origin, so for a region-sharded product it would send every account
40
+ * outside the default region to the wrong host — a failure that only shows up on those
41
+ * accounts, and so passes any test run from inside the default one. Discovery answers with
42
+ * the region the account is actually on; `base_url` is the fallback for when the probe
43
+ * cannot answer at all.
44
+ *
45
+ * Refusing rather than guessing is deliberate: a guessed host fails as a DNS error or a 404
46
+ * that reads like the caller's problem, when it is our missing configuration.
47
+ */
48
+ export declare function resolveBaseUrl(product: string, config: BrowserStackConfig, source?: HostSource, transport?: Transport): Promise<string>;
49
+ /**
50
+ * Locate the artifact(s).
51
+ *
52
+ * ONE FILE PER PRODUCT, so this returns a list. Explicit env wins; otherwise look for a
53
+ * `capability/` directory beside the compiled module and at the package root, then fall
54
+ * back to a single `capability-index.json` for the pre-release layout. The package-root
55
+ * candidates exist because `tsc` compiles TS and does not copy JSON into `dist`.
56
+ *
57
+ * Returns an empty list when nothing is found — the caller logs that and registers no
58
+ * tools, rather than throwing.
59
+ */
60
+ export declare function indexPaths(): string[];
61
+ /** Off by default is wrong for a shipped feature, but a kill switch is not. */
62
+ export declare function isEnabled(): boolean;