@testingbot/mcp-server 1.0.0 → 1.0.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/README.md +114 -7
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +31 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/constants.d.ts +32 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +32 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/credentials.d.ts +19 -0
- package/dist/lib/credentials.d.ts.map +1 -0
- package/dist/lib/credentials.js +128 -0
- package/dist/lib/credentials.js.map +1 -0
- package/dist/lib/error.d.ts +14 -0
- package/dist/lib/error.d.ts.map +1 -0
- package/dist/lib/error.js +27 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/get-auth.d.ts +6 -0
- package/dist/lib/get-auth.d.ts.map +1 -0
- package/dist/lib/get-auth.js +7 -0
- package/dist/lib/get-auth.js.map +1 -0
- package/dist/lib/logger.d.ts +4 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +77 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/types.d.ts +70 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +12 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +40 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/server-factory.d.ts +33 -0
- package/dist/server-factory.d.ts.map +1 -0
- package/dist/server-factory.js +224 -0
- package/dist/server-factory.js.map +1 -0
- package/dist/silence-wdio.d.ts +2 -0
- package/dist/silence-wdio.d.ts.map +1 -0
- package/dist/silence-wdio.js +17 -0
- package/dist/silence-wdio.js.map +1 -0
- package/dist/tools/auth.d.ts +43 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +571 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/browsers.d.ts +3 -0
- package/dist/tools/browsers.d.ts.map +1 -0
- package/dist/tools/browsers.js +74 -0
- package/dist/tools/browsers.js.map +1 -0
- package/dist/tools/builds.d.ts +3 -0
- package/dist/tools/builds.d.ts.map +1 -0
- package/dist/tools/builds.js +115 -0
- package/dist/tools/builds.js.map +1 -0
- package/dist/tools/cdp.d.ts +3 -0
- package/dist/tools/cdp.d.ts.map +1 -0
- package/dist/tools/cdp.js +78 -0
- package/dist/tools/cdp.js.map +1 -0
- package/dist/tools/live.d.ts +3 -0
- package/dist/tools/live.d.ts.map +1 -0
- package/dist/tools/live.js +221 -0
- package/dist/tools/live.js.map +1 -0
- package/dist/tools/logs.d.ts +3 -0
- package/dist/tools/logs.d.ts.map +1 -0
- package/dist/tools/logs.js +135 -0
- package/dist/tools/logs.js.map +1 -0
- package/dist/tools/project.d.ts +16 -0
- package/dist/tools/project.d.ts.map +1 -0
- package/dist/tools/project.js +457 -0
- package/dist/tools/project.js.map +1 -0
- package/dist/tools/screenshots.d.ts +3 -0
- package/dist/tools/screenshots.d.ts.map +1 -0
- package/dist/tools/screenshots.js +132 -0
- package/dist/tools/screenshots.js.map +1 -0
- package/dist/tools/storage.d.ts +3 -0
- package/dist/tools/storage.d.ts.map +1 -0
- package/dist/tools/storage.js +200 -0
- package/dist/tools/storage.js.map +1 -0
- package/dist/tools/team.d.ts +3 -0
- package/dist/tools/team.d.ts.map +1 -0
- package/dist/tools/team.js +171 -0
- package/dist/tools/team.js.map +1 -0
- package/dist/tools/tests.d.ts +3 -0
- package/dist/tools/tests.d.ts.map +1 -0
- package/dist/tools/tests.js +309 -0
- package/dist/tools/tests.js.map +1 -0
- package/dist/tools/tunnels.d.ts +3 -0
- package/dist/tools/tunnels.d.ts.map +1 -0
- package/dist/tools/tunnels.js +74 -0
- package/dist/tools/tunnels.js.map +1 -0
- package/dist/tools/user.d.ts +3 -0
- package/dist/tools/user.d.ts.map +1 -0
- package/dist/tools/user.js +83 -0
- package/dist/tools/user.js.map +1 -0
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
TestingBot's official Model Context Protocol (MCP) server implementation. This server enables AI assistants to interact with TestingBot's testing infrastructure, allowing you to manage tests, browsers, devices, and more through conversational interfaces.
|
|
7
7
|
|
|
8
|
+
## ⚡ One-Click Install
|
|
9
|
+
|
|
10
|
+
[](https://testingbot.com/mcp/install?client=vscode) [](https://testingbot.com/mcp/install?client=cursor)
|
|
11
|
+
|
|
12
|
+
**Claude Desktop**: download `mcp-server.mcpb` from the [releases page](https://github.com/testingbot/mcp-server/releases) and double-click it. Claude will set up the TestingBot MCP server automatically.
|
|
13
|
+
|
|
14
|
+
After install, set your credentials from [TestingBot account settings](https://testingbot.com/members/user/security).
|
|
15
|
+
|
|
8
16
|
## Features
|
|
9
17
|
|
|
10
18
|
- 🖥️ **Live Testing** - Start interactive manual testing sessions on real browsers and devices
|
|
11
19
|
- 🌐 **Browser & Device Management** - Query available browsers and real devices
|
|
12
20
|
- 🧪 **Test Management** - Create, retrieve, update, and delete tests with comprehensive details
|
|
13
|
-
- 📦 **Storage Management** - Upload and manage mobile app files (APK, IPA)
|
|
21
|
+
- 📦 **Storage Management** - Upload and manage mobile app files (APK, IPA, ZIP)
|
|
14
22
|
- 📸 **Screenshot Testing** - Take cross-browser screenshots
|
|
15
23
|
- 🏗️ **Build Management** - Organize tests into builds
|
|
16
24
|
- 👤 **User Account** - View and update account information
|
|
@@ -42,9 +50,29 @@ npm install @testingbot/mcp-server
|
|
|
42
50
|
|
|
43
51
|
### Configuration
|
|
44
52
|
|
|
53
|
+
#### Recommended: log in with `tb_login` (no key/secret to copy)
|
|
54
|
+
|
|
55
|
+
You don't have to find and paste API credentials. Install the server, leave the
|
|
56
|
+
credentials blank, and just ask the agent:
|
|
57
|
+
|
|
58
|
+
> Log me in to TestingBot.
|
|
59
|
+
|
|
60
|
+
The agent calls the **`tb_login`** tool, which prints a short URL and code:
|
|
61
|
+
|
|
62
|
+
1. Open the URL in your browser (e.g. `https://testingbot.com/device`).
|
|
63
|
+
2. Enter the code, sign in if needed, and click **Authorize**.
|
|
64
|
+
3. Tell the agent you've authorized — it calls `tb_login` again to finish.
|
|
65
|
+
|
|
66
|
+
Your credentials are written to `~/.testingbot/credentials` (mode `0600`) and
|
|
67
|
+
used by every subsequent tool call — no restart, no JSON editing, and no secret
|
|
68
|
+
ever leaves the browser. This works in any MCP client (VS Code, Cursor, Cline,
|
|
69
|
+
Claude Desktop, …). To use a different account, set `TESTINGBOT_PROFILE`; to
|
|
70
|
+
relocate the file, set `TESTINGBOT_CONFIG_DIR`.
|
|
71
|
+
|
|
45
72
|
#### Environment Variables
|
|
46
73
|
|
|
47
|
-
|
|
74
|
+
Alternatively (or for CI, where env vars take precedence over the file), set your
|
|
75
|
+
TestingBot credentials as environment variables:
|
|
48
76
|
|
|
49
77
|
```bash
|
|
50
78
|
export TESTINGBOT_KEY="your-api-key"
|
|
@@ -116,6 +144,15 @@ Add to `.cursor/mcp.json`:
|
|
|
116
144
|
}
|
|
117
145
|
```
|
|
118
146
|
|
|
147
|
+
## 🤖 Let an AI Agent Drive a Remote Browser or Device
|
|
148
|
+
|
|
149
|
+
This server already includes the automation tools from [`@testingbot/automation-mcp`](https://github.com/testingbot/automation-mcp) — installing this package gives the agent the ability to **actually drive** a remote browser or real mobile device on TestingBot's grid, not just manage resources.
|
|
150
|
+
|
|
151
|
+
Just ask:
|
|
152
|
+
> Open Safari 17 on macOS on TestingBot. Navigate to example.com and click the "More information" link.
|
|
153
|
+
|
|
154
|
+
The agent will call `tb_openBrowser`, `tb_navigate`, `tb_snapshot`, `tb_click` — and surface a **live-view URL** so you can watch it in real time. For real iOS / Android devices, the bundled [`appium-mcp`](https://github.com/appium/appium-mcp) child gives the agent the full `appium_*` toolbelt (`appium_session_management`, `appium_gesture`, `appium_set_value`, `appium_screenshot`, ~30 more) — no separate install or config required. Just ask: _"Open an iPhone 15 Pro on iOS 17 on TestingBot, tap the login button, take a screenshot."_ See the [`@testingbot/automation-mcp` README](https://github.com/testingbot/automation-mcp#readme) for the full tool list, caveats (sessions are metered), and configuration options.
|
|
155
|
+
|
|
119
156
|
## Available Tools
|
|
120
157
|
|
|
121
158
|
### Live Testing
|
|
@@ -530,6 +567,9 @@ npm run lint
|
|
|
530
567
|
|
|
531
568
|
# Format code
|
|
532
569
|
npm run format
|
|
570
|
+
|
|
571
|
+
# Build the .mcpb bundle for Claude Desktop (see section below)
|
|
572
|
+
npm run mcpb
|
|
533
573
|
```
|
|
534
574
|
|
|
535
575
|
### Running Locally
|
|
@@ -552,6 +592,73 @@ npx @modelcontextprotocol/inspector node dist/index.js
|
|
|
552
592
|
|
|
553
593
|
Then open http://localhost:5173 in your browser.
|
|
554
594
|
|
|
595
|
+
### Building the `.mcpb` bundle (Claude Desktop release)
|
|
596
|
+
|
|
597
|
+
The `.mcpb` archive is what users double-click to install in Claude Desktop. The installer reads `manifest.json#user_config` and shows a credential prompt — no JSON editing or env-var fiddling.
|
|
598
|
+
|
|
599
|
+
```bash
|
|
600
|
+
# Prerequisites: mcpb CLI (one-time)
|
|
601
|
+
npm install -g @anthropic-ai/mcpb
|
|
602
|
+
|
|
603
|
+
# Build the bundle
|
|
604
|
+
npm run mcpb
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
This runs `scripts/build-mcpb.sh`, which:
|
|
608
|
+
|
|
609
|
+
1. Runs the full quality pipeline (`npm run build` → lint → format → test → tsc).
|
|
610
|
+
2. Stages a clean tree in a temp directory (only `dist/`, `manifest.json`, `package.json`, `LICENSE`, `README.md`, `icon.png` if present).
|
|
611
|
+
3. Runs `npm ci --omit=dev` inside staging — dev deps (typescript, eslint, vitest) never enter the bundle. `@testingbot/automation-mcp` is pulled from npm at the version pinned in `package.json`.
|
|
612
|
+
4. Validates the manifest and runs `mcpb pack` honoring `.mcpbignore` (strips test fixtures, source maps, dependency changelogs).
|
|
613
|
+
5. Writes `releases/testingbot-mcp-server-<version>.mcpb` and runs `mcpb info` on it.
|
|
614
|
+
|
|
615
|
+
Output is roughly 160 MB — most of that is the bundled `appium-mcp` mobile driver stack (XCUITest, UiAutomator2). The bundle is paid for once at install, not at runtime.
|
|
616
|
+
|
|
617
|
+
#### Sibling repo during development
|
|
618
|
+
|
|
619
|
+
For active development on both `@testingbot/mcp-server` and `@testingbot/automation-mcp` in lockstep, use `npm run dev:rebuild` from this repo. It builds both, then `npm link`s the sibling into this repo's `node_modules` so edits in `../testingbot-automation-mcp/src/` take effect on the next rebuild without a republish.
|
|
620
|
+
|
|
621
|
+
The link is one-shot — once set up, `dev:rebuild` notices it's in place and just builds. If you ever run `npm install` in this repo, the link is replaced with the registry copy; rerun `dev:rebuild` to restore.
|
|
622
|
+
|
|
623
|
+
#### Releasing
|
|
624
|
+
|
|
625
|
+
The release flow has two coordinated publish steps:
|
|
626
|
+
|
|
627
|
+
1. **Publish `@testingbot/automation-mcp` to npm** (from `../testingbot-automation-mcp`):
|
|
628
|
+
```bash
|
|
629
|
+
npm version patch # or minor / major
|
|
630
|
+
npm publish # publishConfig.access is "public" — handles scoped-pkg defaults
|
|
631
|
+
```
|
|
632
|
+
2. **Bump this repo to consume the new automation-mcp** and cut a release:
|
|
633
|
+
```bash
|
|
634
|
+
npm install @testingbot/automation-mcp@latest # updates package-lock.json
|
|
635
|
+
npm version patch # also syncs manifest.json + server.json
|
|
636
|
+
git push --follow-tags
|
|
637
|
+
# → Create a GitHub release at the new tag. The Build MCPB workflow
|
|
638
|
+
# fires on release:published and attaches releases/*.mcpb to it.
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
The release CI (`.github/workflows/build-mcpb.yml`) runs `npm run mcpb` on `macos-latest` and uploads the bundle as both a workflow artifact (30-day retention) and a release asset. Manual re-build: trigger via the Actions tab → "Build MCPB bundle" → enter the tag.
|
|
642
|
+
|
|
643
|
+
macOS is chosen so the bundled `appium-xcuitest-driver` carries its native bits. If you only target Linux/Windows users, you can switch the runner to `ubuntu-latest` for ~10× cheaper minutes — at the cost of iOS support in the bundled mobile path. Browser tools (via WebDriver) work cross-platform regardless.
|
|
644
|
+
|
|
645
|
+
To validate the manifest without building:
|
|
646
|
+
|
|
647
|
+
```bash
|
|
648
|
+
npm run mcpb:validate
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
To inspect a built bundle:
|
|
652
|
+
|
|
653
|
+
```bash
|
|
654
|
+
mcpb info releases/testingbot-mcp-server-<version>.mcpb
|
|
655
|
+
mcpb unpack releases/testingbot-mcp-server-<version>.mcpb /tmp/unpacked # see what's inside
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
The bundle is unsigned. To sign for distribution, run `mcpb sign --self-signed` (smoke-test) or `mcpb sign` with a real cert. See `mcpb sign --help`.
|
|
659
|
+
|
|
660
|
+
`releases/*.mcpb` is gitignored — upload the artefact to the GitHub releases page (or wherever your install URL points at) after building.
|
|
661
|
+
|
|
555
662
|
## Project Structure
|
|
556
663
|
|
|
557
664
|
```
|
|
@@ -589,9 +696,10 @@ testingbot-mcp-server/
|
|
|
589
696
|
### Authentication Errors
|
|
590
697
|
|
|
591
698
|
If you see authentication errors:
|
|
592
|
-
1.
|
|
593
|
-
2.
|
|
594
|
-
3.
|
|
699
|
+
1. Run the `tb_login` tool (just ask the agent to "log me in to TestingBot") — the simplest fix, no key/secret needed
|
|
700
|
+
2. Or verify your credentials at https://testingbot.com/members/user/security
|
|
701
|
+
3. Ensure environment variables are set correctly (env vars override the `tb_login` credentials file)
|
|
702
|
+
4. Check that there are no extra spaces in your credentials
|
|
595
703
|
|
|
596
704
|
### Connection Issues
|
|
597
705
|
|
|
@@ -651,8 +759,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
651
759
|
|
|
652
760
|
- 📧 Email: support@testingbot.com
|
|
653
761
|
- 🐛 Issues: [GitHub Issues](https://github.com/testingbot/mcp-server/issues)
|
|
654
|
-
- 📖 Documentation: [TestingBot Documentation](https://testingbot.com/support)
|
|
655
|
-
- 💬 Community: [TestingBot Forum](https://testingbot.com/support/forums)
|
|
762
|
+
- 📖 Documentation: [TestingBot MCP Documentation](https://testingbot.com/support/ai/mcp)
|
|
656
763
|
|
|
657
764
|
## Related
|
|
658
765
|
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAwBlD,wBAAgB,SAAS,IAAI,gBAAgB,CAY5C"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import dotenv from "dotenv";
|
|
2
|
+
import { loadFromCredentialsFile } from "./lib/credentials.js";
|
|
3
|
+
dotenv.config();
|
|
4
|
+
function fromEnv() {
|
|
5
|
+
const key = process.env.TESTINGBOT_KEY || process.env.TB_KEY || process.env.TESTINGBOT_USERNAME || "";
|
|
6
|
+
const secret = process.env.TESTINGBOT_SECRET ||
|
|
7
|
+
process.env.TB_SECRET ||
|
|
8
|
+
process.env.TESTINGBOT_ACCESS_KEY ||
|
|
9
|
+
"";
|
|
10
|
+
return { key, secret };
|
|
11
|
+
}
|
|
12
|
+
// Resolve TestingBot credentials. Precedence, highest first:
|
|
13
|
+
// 1. Environment variables (lets CI / MCP-client config override) — both a
|
|
14
|
+
// key and a secret must be present to count.
|
|
15
|
+
// 2. The credentials file written by the `tb_login` device-auth tool
|
|
16
|
+
// (~/.testingbot/credentials, profile `default` or $TESTINGBOT_PROFILE).
|
|
17
|
+
// 3. Neither: return empty strings. The server then runs in a degraded mode
|
|
18
|
+
// where every tool except `tb_login` reports "Run tb_login to authenticate"
|
|
19
|
+
// — making the first-run experience self-healing rather than a hard crash.
|
|
20
|
+
export function getConfig() {
|
|
21
|
+
const env = fromEnv();
|
|
22
|
+
if (env.key && env.secret) {
|
|
23
|
+
return { "testingbot-key": env.key, "testingbot-secret": env.secret };
|
|
24
|
+
}
|
|
25
|
+
const file = loadFromCredentialsFile();
|
|
26
|
+
if (file) {
|
|
27
|
+
return { "testingbot-key": file.key, "testingbot-secret": file.secret };
|
|
28
|
+
}
|
|
29
|
+
return { "testingbot-key": "", "testingbot-secret": "" };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,SAAS,OAAO;IACd,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE,CAAC;IAC5F,MAAM,MAAM,GACV,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAC7B,OAAO,CAAC,GAAG,CAAC,SAAS;QACrB,OAAO,CAAC,GAAG,CAAC,qBAAqB;QACjC,EAAE,CAAC;IACL,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,6DAA6D;AAC7D,6EAA6E;AAC7E,kDAAkD;AAClD,uEAAuE;AACvE,8EAA8E;AAC9E,8EAA8E;AAC9E,iFAAiF;AACjF,gFAAgF;AAChF,MAAM,UAAU,SAAS;IACvB,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IACtB,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QAC1B,OAAO,EAAE,gBAAgB,EAAE,GAAG,CAAC,GAAG,EAAE,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;IACxE,CAAC;IAED,MAAM,IAAI,GAAG,uBAAuB,EAAE,CAAC;IACvC,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,GAAG,EAAE,mBAAmB,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IAC1E,CAAC;IAED,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAAC;AAC3D,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAKA,OAAO,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// MUST be first: sets WDIO_LOG_LEVEL before any module pulls in `webdriver`, which
|
|
3
|
+
// would otherwise log to stdout and corrupt the stdio JSON-RPC stream. See the
|
|
4
|
+
// module for why a plain top-level assignment here is too late (ESM hoisting).
|
|
5
|
+
import "./silence-wdio.js";
|
|
6
|
+
import { getConfig } from "./config.js";
|
|
7
|
+
import { TestingBotMcpServer } from "./server-factory.js";
|
|
8
|
+
import logger from "./lib/logger.js";
|
|
9
|
+
import { createRequire } from "module";
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const TestingBot = require("testingbot-api");
|
|
12
|
+
async function main() {
|
|
13
|
+
logger.info("Starting TestingBot MCP Server...");
|
|
14
|
+
const config = getConfig();
|
|
15
|
+
const testingBotApi = new TestingBot({
|
|
16
|
+
api_key: config["testingbot-key"],
|
|
17
|
+
api_secret: config["testingbot-secret"],
|
|
18
|
+
});
|
|
19
|
+
const mcpServer = new TestingBotMcpServer(testingBotApi, config);
|
|
20
|
+
let shuttingDown = false;
|
|
21
|
+
const shutdown = async (signal, exitCode = 0) => {
|
|
22
|
+
if (shuttingDown)
|
|
23
|
+
return;
|
|
24
|
+
shuttingDown = true;
|
|
25
|
+
logger.info({ signal }, "Shutting down TestingBot MCP Server");
|
|
26
|
+
try {
|
|
27
|
+
await mcpServer.close();
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
process.exit(exitCode);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
process.on("SIGINT", () => void shutdown("SIGINT"));
|
|
34
|
+
process.on("SIGTERM", () => void shutdown("SIGTERM"));
|
|
35
|
+
process.on("unhandledRejection", (reason) => {
|
|
36
|
+
logger.error({ reason }, "Unhandled promise rejection");
|
|
37
|
+
void shutdown("unhandledRejection", 1);
|
|
38
|
+
});
|
|
39
|
+
process.on("uncaughtException", (error) => {
|
|
40
|
+
logger.error({ error }, "Uncaught exception");
|
|
41
|
+
void shutdown("uncaughtException", 1);
|
|
42
|
+
});
|
|
43
|
+
await mcpServer.run();
|
|
44
|
+
}
|
|
45
|
+
main().catch((error) => {
|
|
46
|
+
logger.error({ error }, "Failed to start server");
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,mFAAmF;AACnF,+EAA+E;AAC/E,+EAA+E;AAC/E,OAAO,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE7C,KAAK,UAAU,IAAI;I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AAE;QACxC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,oBAAoB,CAAC,CAAC;QAC9C,KAAK,QAAQ,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC;AACxB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,wBAAwB,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const SessionType: {
|
|
2
|
+
readonly WebDriver: "webdriver";
|
|
3
|
+
readonly Selenium: "selenium";
|
|
4
|
+
};
|
|
5
|
+
export declare const LogType: {
|
|
6
|
+
readonly SeleniumLog: "selenium-log";
|
|
7
|
+
readonly NetworkLog: "network-log";
|
|
8
|
+
readonly VitalsLog: "vitals-log";
|
|
9
|
+
readonly VideoLog: "video-log";
|
|
10
|
+
};
|
|
11
|
+
export declare const TestStatus: {
|
|
12
|
+
readonly Passed: "passed";
|
|
13
|
+
readonly Failed: "failed";
|
|
14
|
+
readonly Error: "error";
|
|
15
|
+
readonly Running: "running";
|
|
16
|
+
readonly Queued: "queued";
|
|
17
|
+
};
|
|
18
|
+
export declare const Platform: {
|
|
19
|
+
readonly Windows: "WINDOWS";
|
|
20
|
+
readonly Mac: "MAC";
|
|
21
|
+
readonly Linux: "LINUX";
|
|
22
|
+
readonly Android: "ANDROID";
|
|
23
|
+
readonly iOS: "IOS";
|
|
24
|
+
};
|
|
25
|
+
export declare const BrowserType: {
|
|
26
|
+
readonly Chrome: "chrome";
|
|
27
|
+
readonly Firefox: "firefox";
|
|
28
|
+
readonly Safari: "safari";
|
|
29
|
+
readonly Edge: "microsoftedge";
|
|
30
|
+
readonly IE: "internet explorer";
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX,eAAO,MAAM,OAAO;;;;;CAKV,CAAC;AAEX,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;;;CAMX,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;CAMd,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const SessionType = {
|
|
2
|
+
WebDriver: "webdriver",
|
|
3
|
+
Selenium: "selenium",
|
|
4
|
+
};
|
|
5
|
+
export const LogType = {
|
|
6
|
+
SeleniumLog: "selenium-log",
|
|
7
|
+
NetworkLog: "network-log",
|
|
8
|
+
VitalsLog: "vitals-log",
|
|
9
|
+
VideoLog: "video-log",
|
|
10
|
+
};
|
|
11
|
+
export const TestStatus = {
|
|
12
|
+
Passed: "passed",
|
|
13
|
+
Failed: "failed",
|
|
14
|
+
Error: "error",
|
|
15
|
+
Running: "running",
|
|
16
|
+
Queued: "queued",
|
|
17
|
+
};
|
|
18
|
+
export const Platform = {
|
|
19
|
+
Windows: "WINDOWS",
|
|
20
|
+
Mac: "MAC",
|
|
21
|
+
Linux: "LINUX",
|
|
22
|
+
Android: "ANDROID",
|
|
23
|
+
iOS: "IOS",
|
|
24
|
+
};
|
|
25
|
+
export const BrowserType = {
|
|
26
|
+
Chrome: "chrome",
|
|
27
|
+
Firefox: "firefox",
|
|
28
|
+
Safari: "safari",
|
|
29
|
+
Edge: "microsoftedge",
|
|
30
|
+
IE: "internet explorer",
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAEX,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,WAAW;CACb,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,eAAe;IACrB,EAAE,EAAE,mBAAmB;CACf,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Credentials {
|
|
2
|
+
key: string;
|
|
3
|
+
secret: string;
|
|
4
|
+
}
|
|
5
|
+
export interface DeviceCredentials {
|
|
6
|
+
client_key: string;
|
|
7
|
+
client_secret: string;
|
|
8
|
+
user: {
|
|
9
|
+
email: string;
|
|
10
|
+
id?: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function credentialsDir(): string;
|
|
14
|
+
export declare function credentialsPath(): string;
|
|
15
|
+
export declare function activeProfile(): string;
|
|
16
|
+
export declare function parseCredentialsIni(text: string): Record<string, Record<string, string>>;
|
|
17
|
+
export declare function loadFromCredentialsFile(profile?: string): Credentials | null;
|
|
18
|
+
export declare function writeCredentialsFile(creds: DeviceCredentials): string;
|
|
19
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/lib/credentials.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACtC;AAID,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAID,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkBxF;AAKD,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,MAAwB,GAAG,WAAW,GAAG,IAAI,CAa7F;AA4CD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAgCrE"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { homedir } from "os";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, chmodSync, renameSync, statSync, } from "fs";
|
|
4
|
+
const DEFAULT_PROFILE = "default";
|
|
5
|
+
export function credentialsDir() {
|
|
6
|
+
return process.env.TESTINGBOT_CONFIG_DIR || join(homedir(), ".testingbot");
|
|
7
|
+
}
|
|
8
|
+
export function credentialsPath() {
|
|
9
|
+
return join(credentialsDir(), "credentials");
|
|
10
|
+
}
|
|
11
|
+
export function activeProfile() {
|
|
12
|
+
return process.env.TESTINGBOT_PROFILE || DEFAULT_PROFILE;
|
|
13
|
+
}
|
|
14
|
+
// Parse an INI document into { profile: { key: value } }. Tolerates comments
|
|
15
|
+
// (`#` / `;`), blank lines, and values containing `=`.
|
|
16
|
+
export function parseCredentialsIni(text) {
|
|
17
|
+
const out = {};
|
|
18
|
+
let current = null;
|
|
19
|
+
for (const raw of text.split("\n")) {
|
|
20
|
+
const line = raw.trim();
|
|
21
|
+
if (!line || line.startsWith("#") || line.startsWith(";"))
|
|
22
|
+
continue;
|
|
23
|
+
const section = /^\[(.+)\]$/.exec(line);
|
|
24
|
+
if (section) {
|
|
25
|
+
current = section[1].trim();
|
|
26
|
+
out[current] = {};
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (!current)
|
|
30
|
+
continue;
|
|
31
|
+
const eq = line.indexOf("=");
|
|
32
|
+
if (eq < 0)
|
|
33
|
+
continue;
|
|
34
|
+
out[current][line.slice(0, eq).trim()] = line.slice(eq + 1).trim();
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
// Load credentials from the credentials file for the active profile. Returns
|
|
39
|
+
// null when the file is missing, the profile is absent, or it lacks a complete
|
|
40
|
+
// key/secret pair — callers treat null as "no credentials".
|
|
41
|
+
export function loadFromCredentialsFile(profile = activeProfile()) {
|
|
42
|
+
const path = credentialsPath();
|
|
43
|
+
if (!existsSync(path))
|
|
44
|
+
return null;
|
|
45
|
+
let text;
|
|
46
|
+
try {
|
|
47
|
+
text = readFileSync(path, "utf8");
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const parsed = parseCredentialsIni(text);
|
|
53
|
+
const p = parsed[profile];
|
|
54
|
+
if (!p?.key || !p?.secret)
|
|
55
|
+
return null;
|
|
56
|
+
return { key: p.key, secret: p.secret };
|
|
57
|
+
}
|
|
58
|
+
// Older versions of testingbot-api stored credentials at ~/.testingbot as a
|
|
59
|
+
// single FILE in `key:secret` form (see node_modules/testingbot-api/lib/api.js
|
|
60
|
+
// _loadConfig). Our directory layout collides with that path, so mkdirSync would
|
|
61
|
+
// throw EEXIST. Move the legacy file aside (preserving it) before creating the
|
|
62
|
+
// directory. Returns the backup path, or null if there was nothing to move.
|
|
63
|
+
function relocateLegacyCredentialFile(dir) {
|
|
64
|
+
if (!existsSync(dir) || !statSync(dir).isFile())
|
|
65
|
+
return null;
|
|
66
|
+
for (let i = 0; i < 100; i++) {
|
|
67
|
+
const target = i === 0 ? `${dir}.legacy.bak` : `${dir}.legacy.bak.${i}`;
|
|
68
|
+
if (!existsSync(target)) {
|
|
69
|
+
renameSync(dir, target);
|
|
70
|
+
return target;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
throw new Error(`${dir} exists as a legacy credentials file and could not be moved aside. ` +
|
|
74
|
+
`Rename or remove it manually, then run tb_login again.`);
|
|
75
|
+
}
|
|
76
|
+
function serializeCredentialsIni(profiles, accountEmail) {
|
|
77
|
+
const lines = [
|
|
78
|
+
`# Written by @testingbot/mcp-server tb_login at ${new Date().toISOString()}`,
|
|
79
|
+
`# Account: ${accountEmail}`,
|
|
80
|
+
];
|
|
81
|
+
for (const [name, kv] of Object.entries(profiles)) {
|
|
82
|
+
lines.push(`[${name}]`);
|
|
83
|
+
for (const [k, v] of Object.entries(kv))
|
|
84
|
+
lines.push(`${k} = ${v}`);
|
|
85
|
+
lines.push("");
|
|
86
|
+
}
|
|
87
|
+
return lines.join("\n");
|
|
88
|
+
}
|
|
89
|
+
// Persist credentials returned by the device-auth flow into the active profile.
|
|
90
|
+
// Creates the directory (0700) and file (0600) with restrictive permissions —
|
|
91
|
+
// same UNIX convention as ~/.aws/credentials and ~/.ssh. Returns the file path.
|
|
92
|
+
//
|
|
93
|
+
// Other profiles already present in the file are preserved (read-merge-write):
|
|
94
|
+
// authenticating under TESTINGBOT_PROFILE=team must not wipe [default].
|
|
95
|
+
export function writeCredentialsFile(creds) {
|
|
96
|
+
const dir = credentialsDir();
|
|
97
|
+
relocateLegacyCredentialFile(dir);
|
|
98
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
99
|
+
try {
|
|
100
|
+
chmodSync(dir, 0o700);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
// Best effort — chmod is a no-op / may be unsupported on some platforms.
|
|
104
|
+
}
|
|
105
|
+
const path = credentialsPath();
|
|
106
|
+
const profiles = existsSync(path) ? parseCredentialsIni(readFileSync(path, "utf8")) : {};
|
|
107
|
+
// Merge into the active profile (preserve any extra keys it already held) and
|
|
108
|
+
// leave all other profiles untouched.
|
|
109
|
+
profiles[activeProfile()] = {
|
|
110
|
+
...profiles[activeProfile()],
|
|
111
|
+
key: creds.client_key,
|
|
112
|
+
secret: creds.client_secret,
|
|
113
|
+
};
|
|
114
|
+
// Write to a fresh temp file (so mode 0600 applies at creation — writeFileSync's
|
|
115
|
+
// mode is ignored for a pre-existing world-readable file) and rename atomically
|
|
116
|
+
// over the target. This guarantees the secret is never briefly world-readable.
|
|
117
|
+
const tmp = `${path}.tmp`;
|
|
118
|
+
writeFileSync(tmp, serializeCredentialsIni(profiles, creds.user.email), { mode: 0o600 });
|
|
119
|
+
try {
|
|
120
|
+
chmodSync(tmp, 0o600);
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Best effort — chmod is a no-op / may be unsupported on some platforms.
|
|
124
|
+
}
|
|
125
|
+
renameSync(tmp, path);
|
|
126
|
+
return path;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/lib/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SA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AAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACjD,IAAI,CAAC;QACH,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,yEAAyE;IAC3E,CAAC;IAED,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzF,8EAA8E;IAC9E,sCAAsC;IACtC,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG;QAC1B,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC5B,GAAG,EAAE,KAAK,CAAC,UAAU;QACrB,MAAM,EAAE,KAAK,CAAC,aAAa;KAC5B,CAAC;IAEF,iFAAiF;IACjF,gFAAgF;IAChF,+EAA+E;IAC/E,MAAM,GAAG,GAAG,GAAG,IAAI,MAAM,CAAC;IAC1B,aAAa,CAAC,GAAG,EAAE,uBAAuB,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACzF,IAAI,CAAC;QACH,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,yEAAyE;IAC3E,CAAC;IACD,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class TestingBotMCPError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class AuthenticationError extends TestingBotMCPError {
|
|
5
|
+
constructor(message?: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class APIError extends TestingBotMCPError {
|
|
8
|
+
statusCode?: number | undefined;
|
|
9
|
+
constructor(message: string, statusCode?: number | undefined);
|
|
10
|
+
}
|
|
11
|
+
export declare class ValidationError extends TestingBotMCPError {
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/lib/error.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,mBAAoB,SAAQ,kBAAkB;gBAC7C,OAAO,SAA0D;CAI9E;AAED,qBAAa,QAAS,SAAQ,kBAAkB;IAGrC,UAAU,CAAC,EAAE,MAAM;gBAD1B,OAAO,EAAE,MAAM,EACR,UAAU,CAAC,EAAE,MAAM,YAAA;CAK7B;AAED,qBAAa,eAAgB,SAAQ,kBAAkB;gBACzC,OAAO,EAAE,MAAM;CAI5B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class TestingBotMCPError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = "TestingBotMCPError";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class AuthenticationError extends TestingBotMCPError {
|
|
8
|
+
constructor(message = "Authentication failed. Please check your credentials.") {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "AuthenticationError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class APIError extends TestingBotMCPError {
|
|
14
|
+
statusCode;
|
|
15
|
+
constructor(message, statusCode) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.statusCode = statusCode;
|
|
18
|
+
this.name = "APIError";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class ValidationError extends TestingBotMCPError {
|
|
22
|
+
constructor(message) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = "ValidationError";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/lib/error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IACzD,YAAY,OAAO,GAAG,uDAAuD;QAC3E,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,MAAM,OAAO,QAAS,SAAQ,kBAAkB;IAGrC;IAFT,YACE,OAAe,EACR,UAAmB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,eAAU,GAAV,UAAU,CAAS;QAG1B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,kBAAkB;IACrD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-auth.d.ts","sourceRoot":"","sources":["../../src/lib/get-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,OAAO,CAAC,MAAM,EAAE,gBAAgB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAKxF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-auth.js","sourceRoot":"","sources":["../../src/lib/get-auth.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,OAAO,CAAC,MAAwB;IAC9C,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC;QAClC,QAAQ,EAAE,MAAM,CAAC,mBAAmB,CAAC;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AA0CxB,QAAA,MAAM,MAAM,6BAoCR,CAAC;AAOL,eAAe,MAAM,CAAC"}
|