@browserstack/mcp-server 1.4.0-beta.1 → 1.5.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.
- package/capability/loadtesting.capability-index.json +1754 -0
- package/capability/tm.capability-index.json +19793 -0
- package/dist/index.js +2 -5
- package/dist/server-factory.js +5 -5
- package/dist/tools/accessibility.js +2 -5
- package/dist/tools/capability-registry/bind.d.ts +29 -0
- package/dist/tools/capability-registry/bind.js +134 -0
- package/dist/tools/capability-registry/config.d.ts +62 -0
- package/dist/tools/capability-registry/config.js +218 -0
- package/dist/tools/capability-registry/discovery.d.ts +44 -0
- package/dist/tools/capability-registry/discovery.js +99 -0
- package/dist/tools/capability-registry/egress.d.ts +44 -0
- package/dist/tools/capability-registry/egress.js +128 -0
- package/dist/tools/capability-registry/index-loader.d.ts +119 -0
- package/dist/tools/capability-registry/index-loader.js +314 -0
- package/dist/tools/capability-registry/register.d.ts +34 -0
- package/dist/tools/capability-registry/register.js +354 -0
- package/dist/tools/capability-registry/resolve.d.ts +38 -0
- package/dist/tools/capability-registry/resolve.js +45 -0
- package/dist/tools/capability-registry/search.d.ts +65 -0
- package/dist/tools/capability-registry/search.js +342 -0
- package/dist/tools/capability-registry/types.d.ts +208 -0
- package/dist/tools/capability-registry/types.js +33 -0
- package/dist/tools/get-failure-logs.js +1 -3
- package/dist/tools/rca-agent.js +2 -5
- package/dist/tools/selfheal.js +2 -5
- package/dist/tools/testmanagement.js +15 -33
- package/package.json +3 -2
- package/dist/tools/ask-browserstack/central-oauth.d.ts +0 -114
- package/dist/tools/ask-browserstack/central-oauth.js +0 -271
- package/dist/tools/ask-browserstack/config.d.ts +0 -96
- package/dist/tools/ask-browserstack/config.js +0 -134
- package/dist/tools/ask-browserstack/egress.d.ts +0 -34
- package/dist/tools/ask-browserstack/egress.js +0 -31
- package/dist/tools/ask-browserstack/register.d.ts +0 -61
- package/dist/tools/ask-browserstack/register.js +0 -394
- package/dist/tools/ask-browserstack/relay.d.ts +0 -201
- package/dist/tools/ask-browserstack/relay.js +0 -575
- package/dist/tools/ask-browserstack/stream.d.ts +0 -116
- package/dist/tools/ask-browserstack/stream.js +0 -237
- package/dist/tools/ask-browserstack/types.d.ts +0 -196
- package/dist/tools/ask-browserstack/types.js +0 -10
- package/dist/tools/tool-handoff.d.ts +0 -37
- package/dist/tools/tool-handoff.js +0 -47
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The decision mapping and the result assembly — the two places where being wrong is
|
|
3
|
-
* expensive, kept pure so they can be tested without a server, a socket or a client.
|
|
4
|
-
*/
|
|
5
|
-
import { ElicitResult } from "@modelcontextprotocol/sdk/types.js";
|
|
6
|
-
import { AgentResponse } from "./egress.js";
|
|
7
|
-
import { ApprovalRecord, AskResult, AskStatus, Decision, DecisionReason, RelayMode } from "./types.js";
|
|
8
|
-
export declare const RELAY_ON_DETAIL: string;
|
|
9
|
-
/**
|
|
10
|
-
* Used when the channel worked and every ask came back with nobody behind it.
|
|
11
|
-
*
|
|
12
|
-
* `RELAY_ON_DETAIL` cannot be used here and saying it was a bug, observed live: it claims
|
|
13
|
-
* "BrowserStack asked before each change and the answers are in `approvals`" while the
|
|
14
|
-
* trail says `refused: nobody was there to be asked`. Both sentences were in the same
|
|
15
|
-
* result, contradicting each other — the same class of confusion as `disabled` vs a human
|
|
16
|
-
* saying no, and it is the reader who pays for it. The channel being usable and a person
|
|
17
|
-
* actually answering are different facts, and only the second one licenses the word
|
|
18
|
-
* "answers".
|
|
19
|
-
*/
|
|
20
|
-
export declare const RELAY_ON_NO_ANSWER_DETAIL: string;
|
|
21
|
-
/**
|
|
22
|
-
* One sentence per way the relay can fail to run, because they call for different things
|
|
23
|
-
* from the person reading them, and a caller who cannot tell them apart retries forever.
|
|
24
|
-
*
|
|
25
|
-
* `no_human` is ours (CONTRACT §7's last row); the rest are Atlas's (v1.1 §D).
|
|
26
|
-
*/
|
|
27
|
-
export declare const RELAY_OFF_DETAILS: Record<string, string>;
|
|
28
|
-
/** Kept for anything still importing the old single constant. */
|
|
29
|
-
export declare const RELAY_OFF_DETAIL: string;
|
|
30
|
-
/** The sentence that goes with a `{used, reason}` pair, whoever produced it. */
|
|
31
|
-
export declare function relayDetail(used: boolean, reason: string): string;
|
|
32
|
-
/**
|
|
33
|
-
* Did this request die before the agent ever started?
|
|
34
|
-
*
|
|
35
|
-
* Atlas omits its `permission_relay` verdict on refusals that never reach the delegation
|
|
36
|
-
* layer — 401 unauthorized, 400 bad body, 503 delegation-not-enabled all answer with a bare
|
|
37
|
-
* `{"detail": …}` — and a transport failure has no body at all. Read naively, "no verdict"
|
|
38
|
-
* looks identical to "an Atlas older than v1.1", and the optimistic fallback for THAT case
|
|
39
|
-
* then claims the channel was used and answers were collected when zero prompts appeared.
|
|
40
|
-
*
|
|
41
|
-
* Which is the same confusion the `disabled` sentence exists to prevent, one layer earlier:
|
|
42
|
-
* a caller who cannot tell "nobody was asked" from "somebody said no" retries forever.
|
|
43
|
-
*/
|
|
44
|
-
export declare function looksLikeDelegationResult(body: unknown): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Is this Atlas saying the ACCOUNT is not enabled for the product's agent?
|
|
47
|
-
*
|
|
48
|
-
* Atlas gained an entitlement gate on `POST /agent` (`flags.is_agent_enabled`, AIC-386) that
|
|
49
|
-
* the WebSocket path already had. The flags are PER PRODUCT — `aiHarnessAgent` for tm,
|
|
50
|
-
* `aiHarnessAgentTRA`, `aiHarnessAgentA11y` — so an account can be entitled for one product
|
|
51
|
-
* and not another. It is also FAIL-OPEN on Atlas's side: Redis down, a flag never seeded, or
|
|
52
|
-
* an unknown product all allow the request. So a 403 here is a real, deliberate "this account
|
|
53
|
-
* is not enabled", never an outage.
|
|
54
|
-
*
|
|
55
|
-
* KEYED STRUCTURALLY, NEVER ON THE PROSE. Matching the sentence would break silently the
|
|
56
|
-
* first time someone rewords it, falling through to a generic error.
|
|
57
|
-
*
|
|
58
|
-
* TODO(atlas/9.md): Atlas is deciding whether to add a `code` field to this body. When it
|
|
59
|
-
* lands, prefer it over the status — add the check as the first rung here and leave the
|
|
60
|
-
* status as the fallback for an older Atlas. Until then the status IS the structural signal.
|
|
61
|
-
*/
|
|
62
|
-
export declare function isNotEntitled(response: AgentResponse): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* The sentence the user asked for, with the product named.
|
|
65
|
-
*
|
|
66
|
-
* Entitlement is per product, so a bare "not enabled" sends someone to their admin asking
|
|
67
|
-
* about the wrong thing. The disambiguation from a 401 is deliberate and load-bearing:
|
|
68
|
-
* without it, a working access key gets rotated in response to a permissions problem.
|
|
69
|
-
*/
|
|
70
|
-
export declare const NOT_ENTITLED_DETAIL: (product: string) => string;
|
|
71
|
-
export declare function neverReachedAgent(response: AgentResponse): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Atlas's own verdict on the relay (v1.1 §D), when it gave one.
|
|
74
|
-
*
|
|
75
|
-
* Present ONLY when we supplied a `permission_relay` block, so its absence is either "we
|
|
76
|
-
* never offered one" or "this Atlas predates v1.1" — neither of which is an error. A block
|
|
77
|
-
* we cannot read is treated as no block at all rather than half-trusted.
|
|
78
|
-
*/
|
|
79
|
-
export declare function atlasRelayVerdict(payload: Record<string, unknown>): {
|
|
80
|
-
used: boolean;
|
|
81
|
-
reason: string;
|
|
82
|
-
} | null;
|
|
83
|
-
/**
|
|
84
|
-
* Product-language framing for the prompt (v1.1 §G, approved).
|
|
85
|
-
*
|
|
86
|
-
* `product` is the ONLY thing added — it is all §2 carries, and the route, method and path
|
|
87
|
-
* never reach this side by design. The description itself is passed through untouched:
|
|
88
|
-
* paraphrasing or truncating it would mean the human approves something other than what the
|
|
89
|
-
* model actually said. Atlas sends it as the model wrote it (its route guard was removed —
|
|
90
|
-
* CONTRACT v2 §3, amended), so this prefix is the only thing in front of the model's own
|
|
91
|
-
* sentence. A placeholder can still arrive from an older Atlas and reads fine after it.
|
|
92
|
-
*/
|
|
93
|
-
export declare const PRODUCT_LABELS: Record<string, string>;
|
|
94
|
-
export declare function elicitationMessage(product: string, description: string): string;
|
|
95
|
-
/**
|
|
96
|
-
* CONTRACT §7. THE ACTION IS THE WHOLE ANSWER.
|
|
97
|
-
*
|
|
98
|
-
* | accept | allow | "" |
|
|
99
|
-
* | decline | deny | declined |
|
|
100
|
-
* | cancel | deny | cancelled |
|
|
101
|
-
*
|
|
102
|
-
* Nothing is requested in the form any more, so nothing can contradict the action. There used
|
|
103
|
-
* to be a `confirm` boolean, and it had to go: with an `accept` action that ALREADY means the
|
|
104
|
-
* human approved, `accept` + `confirm: false` is genuinely ambiguous between "I approved, and
|
|
105
|
-
* a checkbox I never saw defaulted to false" and "I unticked it deliberately". The first is a
|
|
106
|
-
* FALSE DENIAL — indistinguishable in the result from a human refusing, which is the exact
|
|
107
|
-
* confusion D3 and N1 existed to remove — and a user hit it live. We cannot tell the two
|
|
108
|
-
* apart, and guessing either way is wrong for the other. `decline` already gives an
|
|
109
|
-
* unambiguous refusal in the same dialog, so the boolean bought nothing.
|
|
110
|
-
*
|
|
111
|
-
* FAIL-CLOSED IS UNCHANGED, and the boolean was never what provided it. A headless client with
|
|
112
|
-
* no human at a terminal returns `cancel` — measured, not assumed (HANDOFF.md) — and `cancel`
|
|
113
|
-
* is a deny. That is why an unattended run still cannot self-approve. It is also why an
|
|
114
|
-
* elicitation is never retried: a second ask cannot conjure a human, only wear one down.
|
|
115
|
-
*/
|
|
116
|
-
export declare function decide(result: ElicitResult): {
|
|
117
|
-
decision: Decision;
|
|
118
|
-
reason: DecisionReason;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* A one-line description of the SHAPE of what a client answered with — never its content.
|
|
122
|
-
*
|
|
123
|
-
* Which client sends what is currently guesswork: the elicitation bug in task 9 had to be
|
|
124
|
-
* fixed without being able to confirm what Claude Code actually submits, because its binary
|
|
125
|
-
* is compiled and its strings too fragmented to read. This line means the next person can
|
|
126
|
-
* look it up instead of inferring it.
|
|
127
|
-
*
|
|
128
|
-
* `action` and `confirm` are a fixed enum and a boolean; neither can carry a description, a
|
|
129
|
-
* credential or anything else a user typed.
|
|
130
|
-
*/
|
|
131
|
-
export declare function elicitationShape(result: ElicitResult): string;
|
|
132
|
-
/**
|
|
133
|
-
* Read Atlas's `applied_before_stop`. NEVER DERIVE IT.
|
|
134
|
-
*
|
|
135
|
-
* This side used to compute it as CONTRACT §5's literal "any allow preceded a deny", which
|
|
136
|
-
* could only ever be a guess: an approval whose request then failed counted as applied, so
|
|
137
|
-
* the field lied in the exact direction it exists to prevent (D2). Atlas now computes it
|
|
138
|
-
* from `applied`, which only Atlas can know, and sends it whenever a gate ran — including
|
|
139
|
-
* `false`, including with an empty trail.
|
|
140
|
-
*
|
|
141
|
-
* So a MISSING field is never "false". It is "nobody measured this": either no gate ran, or
|
|
142
|
-
* this Atlas predates the field. `null` says that out loud instead of asserting a fact.
|
|
143
|
-
*/
|
|
144
|
-
export declare function readAppliedBeforeStop(payload: Record<string, unknown>): boolean | null;
|
|
145
|
-
/**
|
|
146
|
-
* Atlas's approval trail, when it sent one.
|
|
147
|
-
*
|
|
148
|
-
* Returns `null` — not `[]` — when the key is absent, because an empty trail Atlas DID send
|
|
149
|
-
* ("the relay ran and nothing was asked") is a different fact from no trail at all, and only
|
|
150
|
-
* the second is a reason to fall back to ours.
|
|
151
|
-
*
|
|
152
|
-
* Every entry is rebuilt rather than trusted: a `decision` that is not exactly `"allow"`
|
|
153
|
-
* becomes `"deny"`, so a garbled trail fails closed in the reporting the same way the wire
|
|
154
|
-
* does, and `applied` is carried only when it is genuinely a boolean.
|
|
155
|
-
*/
|
|
156
|
-
export declare function parseAtlasApprovals(payload: Record<string, unknown>): ApprovalRecord[] | null;
|
|
157
|
-
/**
|
|
158
|
-
* One phrase per entry, because "approved, then it failed" and "refused" must not read
|
|
159
|
-
* alike — conflating them is the whole reason D2 mattered.
|
|
160
|
-
*
|
|
161
|
-
* An `allow` with no `applied` key is NOT rendered as a failure: nobody measured it, and
|
|
162
|
-
* saying otherwise would invent the very fact this is meant to report.
|
|
163
|
-
*/
|
|
164
|
-
/**
|
|
165
|
-
* Every ask was refused because no person was there — not because one said no.
|
|
166
|
-
*
|
|
167
|
-
* `cancelled` is what a client with nobody at the terminal returns (measured), and
|
|
168
|
-
* `no_human` is our own word for the same thing. An EMPTY trail is not this case: nothing
|
|
169
|
-
* was asked at all, which the existing sentences already describe correctly.
|
|
170
|
-
*/
|
|
171
|
-
export declare function nobodyAnswered(trail: ApprovalRecord[]): boolean;
|
|
172
|
-
export declare function approvalOutcome(entry: ApprovalRecord): string;
|
|
173
|
-
/**
|
|
174
|
-
* Atlas's own status wins when it declares one; otherwise it is derived from what we can
|
|
175
|
-
* see. Deriving is a last resort, not an interpretation of the answer.
|
|
176
|
-
*/
|
|
177
|
-
export declare function deriveStatus(response: AgentResponse, approvals: ApprovalRecord[], needsApproval: unknown[]): AskStatus;
|
|
178
|
-
/** Assemble CONTRACT §5's result. Atlas's payload is carried, never rewritten. */
|
|
179
|
-
export declare function buildResult(response: AgentResponse, approvals: ApprovalRecord[], mode: RelayMode,
|
|
180
|
-
/** Named in the not-entitled sentence, because entitlement is per product. */
|
|
181
|
-
product?: string): AskResult;
|
|
182
|
-
/**
|
|
183
|
-
* A rejected credential and a refused action are unrelated problems, and a result that lets
|
|
184
|
-
* them read alike sends someone hunting for a human who said no when the real answer is that
|
|
185
|
-
* this server never got through the door.
|
|
186
|
-
*
|
|
187
|
-
* Atlas answers a bad `Authorization` with `401 {"detail": "unauthorized"}` — no `error`
|
|
188
|
-
* string of its own — so without this the caller would see a bare "error" and nothing else.
|
|
189
|
-
* A denial, by contrast, is `status: "blocked"` with a populated `approvals` trail.
|
|
190
|
-
*
|
|
191
|
-
* The token itself is NOT named here, only the variable that should hold it.
|
|
192
|
-
*/
|
|
193
|
-
export declare const UNAUTHENTICATED_DETAIL: string;
|
|
194
|
-
/**
|
|
195
|
-
* A result for a call that never reached, or never got past, Atlas.
|
|
196
|
-
*
|
|
197
|
-
* It keeps §5's shape — including the approval trail — because a failure AFTER an approval
|
|
198
|
-
* was granted is exactly the case where a caller most needs to know something may already
|
|
199
|
-
* have been applied.
|
|
200
|
-
*/
|
|
201
|
-
export declare function errorResult(message: string, approvals: ApprovalRecord[]): AskResult;
|