@hunt-labs/bytekit-mcp 0.1.0 → 0.1.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/LICENSE +21 -0
- package/README.md +117 -0
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +22 -6
- package/dist/client.d.ts +7 -29
- package/dist/client.js +0 -5
- package/dist/docs-bundle/docs-bundle.json +46 -46
- package/dist/docs-bundle/helpers.d.ts +0 -1
- package/dist/docs-bundle/helpers.js +0 -1
- package/dist/docs-bundle/load-bundle.d.ts +0 -1
- package/dist/docs-bundle/load-bundle.js +0 -1
- package/dist/http.d.ts +0 -1
- package/dist/http.js +0 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +12 -2
- package/dist/lib/truncate.d.ts +0 -1
- package/dist/lib/truncate.js +0 -1
- package/dist/prompts/extract-structured-data.d.ts +0 -1
- package/dist/prompts/extract-structured-data.js +0 -1
- package/dist/prompts/research-topic.d.ts +0 -1
- package/dist/prompts/research-topic.js +0 -1
- package/dist/prompts/summarize-webpage.d.ts +0 -1
- package/dist/prompts/summarize-webpage.js +0 -1
- package/dist/resources/account.d.ts +0 -1
- package/dist/resources/account.js +0 -1
- package/dist/resources/screenshot.d.ts +0 -1
- package/dist/resources/screenshot.js +0 -1
- package/dist/scrape-contract.generated.d.ts +166 -0
- package/dist/scrape-contract.generated.js +9 -0
- package/dist/tools/get-account.d.ts +0 -1
- package/dist/tools/get-account.js +0 -1
- package/dist/tools/get-doc.d.ts +0 -1
- package/dist/tools/get-doc.js +0 -1
- package/dist/tools/get-result.d.ts +0 -1
- package/dist/tools/get-result.js +0 -1
- package/dist/tools/list-docs.d.ts +0 -1
- package/dist/tools/list-docs.js +0 -1
- package/dist/tools/scrape-url.d.ts +0 -1
- package/dist/tools/scrape-url.js +48 -8
- package/dist/tools/screenshot-url.d.ts +0 -1
- package/dist/tools/screenshot-url.js +0 -1
- package/dist/tools/search-docs.d.ts +0 -1
- package/dist/tools/search-docs.js +0 -1
- package/dist/tools/web-search.d.ts +0 -1
- package/dist/tools/web-search.js +0 -1
- package/package.json +34 -9
- package/dist/__tests__/build-docs-bundle.test.d.ts +0 -2
- package/dist/__tests__/build-docs-bundle.test.d.ts.map +0 -1
- package/dist/__tests__/build-docs-bundle.test.js +0 -133
- package/dist/__tests__/build-docs-bundle.test.js.map +0 -1
- package/dist/__tests__/cli.test.d.ts +0 -2
- package/dist/__tests__/cli.test.d.ts.map +0 -1
- package/dist/__tests__/cli.test.js +0 -41
- package/dist/__tests__/cli.test.js.map +0 -1
- package/dist/__tests__/client.test.d.ts +0 -2
- package/dist/__tests__/client.test.d.ts.map +0 -1
- package/dist/__tests__/client.test.js +0 -248
- package/dist/__tests__/client.test.js.map +0 -1
- package/dist/__tests__/integration.test.d.ts +0 -2
- package/dist/__tests__/integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration.test.js +0 -116
- package/dist/__tests__/integration.test.js.map +0 -1
- package/dist/__tests__/package-manifest.test.d.ts +0 -2
- package/dist/__tests__/package-manifest.test.d.ts.map +0 -1
- package/dist/__tests__/package-manifest.test.js +0 -71
- package/dist/__tests__/package-manifest.test.js.map +0 -1
- package/dist/__tests__/prompts.test.d.ts +0 -2
- package/dist/__tests__/prompts.test.d.ts.map +0 -1
- package/dist/__tests__/prompts.test.js +0 -92
- package/dist/__tests__/prompts.test.js.map +0 -1
- package/dist/__tests__/resources.test.d.ts +0 -2
- package/dist/__tests__/resources.test.d.ts.map +0 -1
- package/dist/__tests__/resources.test.js +0 -67
- package/dist/__tests__/resources.test.js.map +0 -1
- package/dist/__tests__/server-info.test.d.ts +0 -2
- package/dist/__tests__/server-info.test.d.ts.map +0 -1
- package/dist/__tests__/server-info.test.js +0 -14
- package/dist/__tests__/server-info.test.js.map +0 -1
- package/dist/__tests__/tools.test.d.ts +0 -2
- package/dist/__tests__/tools.test.d.ts.map +0 -1
- package/dist/__tests__/tools.test.js +0 -452
- package/dist/__tests__/tools.test.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/docs-bundle/helpers.d.ts.map +0 -1
- package/dist/docs-bundle/helpers.js.map +0 -1
- package/dist/docs-bundle/load-bundle.d.ts.map +0 -1
- package/dist/docs-bundle/load-bundle.js.map +0 -1
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/truncate.d.ts.map +0 -1
- package/dist/lib/truncate.js.map +0 -1
- package/dist/prompts/extract-structured-data.d.ts.map +0 -1
- package/dist/prompts/extract-structured-data.js.map +0 -1
- package/dist/prompts/research-topic.d.ts.map +0 -1
- package/dist/prompts/research-topic.js.map +0 -1
- package/dist/prompts/summarize-webpage.d.ts.map +0 -1
- package/dist/prompts/summarize-webpage.js.map +0 -1
- package/dist/resources/account.d.ts.map +0 -1
- package/dist/resources/account.js.map +0 -1
- package/dist/resources/screenshot.d.ts.map +0 -1
- package/dist/resources/screenshot.js.map +0 -1
- package/dist/tools/__tests__/docs-tools.test.d.ts +0 -8
- package/dist/tools/__tests__/docs-tools.test.d.ts.map +0 -1
- package/dist/tools/__tests__/docs-tools.test.js +0 -194
- package/dist/tools/__tests__/docs-tools.test.js.map +0 -1
- package/dist/tools/__tests__/fixture-bundle.json +0 -27
- package/dist/tools/get-account.d.ts.map +0 -1
- package/dist/tools/get-account.js.map +0 -1
- package/dist/tools/get-doc.d.ts.map +0 -1
- package/dist/tools/get-doc.js.map +0 -1
- package/dist/tools/get-result.d.ts.map +0 -1
- package/dist/tools/get-result.js.map +0 -1
- package/dist/tools/list-docs.d.ts.map +0 -1
- package/dist/tools/list-docs.js.map +0 -1
- package/dist/tools/scrape-url.d.ts.map +0 -1
- package/dist/tools/scrape-url.js.map +0 -1
- package/dist/tools/screenshot-url.d.ts.map +0 -1
- package/dist/tools/screenshot-url.js.map +0 -1
- package/dist/tools/search-docs.d.ts.map +0 -1
- package/dist/tools/search-docs.js.map +0 -1
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/web-search.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hunt Labs, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# @hunt-labs/bytekit-mcp
|
|
2
|
+
|
|
3
|
+
The [ByteKit](https://bytekit.com) **MCP server** exposes scraping, search,
|
|
4
|
+
screenshots, and account lookups as
|
|
5
|
+
[Model Context Protocol](https://modelcontextprotocol.io) tools. Your agent calls
|
|
6
|
+
`scrape_url` or `screenshot_url` the same way it calls any other tool — no
|
|
7
|
+
wrapper to write, no headless browser to manage.
|
|
8
|
+
|
|
9
|
+
There are two ways to connect: a **hosted HTTP endpoint** (nothing to install)
|
|
10
|
+
and a **local stdio server** (`npx @hunt-labs/bytekit-mcp`).
|
|
11
|
+
|
|
12
|
+
## Authentication
|
|
13
|
+
|
|
14
|
+
Both paths authenticate with a ByteKit API key. Sign up at
|
|
15
|
+
[app.bytekit.com](https://app.bytekit.com) and create a key (prefixed
|
|
16
|
+
`sk_live_`). The local server reads it from the `BYTEKIT_API_KEY` environment
|
|
17
|
+
variable (or the `--api-key` flag); the hosted endpoint takes it as a bearer
|
|
18
|
+
token.
|
|
19
|
+
|
|
20
|
+
## Option 1 — Hosted HTTP (no install)
|
|
21
|
+
|
|
22
|
+
Point any MCP client that speaks the Streamable HTTP transport at:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
https://api.bytekit.com/mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Send your API key as a bearer token. Example client config (Claude Desktop,
|
|
29
|
+
Cursor, and most hosts accept this shape):
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"bytekit": {
|
|
35
|
+
"url": "https://api.bytekit.com/mcp",
|
|
36
|
+
"headers": {
|
|
37
|
+
"Authorization": "Bearer $BYTEKIT_API_KEY"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Option 2 — Local stdio (`npx`)
|
|
45
|
+
|
|
46
|
+
Run the server as a local subprocess over stdio. Nothing to install globally —
|
|
47
|
+
`npx` fetches it on demand:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx @hunt-labs/bytekit-mcp --api-key $BYTEKIT_API_KEY
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or set the key in your environment and omit the flag:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
export BYTEKIT_API_KEY=sk_live_xxx
|
|
57
|
+
npx @hunt-labs/bytekit-mcp
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Client config for a stdio server (`claude_desktop_config.json` and equivalents):
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"bytekit": {
|
|
66
|
+
"command": "npx",
|
|
67
|
+
"args": ["-y", "@hunt-labs/bytekit-mcp"],
|
|
68
|
+
"env": {
|
|
69
|
+
"BYTEKIT_API_KEY": "sk_live_xxx"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### CLI flags
|
|
77
|
+
|
|
78
|
+
| Flag | Purpose |
|
|
79
|
+
| ------------------ | --------------------------------------------------------------------------------------- |
|
|
80
|
+
| `--api-key <key>` | ByteKit API key. |
|
|
81
|
+
| `--base-url <url>` | API base URL (default `https://api.bytekit.com`) — point at staging or a local gateway. |
|
|
82
|
+
| `--verbose` | Log requests to stderr. |
|
|
83
|
+
| `--help` | Show usage. |
|
|
84
|
+
|
|
85
|
+
### API-key resolution order
|
|
86
|
+
|
|
87
|
+
The local server resolves the key in this order, so a legacy setup keeps
|
|
88
|
+
working:
|
|
89
|
+
|
|
90
|
+
1. `--api-key <key>` flag
|
|
91
|
+
2. `BYTEKIT_API_KEY` environment variable
|
|
92
|
+
3. `RAPIDCRAWL_API_KEY` environment variable (legacy fallback)
|
|
93
|
+
|
|
94
|
+
## Tool inventory
|
|
95
|
+
|
|
96
|
+
| Tool | What it does |
|
|
97
|
+
| ---------------- | -------------------------------------------------------------- |
|
|
98
|
+
| `scrape_url` | Fetch a URL and return HTML, clean markdown, links, or images. |
|
|
99
|
+
| `web-search` | Run a web search and return ranked organic results. |
|
|
100
|
+
| `screenshot_url` | Capture a screenshot of a page (desktop/mobile, PNG/JPEG). |
|
|
101
|
+
| `get_result` | Fetch a previously created screenshot by id. |
|
|
102
|
+
| `get_account` | Return account details, plan, and current usage/quota. |
|
|
103
|
+
| `list_docs` | List every page in the bundled ByteKit documentation. |
|
|
104
|
+
| `search_docs` | Search the bundled documentation. |
|
|
105
|
+
| `get_doc` | Fetch the full markdown of one documentation page. |
|
|
106
|
+
|
|
107
|
+
The server also exposes **resources** (`bytekit://account`,
|
|
108
|
+
`bytekit://screenshot/{id}`) and **prompts** (`summarize_webpage`,
|
|
109
|
+
`extract_structured_data`, `research_topic`) that MCP hosts can surface directly.
|
|
110
|
+
|
|
111
|
+
## Documentation
|
|
112
|
+
|
|
113
|
+
Full MCP guide: [bytekit.com/docs/mcp](https://bytekit.com/docs/mcp).
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
MIT — see [LICENSE](./LICENSE).
|
package/dist/cli.d.ts
CHANGED
|
@@ -25,4 +25,8 @@ export declare function resolveApiKey(opts: {
|
|
|
25
25
|
}): string | undefined;
|
|
26
26
|
export declare const API_KEY_REQUIRED_MESSAGE = "Error: API key required. Use --api-key or set the BYTEKIT_API_KEY environment variable.\n";
|
|
27
27
|
export declare const HELP_TEXT = "ByteKit MCP Server\n\nUsage:\n bytekit-mcp --api-key <key> [--base-url <url>] [--verbose]\n\nOptions:\n --api-key ByteKit API key. Resolution order: --api-key flag, then\n BYTEKIT_API_KEY, then RAPIDCRAWL_API_KEY (legacy fallback).\n --base-url API base URL (default: https://api.bytekit.com)\n --verbose Log requests to stderr\n --help Show this help message\n";
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* True when this module is the process entrypoint (run directly or via its bin),
|
|
30
|
+
* false when it is merely imported (e.g. the test suite exercising resolveApiKey).
|
|
31
|
+
*/
|
|
32
|
+
export declare function isEntrypoint(argv1: string | undefined, moduleUrl: string): boolean;
|
package/dist/cli.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { parseArgs } from 'node:util';
|
|
10
10
|
import { pathToFileURL } from 'node:url';
|
|
11
|
+
import { realpathSync } from 'node:fs';
|
|
11
12
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
12
13
|
import { createServer, BytekitClient } from './index.js';
|
|
13
14
|
/**
|
|
@@ -75,11 +76,26 @@ async function main() {
|
|
|
75
76
|
process.on('SIGTERM', () => void shutdown());
|
|
76
77
|
await server.connect(transport);
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
/**
|
|
80
|
+
* True when this module is the process entrypoint (run directly or via its bin),
|
|
81
|
+
* false when it is merely imported (e.g. the test suite exercising resolveApiKey).
|
|
82
|
+
*/
|
|
83
|
+
export function isEntrypoint(argv1, moduleUrl) {
|
|
84
|
+
if (argv1 === undefined)
|
|
85
|
+
return false;
|
|
86
|
+
// Resolve symlinks: for a bin entrypoint (npx cache, node_modules/.bin, `npm i -g`)
|
|
87
|
+
// node reports the real file in import.meta.url but leaves process.argv[1] as the
|
|
88
|
+
// symlink path. Comparing them raw is always false, so main() never runs and the
|
|
89
|
+
// CLI silently does nothing. realpath makes both sides the real cli.js path.
|
|
90
|
+
let resolved = argv1;
|
|
91
|
+
try {
|
|
92
|
+
resolved = realpathSync(argv1);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
// argv1 may not be a real path in exotic launchers; fall back to the raw value.
|
|
96
|
+
}
|
|
97
|
+
return moduleUrl === pathToFileURL(resolved).href;
|
|
98
|
+
}
|
|
99
|
+
if (isEntrypoint(process.argv[1], import.meta.url)) {
|
|
83
100
|
await main();
|
|
84
101
|
}
|
|
85
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/client.d.ts
CHANGED
|
@@ -1,39 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ByteKit API client -- thin fetch wrapper used by all MCP tools.
|
|
3
|
-
* Uses native fetch (Node
|
|
3
|
+
* Uses native fetch (Node 18+). No external HTTP dependencies.
|
|
4
|
+
*
|
|
5
|
+
* The package's declared floor is Node >=18.3 (see package.json `engines`), set by
|
|
6
|
+
* `parseArgs` from node:util in src/cli.ts -- not by fetch, and not by anything requiring Node 22.
|
|
4
7
|
*/
|
|
5
|
-
|
|
8
|
+
import type { Format, ScrapeEnvelope } from './scrape-contract.generated.js';
|
|
9
|
+
export type ScrapeFormat = Format;
|
|
6
10
|
export interface ScrapeParams {
|
|
7
11
|
url: string;
|
|
8
12
|
formats?: ScrapeFormat[] | undefined;
|
|
9
13
|
country?: string | undefined;
|
|
10
14
|
}
|
|
11
|
-
export
|
|
12
|
-
status: 'success';
|
|
13
|
-
scrapeId: string;
|
|
14
|
-
url: string;
|
|
15
|
-
finalUrl: string;
|
|
16
|
-
contentType: string;
|
|
17
|
-
contentLength: number;
|
|
18
|
-
statusCode: number | null;
|
|
19
|
-
retrievedAt: string;
|
|
20
|
-
formats: {
|
|
21
|
-
rawHtml?: string | undefined;
|
|
22
|
-
html?: string | undefined;
|
|
23
|
-
markdown?: string | undefined;
|
|
24
|
-
links?: string[] | undefined;
|
|
25
|
-
images?: string[] | undefined;
|
|
26
|
-
};
|
|
27
|
-
metadata: {
|
|
28
|
-
title: string | null;
|
|
29
|
-
description: string | null;
|
|
30
|
-
language: string | null;
|
|
31
|
-
canonicalUrl: string | null;
|
|
32
|
-
ogTitle: string | null;
|
|
33
|
-
ogDescription: string | null;
|
|
34
|
-
ogImage: string | null;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
15
|
+
export type ScrapeResult = ScrapeEnvelope;
|
|
37
16
|
/** Which search index to query. `web` (default), `news`, or `images`. */
|
|
38
17
|
export type SearchType = 'web' | 'news' | 'images';
|
|
39
18
|
/** Recency window for search results (maps to the upstream time filter). */
|
|
@@ -156,4 +135,3 @@ export declare class BytekitClient {
|
|
|
156
135
|
private get;
|
|
157
136
|
private handleErrorResponse;
|
|
158
137
|
}
|
|
159
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ByteKit API client -- thin fetch wrapper used by all MCP tools.
|
|
3
|
-
* Uses native fetch (Node 22+). No external HTTP dependencies.
|
|
4
|
-
*/
|
|
5
1
|
// ============================================================
|
|
6
2
|
// Error
|
|
7
3
|
// ============================================================
|
|
@@ -164,4 +160,3 @@ export class BytekitClient {
|
|
|
164
160
|
throw new BytekitApiError(`Unexpected API error (HTTP ${status}).`, status, 'unknown_error');
|
|
165
161
|
}
|
|
166
162
|
}
|
|
167
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"cli/scrape": {
|
|
83
83
|
"title": "Scrape",
|
|
84
84
|
"section": "General",
|
|
85
|
-
"body": "# Scrape\n\nScrape URL content\n\nScrape URL content\n\n### scrape › bulk\n\nBulk scrape operations\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### scrape › bulk › create\n\nCreate a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to newline-delimited file of URLs (plain URL or |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk create --file <path> --webhook-url <url>\n```\n\n#### scrape › bulk › get\n\nGet a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk get <id>\n```\n\n### scrape › create\n\nCreate a scrape job\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to scrape |\n| `--format <format>` | Output format (e.g. markdown, html); sent as the formats |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape create --url <url> --format <format
|
|
85
|
+
"body": "# Scrape\n\nScrape URL content\n\nScrape URL content\n\n### scrape › bulk\n\nBulk scrape operations\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### scrape › bulk › create\n\nCreate a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to newline-delimited file of URLs (plain URL or |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk create --file <path> --webhook-url <url>\n```\n\n#### scrape › bulk › get\n\nGet a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk get <id>\n```\n\n### scrape › create\n\nCreate a scrape job\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to scrape |\n| `--format <format>` | Output format (e.g. markdown, html); sent as the formats |\n| `--raw` | Print the requested format body raw, with no JSON |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape create --url <url> --format <format> --raw\n```\n\n### scrape › get\n\nGet a scrape job by ID\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape get <id>\n```"
|
|
86
86
|
},
|
|
87
87
|
"cli/screenshots": {
|
|
88
88
|
"title": "Screenshots",
|
|
@@ -119,36 +119,6 @@
|
|
|
119
119
|
"section": "API Reference",
|
|
120
120
|
"body": "# Account\n\nAccount API — endpoints, requests, and responses.\n\nThe **Account** API. 1 endpoint:\n\n- [Get account details](https://bytekit.com/docs/api/account/getaccount) — GET /v1/account"
|
|
121
121
|
},
|
|
122
|
-
"api/fetch-bulk/createfetchbulk": {
|
|
123
|
-
"title": "Bulk fetch URLs",
|
|
124
|
-
"section": "API Reference",
|
|
125
|
-
"body": "# Bulk fetch URLs\n\nEnqueues multiple URLs for HTTP fetching. Results delivered via webhook.\nDoes not support options that require page rendering (cookies, wait_for_selector, etc.).\n"
|
|
126
|
-
},
|
|
127
|
-
"api/fetch-bulk/getfetchbulk": {
|
|
128
|
-
"title": "Get fetch bulk job status",
|
|
129
|
-
"section": "API Reference",
|
|
130
|
-
"body": "# Get fetch bulk job status"
|
|
131
|
-
},
|
|
132
|
-
"api/fetch-bulk": {
|
|
133
|
-
"title": "Fetch Bulk",
|
|
134
|
-
"section": "API Reference",
|
|
135
|
-
"body": "# Fetch Bulk\n\nFetch Bulk API — endpoints, requests, and responses.\n\nThe **Fetch Bulk** API. 2 endpoints:\n\n- [Bulk fetch URLs](https://bytekit.com/docs/api/fetch-bulk/createfetchbulk) — POST /v1/fetch/bulk\n- [Get fetch bulk job status](https://bytekit.com/docs/api/fetch-bulk/getfetchbulk) — GET /v1/fetch/bulk/:id"
|
|
136
|
-
},
|
|
137
|
-
"api/fetch/getfetch": {
|
|
138
|
-
"title": "Fetch a URL (GET)",
|
|
139
|
-
"section": "API Reference",
|
|
140
|
-
"body": "# Fetch a URL (GET)\n\nDirect HTTP fetch. The response body IS the content; metadata is returned in X-Fetch-* headers.\nOmit `format` for raw passthrough. Use `format=markdown` or `format=html` for conversion.\n"
|
|
141
|
-
},
|
|
142
|
-
"api/fetch": {
|
|
143
|
-
"title": "Fetch",
|
|
144
|
-
"section": "API Reference",
|
|
145
|
-
"body": "# Fetch\n\nFetch API — endpoints, requests, and responses.\n\nThe **Fetch** API. 2 endpoints:\n\n- [Fetch a URL (GET)](https://bytekit.com/docs/api/fetch/getfetch) — GET /v1/fetch\n- [Fetch a URL (POST)](https://bytekit.com/docs/api/fetch/postfetch) — POST /v1/fetch"
|
|
146
|
-
},
|
|
147
|
-
"api/fetch/postfetch": {
|
|
148
|
-
"title": "Fetch a URL (POST)",
|
|
149
|
-
"section": "API Reference",
|
|
150
|
-
"body": "# Fetch a URL (POST)\n\nSame as GET /v1/fetch but with a JSON request body."
|
|
151
|
-
},
|
|
152
122
|
"api/bulk/createbulk": {
|
|
153
123
|
"title": "Create mixed bulk job",
|
|
154
124
|
"section": "API Reference",
|
|
@@ -179,6 +149,21 @@
|
|
|
179
149
|
"section": "API Reference",
|
|
180
150
|
"body": "# List bulk job items"
|
|
181
151
|
},
|
|
152
|
+
"api/fetch/getfetch": {
|
|
153
|
+
"title": "Fetch a URL (GET)",
|
|
154
|
+
"section": "API Reference",
|
|
155
|
+
"body": "# Fetch a URL (GET)\n\nDirect HTTP fetch. The response body IS the content; metadata is returned in X-Fetch-* headers.\nOmit `format` for raw passthrough. Use `format=markdown` or `format=html` for conversion.\n"
|
|
156
|
+
},
|
|
157
|
+
"api/fetch": {
|
|
158
|
+
"title": "Fetch",
|
|
159
|
+
"section": "API Reference",
|
|
160
|
+
"body": "# Fetch\n\nFetch API — endpoints, requests, and responses.\n\nThe **Fetch** API. 2 endpoints:\n\n- [Fetch a URL (GET)](https://bytekit.com/docs/api/fetch/getfetch) — GET /v1/fetch\n- [Fetch a URL (POST)](https://bytekit.com/docs/api/fetch/postfetch) — POST /v1/fetch"
|
|
161
|
+
},
|
|
162
|
+
"api/fetch/postfetch": {
|
|
163
|
+
"title": "Fetch a URL (POST)",
|
|
164
|
+
"section": "API Reference",
|
|
165
|
+
"body": "# Fetch a URL (POST)\n\nSame as GET /v1/fetch but with a JSON request body."
|
|
166
|
+
},
|
|
182
167
|
"api/health/healthcheck": {
|
|
183
168
|
"title": "Health check",
|
|
184
169
|
"section": "API Reference",
|
|
@@ -189,6 +174,21 @@
|
|
|
189
174
|
"section": "API Reference",
|
|
190
175
|
"body": "# Health\n\nHealth API — endpoints, requests, and responses.\n\nThe **Health** API. 1 endpoint:\n\n- [Health check](https://bytekit.com/docs/api/health/healthcheck) — GET /health"
|
|
191
176
|
},
|
|
177
|
+
"api/fetch-bulk/createfetchbulk": {
|
|
178
|
+
"title": "Bulk fetch URLs",
|
|
179
|
+
"section": "API Reference",
|
|
180
|
+
"body": "# Bulk fetch URLs\n\nEnqueues multiple URLs for HTTP fetching. Results delivered via webhook.\nDoes not support options that require page rendering (cookies, wait_for_selector, etc.).\n"
|
|
181
|
+
},
|
|
182
|
+
"api/fetch-bulk/getfetchbulk": {
|
|
183
|
+
"title": "Get fetch bulk job status",
|
|
184
|
+
"section": "API Reference",
|
|
185
|
+
"body": "# Get fetch bulk job status"
|
|
186
|
+
},
|
|
187
|
+
"api/fetch-bulk": {
|
|
188
|
+
"title": "Fetch Bulk",
|
|
189
|
+
"section": "API Reference",
|
|
190
|
+
"body": "# Fetch Bulk\n\nFetch Bulk API — endpoints, requests, and responses.\n\nThe **Fetch Bulk** API. 2 endpoints:\n\n- [Bulk fetch URLs](https://bytekit.com/docs/api/fetch-bulk/createfetchbulk) — POST /v1/fetch/bulk\n- [Get fetch bulk job status](https://bytekit.com/docs/api/fetch-bulk/getfetchbulk) — GET /v1/fetch/bulk/:id"
|
|
191
|
+
},
|
|
192
192
|
"api/monitors/createmonitor": {
|
|
193
193
|
"title": "Create a change-detection monitor",
|
|
194
194
|
"section": "API Reference",
|
|
@@ -224,16 +224,6 @@
|
|
|
224
224
|
"section": "API Reference",
|
|
225
225
|
"body": "# Update monitor"
|
|
226
226
|
},
|
|
227
|
-
"api/schema/createschemaextraction": {
|
|
228
|
-
"title": "Schema-driven structured extraction",
|
|
229
|
-
"section": "API Reference",
|
|
230
|
-
"body": "# Schema-driven structured extraction\n\nFetches `url` and extracts structured JSON conforming to the supplied\nJSON Schema (draft 2020-12) using an LLM. Fast-path only — slow-path\nrendering options (`wait_until=networkidle`, `cookies`, `delay_ms`,\ncustom `headers`, `wait_for_selector`) cause a `400 unsupported_url`.\n\nDual-axis billing: a fixed per-request credit charge **plus** the\nunderlying page's bandwidth, billed exactly like `/v1/scrape`. The\nbandwidth is still billed when the scrape succeeds but extraction later\nfails; both axes are refunded only when the scrape itself never runs.\n\nAvailability is gated by a server-side feature flag; when disabled the\nendpoint returns `404`.\n"
|
|
231
|
-
},
|
|
232
|
-
"api/schema": {
|
|
233
|
-
"title": "Schema",
|
|
234
|
-
"section": "API Reference",
|
|
235
|
-
"body": "# Schema\n\nSchema API — endpoints, requests, and responses.\n\nThe **Schema** API. 1 endpoint:\n\n- [Schema-driven structured extraction](https://bytekit.com/docs/api/schema/createschemaextraction) — POST /v1/schema"
|
|
236
|
-
},
|
|
237
227
|
"api/plans": {
|
|
238
228
|
"title": "Plans",
|
|
239
229
|
"section": "API Reference",
|
|
@@ -244,6 +234,16 @@
|
|
|
244
234
|
"section": "API Reference",
|
|
245
235
|
"body": "# List public plan catalog\n\nReturns the catalog of public plans (`is_custom = false`) as the\npricing source-of-truth for the dashboard and marketing site. Custom\ncontract plans are excluded. Unauthenticated — this is catalog data,\nnot per-account state (per-account plan lives on `GET /v1/account`).\n"
|
|
246
236
|
},
|
|
237
|
+
"api/schema/createschemaextraction": {
|
|
238
|
+
"title": "Schema-driven structured extraction",
|
|
239
|
+
"section": "API Reference",
|
|
240
|
+
"body": "# Schema-driven structured extraction\n\nFetches `url` and extracts structured JSON conforming to the supplied\nJSON Schema (draft 2020-12) using an LLM. Fast-path only — slow-path\nrendering options (`wait_until=networkidle`, `cookies`, `delay_ms`,\ncustom `headers`, `wait_for_selector`) cause a `400 unsupported_url`.\n\nDual-axis billing: a fixed per-request credit charge **plus** the\nunderlying page's bandwidth, billed exactly like `/v1/scrape`. The\nbandwidth is still billed when the scrape succeeds but extraction later\nfails; both axes are refunded only when the scrape itself never runs.\n\nAvailability is gated by a server-side feature flag; when disabled the\nendpoint returns `404`.\n"
|
|
241
|
+
},
|
|
242
|
+
"api/schema": {
|
|
243
|
+
"title": "Schema",
|
|
244
|
+
"section": "API Reference",
|
|
245
|
+
"body": "# Schema\n\nSchema API — endpoints, requests, and responses.\n\nThe **Schema** API. 1 endpoint:\n\n- [Schema-driven structured extraction](https://bytekit.com/docs/api/schema/createschemaextraction) — POST /v1/schema"
|
|
246
|
+
},
|
|
247
247
|
"api/scrape/createscrape": {
|
|
248
248
|
"title": "Scrape a URL",
|
|
249
249
|
"section": "API Reference",
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
"sdk/typescript/account": {
|
|
413
413
|
"title": "Account",
|
|
414
414
|
"section": "SDK Reference",
|
|
415
|
-
"body": "# Account\n\nAccount info and API key management.\n\n# Account\n\nAccount info and API key management. Accessed via `client.account`.\n\n## get\n\n```ts\nclient.account.get(): Promise<
|
|
415
|
+
"body": "# Account\n\nAccount info and API key management.\n\n# Account\n\nAccount info and API key management. Accessed via `client.account`.\n\n## get\n\n```ts\nclient.account.get(): Promise<GetAccountResponse>\n```\n\nGET /v1/account — get the authenticated account\n\n## apiKeys\n\n### create\n\n```ts\nclient.account.apiKeys.create(opts?: CreateApiKeyRequest): Promise<CreateApiKeyResponse>\n```\n\nPOST /v1/account/api-keys — create a new API key.\n\n`opts` is optional: the spec declares the request body itself as optional,\nso `create()` with no arguments is valid and sends no body.\n\n### list\n\n```ts\nclient.account.apiKeys.list(): Promise<ListApiKeysResponse>\n```\n\nGET /v1/account/api-keys — list all API keys for the account\n\n### get\n\n```ts\nclient.account.apiKeys.get(id: ApiKeyId): Promise<GetApiKeyResponse>\n```\n\nGET /v1/account/api-keys/\\{id\\} — get an API key by ID\n\n### update\n\n```ts\nclient.account.apiKeys.update(id: ApiKeyId, opts: UpdateApiKeyRequest): Promise<UpdateApiKeyResponse>\n```\n\nPATCH /v1/account/api-keys/\\{id\\} — update an API key\n\n### revoke\n\n```ts\nclient.account.apiKeys.revoke(id: ApiKeyId): Promise<void>\n```\n\nDELETE /v1/account/api-keys/\\{id\\} — revoke an API key (idempotent).\n\nReturns 204 No Content: `operations['revokeApiKey']['responses'][204]`\ndeclares `content?: never`, so there is no JSON arm to derive a payload\nfrom — hence `Promise<void>`.\n\nKNOWN DRIFT: `client.request()` calls `response.json()` unconditionally,\nwhich throws on the gateway's empty 204 body — so this method currently\nrejects at runtime. The fix belongs in `client.ts` (tracked separately);\ntyping it here states the intended contract rather than encoding the bug.\n\n### reveal\n\n```ts\nclient.account.apiKeys.reveal(id: ApiKeyId): Promise<RevealApiKeyResponse>\n```\n\nPOST /v1/account/api-keys/\\{id\\}/reveal — reveal the plaintext API key value"
|
|
416
416
|
},
|
|
417
417
|
"sdk/typescript/bulk": {
|
|
418
418
|
"title": "Bulk",
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
"sdk/typescript/client": {
|
|
423
423
|
"title": "Client",
|
|
424
424
|
"section": "SDK Reference",
|
|
425
|
-
"body": "# Client\n\nInstantiate and configure the ByteKit TypeScript client.\n\n# Client\n\nThe ByteKit TypeScript SDK is a thin, type-safe wrapper over the REST API. Create a\n client with your API key, then call resource methods.\n\n```ts\nimport { RapidCrawl } from '@bytekit/sdk';\n\nconst client = new RapidCrawl({\n apiKey: process.env.BYTEKIT_API_KEY!, // your sk_live_… key\n});\n```\n\n## Options (`RapidCrawlOptions`)\n\n- `apiKey` (required) — `string`\n- `baseUrl` — `string` Defaults to `https://api.bytekit.com`.\n\n## Resources\n\nThe client exposes one property per resource:\n\n- [`client.scrape`](https://bytekit.com/docs/sdk/typescript/scrape) — Fetch a URL as raw HTML, clean markdown, or structured content.\n- [`client.screenshots`](https://bytekit.com/docs/sdk/typescript/screenshots) — Capture full-page or viewport screenshots.\n- [`client.recordings`](https://bytekit.com/docs/sdk/typescript/recordings) — Generate a scrolling video of a page.\n- [`client.bulk`](https://bytekit.com/docs/sdk/typescript/bulk) — Fan out many URLs in parallel with per-item webhooks.\n- [`client.fetch`](https://bytekit.com/docs/sdk/typescript/fetch) — Low-latency raw HTTP fetch with optional conversion.\n- [`client.monitors`](https://bytekit.com/docs/sdk/typescript/monitors) — Watch a URL on a schedule and webhook on change.\n- [`client.sitemap`](https://bytekit.com/docs/sdk/typescript/sitemap) — Discover URLs from a domain's sitemap or by crawling.\n- [`client.search`](https://bytekit.com/docs/sdk/typescript/search) — Run a web search and return ranked organic results.\n- [`client.account`](https://bytekit.com/docs/sdk/typescript/account) — Account info and API key management.\n\n## Errors\n\nAny non-2xx response throws a `RapidCrawlError` carrying the HTTP `status` and the API `code`.\n\n```ts\nimport { RapidCrawl, RapidCrawlError } from '@bytekit/sdk';\n\ntry {\n await client.scrape.create({ url: 'https://example.com' });\n} catch (err) {\n if (err instanceof RapidCrawlError) {\n console.error(`${err.status} ${err.code}: ${err.message}`);\n }\n}\n```"
|
|
425
|
+
"body": "# Client\n\nInstantiate and configure the ByteKit TypeScript client.\n\n# Client\n\nThe ByteKit TypeScript SDK is a thin, type-safe wrapper over the REST API. Create a\n client with your API key, then call resource methods.\n\n```ts\nimport { RapidCrawl } from '@bytekit/sdk';\n\nconst client = new RapidCrawl({\n apiKey: process.env.BYTEKIT_API_KEY!, // your sk_live_… key\n});\n```\n\n## Options (`RapidCrawlOptions`)\n\n- `apiKey` (required) — `string`\n- `baseUrl` — `string` Defaults to `https://api.bytekit.com`.\n- `timeoutMs` — `number` — Default CLIENT-SIDE request timeout in ms — the abort budget for the whole HTTP\nround-trip made by this SDK. `0` disables the SDK-side timeout. Default 120000.\n\nNOT the same thing as `ScrapeOpts.timeout_ms`, which is the SERVER-side budget the\ngateway applies to the scrape itself. Override per call with\n`RequestOptions.requestTimeoutMs`.\n\n## Resources\n\nThe client exposes one property per resource:\n\n- [`client.scrape`](https://bytekit.com/docs/sdk/typescript/scrape) — Fetch a URL as raw HTML, clean markdown, or structured content.\n- [`client.screenshots`](https://bytekit.com/docs/sdk/typescript/screenshots) — Capture full-page or viewport screenshots.\n- [`client.recordings`](https://bytekit.com/docs/sdk/typescript/recordings) — Generate a scrolling video of a page.\n- [`client.bulk`](https://bytekit.com/docs/sdk/typescript/bulk) — Fan out many URLs in parallel with per-item webhooks.\n- [`client.fetch`](https://bytekit.com/docs/sdk/typescript/fetch) — Low-latency raw HTTP fetch with optional conversion.\n- [`client.monitors`](https://bytekit.com/docs/sdk/typescript/monitors) — Watch a URL on a schedule and webhook on change.\n- [`client.sitemap`](https://bytekit.com/docs/sdk/typescript/sitemap) — Discover URLs from a domain's sitemap or by crawling.\n- [`client.search`](https://bytekit.com/docs/sdk/typescript/search) — Run a web search and return ranked organic results.\n- [`client.account`](https://bytekit.com/docs/sdk/typescript/account) — Account info and API key management.\n\n## Errors\n\nAny non-2xx response throws a `RapidCrawlError` carrying the HTTP `status` and the API `code`.\n\n```ts\nimport { RapidCrawl, RapidCrawlError } from '@bytekit/sdk';\n\ntry {\n await client.scrape.create({ url: 'https://example.com' });\n} catch (err) {\n if (err instanceof RapidCrawlError) {\n console.error(`${err.status} ${err.code}: ${err.message}`);\n }\n}\n```"
|
|
426
426
|
},
|
|
427
427
|
"sdk/typescript/fetch-bulk": {
|
|
428
428
|
"title": "Fetch Bulk",
|
|
@@ -447,17 +447,17 @@
|
|
|
447
447
|
"sdk/typescript/scrape-bulk": {
|
|
448
448
|
"title": "Scrape Bulk",
|
|
449
449
|
"section": "SDK Reference",
|
|
450
|
-
"body": "# Scrape Bulk\n\nCreate and poll bulk scrape jobs.\n\n# Scrape Bulk\n\nCreate and poll bulk scrape jobs. Accessed via `client.scrape.bulk`.\n\n## create\n\n```ts\nclient.scrape.bulk.create(opts:
|
|
450
|
+
"body": "# Scrape Bulk\n\nCreate and poll bulk scrape jobs.\n\n# Scrape Bulk\n\nCreate and poll bulk scrape jobs. Accessed via `client.scrape.bulk`.\n\n## create\n\n```ts\nclient.scrape.bulk.create(opts: ScrapeBulkCreateRequest): Promise<ScrapeBulkCreateResponse>\n```\n\nPOST /v1/scrape/bulk — create a bulk scrape job\n\n## get\n\n```ts\nclient.scrape.bulk.get(id: BulkId): Promise<ScrapeBulkGetResponse>\n```\n\nGET /v1/scrape/bulk/\\{id\\} — get a bulk scrape job"
|
|
451
451
|
},
|
|
452
452
|
"sdk/typescript/scrape": {
|
|
453
453
|
"title": "Scrape",
|
|
454
454
|
"section": "SDK Reference",
|
|
455
|
-
"body": "# Scrape\n\nFetch a URL as raw HTML, clean markdown, or structured content.\n\n# Scrape\n\nFetch a URL as raw HTML, clean markdown, or structured content. Accessed via `client.scrape`.\n\n## create\n\n```ts\nclient.scrape.create(opts: ScrapeOpts): Promise<
|
|
455
|
+
"body": "# Scrape\n\nFetch a URL as raw HTML, clean markdown, or structured content.\n\n# Scrape\n\nFetch a URL as raw HTML, clean markdown, or structured content. Accessed via `client.scrape`.\n\n## create\n\n```ts\nclient.scrape.create(opts: ScrapeOpts, requestOptions?: RequestOptions): Promise<ScrapeCreateResponse>\n```\n\nPOST /v1/scrape — create a scrape job.\n\nResolves to the 200 success envelope, or the 202 queued envelope when\n`async: true`. Narrow on `status` before reading the result.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default. They\nare a different axis from `opts.timeout_ms`, which is the SERVER-side scrape budget.\n\n## get\n\n```ts\nclient.scrape.get(id: ScrapeId, requestOptions?: RequestOptions): Promise<ScrapeGetResponse>\n```\n\nGET /v1/scrape/\\{id\\} — poll a scrape by ID\n\nKNOWN DRIFT (#2426): live staging spot-checks (two independent fetches)\nfound the gateway serializes `billing_multiplier` as a JSON **string**\n(e.g. `\"0.50\"`) on this GET path, while the OpenAPI spec — and this\nderived `ScrapeGetResponse` type — declare it `number`. `POST /v1/scrape`'s\nsuccess envelope for the same job serializes the identical field as a\nproper number, so the drift is specific to the GET path (likely a Postgres\nNUMERIC column round-tripping as a string on this query path). A consumer\ndoing arithmetic on `billing_multiplier` after `get()` (e.g.\n`content_length * billing_multiplier`) should coerce with `Number(...)`\ndefensively rather than trust the static type. This is a gateway/worker\nserialization bug, not a client bug — the fix belongs upstream in the\ngateway and is out of this ticket's scope.\n\n## Options (`ScrapeOpts`)\n\n- `url` (required) — `string`\n- `formats` — `Array<'raw_html' | 'html' | 'markdown' | 'links' | 'images'>`\n- `country` — `string`\n- `cookies` — `Array<Record<string, unknown>>`\n- `headers` — `Record<string, string>`\n- `delay_ms` — `number`\n- `timeout_ms` — `number` — SERVER-side scrape budget in ms — how long the gateway may spend on the scrape itself. For the CLIENT-side abort budget (when this SDK gives up on the wire), see `RequestOptions.requestTimeoutMs`.\n- `async` — `boolean`\n- `webhook_url` — `string`\n- `events` — `Array<'queued' | 'completed' | 'failed'>`\n- `markdown_mode` — `MarkdownMode` — Markdown processing mode. article=article extraction (default), raw=minimal cleanup, llm=compact LLM-optimised output.\n- `markdown_query` — `string` — BM25 query string for relevance-ranked content filtering. Omit or leave empty to disable.\n- `markdown_links` — `MarkdownLinks` — Link rendering style in the markdown output.\n- `markdown_compact` — `boolean` — Collapse excessive whitespace for a more compact output.\n- `markdown_filter_images` — `boolean` — Filter low-signal images from the markdown output.\n- `markdown_include_media` — `boolean` — When true, `formats.links` and `formats.images` return `ScrapeScoredLink[]` / `ScrapeScoredImage[]` (rich objects) instead of `string[]`, and a top-level `tables` array is included. Only effective when `markdown` is in `formats`.\n- `markdown_include_warnings` — `boolean` — When true, the response includes markdown-pipeline and tag-filter warnings. `artifact_unavailable` may appear independently when a requested persisted format cannot be rehydrated.\n- `markdown_include_stats` — `boolean` — When true, the response includes a top-level `stats` object with `ScrapeStats` (chars, tokens, blocks). Only effective when `markdown` is in `formats`.\n- `cache_ttl` — `string | 0` — How long a freshly fetched URL may be served from cache. `'0'`/`0` skips the\ncache read (the result is still written), `'Nh'`/`'Nd'` set a TTL (capped at\n168h / 7d). Default `'48h'`. Honoured on both the synchronous and asynchronous\npaths; the async success envelope reports the outcome via the `cache` field.\n- `custom` — `Record<string, unknown>` — User-supplied JSON payload, echoed back on the success envelope so callers\ncan correlate the response to caller-side state (job IDs, batch metadata).\nCapped at 4096 UTF-8 bytes after JSON serialization. Does NOT affect\ncache-key inputs — two requests differing only in `custom` share the same\ncache slot."
|
|
456
456
|
},
|
|
457
457
|
"sdk/typescript/screenshots": {
|
|
458
458
|
"title": "Screenshots",
|
|
459
459
|
"section": "SDK Reference",
|
|
460
|
-
"body": "# Screenshots\n\nCapture full-page or viewport screenshots.\n\n# Screenshots\n\nCapture full-page or viewport screenshots. Accessed via `client.screenshots`.\n\n## create\n\n```ts\nclient.screenshots.create(opts:
|
|
460
|
+
"body": "# Screenshots\n\nCapture full-page or viewport screenshots.\n\n# Screenshots\n\nCapture full-page or viewport screenshots. Accessed via `client.screenshots`.\n\n## create\n\n```ts\nclient.screenshots.create(opts: ScreenshotCreateRequest): Promise<ScreenshotCreateResponse>\n```\n\nPOST /v1/screenshots — capture a screenshot\n\n## get\n\n```ts\nclient.screenshots.get(id: ScreenshotId): Promise<ScreenshotGetResponse>\n```\n\nGET /v1/screenshots/\\{id\\} — poll a screenshot by ID.\n\nA terminal-`failed` screenshot returns the `Error` envelope on a 200\n(issue #2027), so narrow the result before reading `image_url`."
|
|
461
461
|
},
|
|
462
462
|
"sdk/typescript/search": {
|
|
463
463
|
"title": "Search",
|
package/dist/http.d.ts
CHANGED
package/dist/http.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -13,9 +13,8 @@ import type { BytekitClient } from './client.js';
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const serverInfo: {
|
|
15
15
|
readonly name: "bytekit";
|
|
16
|
-
readonly version:
|
|
16
|
+
readonly version: string;
|
|
17
17
|
};
|
|
18
18
|
export declare function createServer(client: BytekitClient): McpServer;
|
|
19
19
|
export { BytekitClient } from './client.js';
|
|
20
20
|
export type { ScrapeParams, ScrapeResult, SearchParams, SearchResult, SearchResponse, ScreenshotParams, ScreenshotResult, AccountResult, UsageResult, } from './client.js';
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Creates an McpServer instance with all tools, resources, and prompts registered.
|
|
5
5
|
* Used by both the CLI (stdio transport) and the gateway (HTTP transport).
|
|
6
6
|
*/
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
7
8
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
9
|
// Tools
|
|
9
10
|
import { scrapeUrlTool } from './tools/scrape-url.js';
|
|
@@ -21,6 +22,16 @@ import { screenshotResource } from './resources/screenshot.js';
|
|
|
21
22
|
import { summarizeWebpagePrompt } from './prompts/summarize-webpage.js';
|
|
22
23
|
import { extractStructuredDataPrompt } from './prompts/extract-structured-data.js';
|
|
23
24
|
import { researchTopicPrompt } from './prompts/research-topic.js';
|
|
25
|
+
// Resolve the version from package.json at runtime so the handshake can never drift
|
|
26
|
+
// from the published manifest (issue #2419 — 0.1.1 advertised "0.1.0" because the
|
|
27
|
+
// literal was bumped independently of package.json). `../package.json` resolves to the
|
|
28
|
+
// package root from BOTH src/index.ts (dev/vitest) and dist/index.js (published
|
|
29
|
+
// tarball), so no build-time codegen is needed. Same pattern as packages/cli.
|
|
30
|
+
const require = createRequire(import.meta.url);
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
32
|
+
const pkg = require('../package.json');
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
34
|
+
const packageVersion = typeof pkg.version === 'string' ? pkg.version : '0.0.0';
|
|
24
35
|
/**
|
|
25
36
|
* Server identity advertised over the MCP `initialize` handshake. Exported so
|
|
26
37
|
* the name/version contract is unit-testable without a live server (issue #2066;
|
|
@@ -28,7 +39,7 @@ import { researchTopicPrompt } from './prompts/research-topic.js';
|
|
|
28
39
|
*/
|
|
29
40
|
export const serverInfo = {
|
|
30
41
|
name: 'bytekit',
|
|
31
|
-
version:
|
|
42
|
+
version: packageVersion,
|
|
32
43
|
};
|
|
33
44
|
export function createServer(client) {
|
|
34
45
|
const server = new McpServer({
|
|
@@ -55,4 +66,3 @@ export function createServer(client) {
|
|
|
55
66
|
}
|
|
56
67
|
// Re-export client for convenience
|
|
57
68
|
export { BytekitClient } from './client.js';
|
|
58
|
-
//# sourceMappingURL=index.js.map
|
package/dist/lib/truncate.d.ts
CHANGED
package/dist/lib/truncate.js
CHANGED