@hunt-labs/bytekit-mcp 0.1.1 → 0.1.3
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/CHANGELOG.md +65 -0
- package/LICENSE +21 -0
- package/README.md +117 -0
- package/dist/cli.d.ts +18 -2
- package/dist/cli.js +21 -4
- package/dist/client.d.ts +7 -29
- package/dist/client.js +1 -6
- package/dist/docs-bundle/docs-bundle.json +53 -63
- 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 +1 -2
- package/dist/tools/web-search.js +2 -3
- package/package.json +37 -17
- 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 -73
- 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
|
@@ -12,12 +12,17 @@
|
|
|
12
12
|
"mcp": {
|
|
13
13
|
"title": "MCP Server",
|
|
14
14
|
"section": "General",
|
|
15
|
-
"body": "# MCP Server\n\nCall ByteKit web capture as a native tool from Claude, Cursor, and any MCP-compatible agent — hosted over HTTP or run locally over stdio.\n\nThe ByteKit **MCP server** exposes scraping, search, screenshots, and account\nlookups as [Model Context Protocol](https://modelcontextprotocol.io) tools. Your\nagent calls `scrape_url` or `screenshot_url` the same way it calls any other\ntool — no wrapper to write, no headless browser to manage.\n\nThere are two ways to connect: a **hosted HTTP endpoint** (nothing to install)\nand a **local stdio server** (`npx @hunt-labs/bytekit-mcp`).\n\n## Authentication\n\nBoth paths authenticate with a ByteKit API key. Sign up at\n[app.bytekit.com](https://app.bytekit.com) and create a key (prefixed\n`sk_live_`). The local server reads it from the `BYTEKIT_API_KEY` environment\nvariable (or the `--api-key` flag); the hosted endpoint takes it as a bearer\ntoken.\n\n## Option 1 — Hosted HTTP (no install)\n\nPoint any MCP client that speaks the Streamable HTTP transport at:\n\n```\nhttps://api.bytekit.com/mcp\n```\n\nSend your API key as a bearer token. Example client config (Claude Desktop,\nCursor, and most hosts accept this shape):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"url\": \"https://api.bytekit.com/mcp\",\n \"headers\": {\n \"Authorization\": \"Bearer $BYTEKIT_API_KEY\"\n }\n }\n }\n}\n```\n\n## Option 2 — Local stdio (`npx`)\n\nRun the server as a local subprocess over stdio. Nothing to install globally —\n`npx` fetches it on demand:\n\n```bash\nnpx @hunt-labs/bytekit-mcp --api-key $BYTEKIT_API_KEY\n```\n\nOr set the key in your environment and omit the flag:\n\n```bash\nexport BYTEKIT_API_KEY=sk_live_xxx\nnpx @hunt-labs/bytekit-mcp\n```\n\nClient config for a stdio server:\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@hunt-labs/bytekit-mcp\"],\n \"env\": {\n \"BYTEKIT_API_KEY\": \"sk_live_xxx\"\n }\n }\n }\n}\n```\n\n### API-key resolution order\n\nThe local server resolves the key in this order, so a legacy setup keeps\nworking:\n\n1. `--api-key <key>` flag\n2. `BYTEKIT_API_KEY` environment variable\n3. `RAPIDCRAWL_API_KEY` environment variable (legacy fallback)\n\n## Tool inventory\n\n| Tool | What it does |\n| --- | --- |\n| `scrape_url` | Fetch a URL and return HTML, clean markdown, links, or images. |\n| `
|
|
15
|
+
"body": "# MCP Server\n\nCall ByteKit web capture as a native tool from Claude, Cursor, and any MCP-compatible agent — hosted over HTTP or run locally over stdio.\n\nThe ByteKit **MCP server** exposes scraping, search, screenshots, and account\nlookups as [Model Context Protocol](https://modelcontextprotocol.io) tools. Your\nagent calls `scrape_url` or `screenshot_url` the same way it calls any other\ntool — no wrapper to write, no headless browser to manage.\n\nThere are two ways to connect: a **hosted HTTP endpoint** (nothing to install)\nand a **local stdio server** (`npx @hunt-labs/bytekit-mcp`).\n\n## Authentication\n\nBoth paths authenticate with a ByteKit API key. Sign up at\n[app.bytekit.com](https://app.bytekit.com) and create a key (prefixed\n`sk_live_`). The local server reads it from the `BYTEKIT_API_KEY` environment\nvariable (or the `--api-key` flag); the hosted endpoint takes it as a bearer\ntoken.\n\n## Option 1 — Hosted HTTP (no install)\n\nPoint any MCP client that speaks the Streamable HTTP transport at:\n\n```\nhttps://api.bytekit.com/mcp\n```\n\nSend your API key as a bearer token. Example client config (Claude Desktop,\nCursor, and most hosts accept this shape):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"url\": \"https://api.bytekit.com/mcp\",\n \"headers\": {\n \"Authorization\": \"Bearer $BYTEKIT_API_KEY\"\n }\n }\n }\n}\n```\n\n## Option 2 — Local stdio (`npx`)\n\nRun the server as a local subprocess over stdio. Nothing to install globally —\n`npx` fetches it on demand:\n\n```bash\nnpx @hunt-labs/bytekit-mcp --api-key $BYTEKIT_API_KEY\n```\n\nOr set the key in your environment and omit the flag:\n\n```bash\nexport BYTEKIT_API_KEY=sk_live_xxx\nnpx @hunt-labs/bytekit-mcp\n```\n\nClient config for a stdio server:\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@hunt-labs/bytekit-mcp\"],\n \"env\": {\n \"BYTEKIT_API_KEY\": \"sk_live_xxx\"\n }\n }\n }\n}\n```\n\n### API-key resolution order\n\nThe local server resolves the key in this order, so a legacy setup keeps\nworking:\n\n1. `--api-key <key>` flag\n2. `BYTEKIT_API_KEY` environment variable\n3. `RAPIDCRAWL_API_KEY` environment variable (legacy fallback)\n\n## Tool inventory\n\n| Tool | What it does |\n| --- | --- |\n| `scrape_url` | Fetch a URL and return HTML, clean markdown, links, or images. |\n| `web_search` | Run a web search and return ranked organic results. |\n| `screenshot_url` | Capture a screenshot of a page (desktop/mobile, PNG/JPEG). |\n| `get_result` | Fetch a previously created screenshot by id. |\n| `get_account` | Return account details, plan, and current usage/quota. |\n| `list_docs` | List every page in the bundled ByteKit documentation. |\n| `search_docs` | Search the bundled documentation. |\n| `get_doc` | Fetch the full markdown of one documentation page. |\n\nThe server also exposes **resources** (`bytekit://account`,\n`bytekit://screenshot/{id}`) and **prompts** (`summarize_webpage`,\n`extract_structured_data`, `research_topic`) that MCP hosts can surface directly.\n\n## Next steps\n\n- [Quickstart](https://bytekit.com/docs/quickstart) — make your first ByteKit API call.\n- [Authentication](https://bytekit.com/docs/guides/authentication) — key formats and management."
|
|
16
16
|
},
|
|
17
17
|
"quickstart": {
|
|
18
18
|
"title": "Quickstart",
|
|
19
19
|
"section": "General",
|
|
20
|
-
"body": "# Quickstart\n\nMake your first ByteKit API call in under 5 minutes — no SDK required.\n\nNothing to install. You only need `curl` and an API key.\n\n## Get an API key\n\nSign up at [app.bytekit.com](https://app.bytekit.com) and create an API key from the\ndashboard. Keys are prefixed `sk_live_`.\n\nSee [Authentication](https://bytekit.com/docs/guides/authentication) for details on key formats and management.\n\n## Make your first scrape\n\nSet your API key and run this — no file to save, no `chmod`:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer $BYTEKIT_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\":\"https://example.com\"}'\n```\n\nWant a full-featured script with error handling and `jq` formatting? Use this instead:\n\n<!-- example omitted: curl/scrape.sh (source unavailable) -->\n\nA successful response looks like this:\n\n```json\n{\n \"status\": \"success\",\n \"id\": \"sc_...\",\n \"url\": \"https://example.com\",\n \"finalUrl\": \"https://example.com/\",\n \"contentType\": \"text/html; charset=UTF-8\",\n \"contentLength\": 1256,\n \"statusCode\": 200,\n \"retrievedAt\": \"2025-01-15T12:00:00Z\",\n \"formats\": {\n \"markdown\": \"# Example Domain\\n\\nThis domain is for use in illustrative examples...\"\n },\n \"metadata\": {\n \"title\": \"Example Domain\"\n }\n}\n```\n\n`contentLength` is the compressed wire size in bytes (used for bandwidth billing). The `id`\nfield uses the `sc_` prefix — you can poll `GET /v1/scrape/{id}` if the scrape was queued\nasynchronously.\n\n## Prefer an SDK?\n\nSkip the raw HTTP and use an official client:\n\n- [TypeScript SDK](https://bytekit.com/docs/libraries/typescript) — `npm install @bytekit
|
|
20
|
+
"body": "# Quickstart\n\nMake your first ByteKit API call in under 5 minutes — no SDK required.\n\nNothing to install. You only need `curl` and an API key.\n\n## Get an API key\n\nSign up at [app.bytekit.com](https://app.bytekit.com) and create an API key from the\ndashboard. Keys are prefixed `sk_live_`.\n\nSee [Authentication](https://bytekit.com/docs/guides/authentication) for details on key formats and management.\n\n## Make your first scrape\n\nSet your API key and run this — no file to save, no `chmod`:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer $BYTEKIT_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\":\"https://example.com\"}'\n```\n\nWant a full-featured script with error handling and `jq` formatting? Use this instead:\n\n<!-- example omitted: curl/scrape.sh (source unavailable) -->\n\nA successful response looks like this:\n\n```json\n{\n \"status\": \"success\",\n \"id\": \"sc_...\",\n \"url\": \"https://example.com\",\n \"finalUrl\": \"https://example.com/\",\n \"contentType\": \"text/html; charset=UTF-8\",\n \"contentLength\": 1256,\n \"statusCode\": 200,\n \"retrievedAt\": \"2025-01-15T12:00:00Z\",\n \"formats\": {\n \"markdown\": \"# Example Domain\\n\\nThis domain is for use in illustrative examples...\"\n },\n \"metadata\": {\n \"title\": \"Example Domain\"\n }\n}\n```\n\n`contentLength` is the compressed wire size in bytes (used for bandwidth billing). The `id`\nfield uses the `sc_` prefix — you can poll `GET /v1/scrape/{id}` if the scrape was queued\nasynchronously.\n\n## Prefer an SDK?\n\nSkip the raw HTTP and use an official client:\n\n- [TypeScript SDK](https://bytekit.com/docs/libraries/typescript) — `npm install @hunt-labs/bytekit-sdk`\n- [Python SDK](https://bytekit.com/docs/libraries/python) — `pip install bytekit`\n\n## Next steps\n\n- [Authentication](https://bytekit.com/docs/guides/authentication) — key formats, Bearer header, self-serve key management\n- [Scraping](https://bytekit.com/docs/guides/scraping) — formats, options, latency, and async polling\n- [Errors](https://bytekit.com/docs/guides/errors) — error shape, common codes, retry guidance\n- [Rate Limits](https://bytekit.com/docs/guides/rate-limits) — quota model, concurrency slots, rate limit headers\n- [Monitors](https://bytekit.com/docs/guides/monitors) — page-change detection (screenshot or scrape) with webhook notifications\n- [API Reference](https://bytekit.com/docs/api) — full endpoint documentation"
|
|
21
|
+
},
|
|
22
|
+
"api": {
|
|
23
|
+
"title": "API Reference",
|
|
24
|
+
"section": "API Reference",
|
|
25
|
+
"body": "# API Reference\n\nEvery ByteKit endpoint, request, and response.\n\nThe ByteKit REST API is organized by capability. Every endpoint shares one base\nURL and Bearer authentication — start with the [Quickstart](https://bytekit.com/docs/quickstart) and\n[Authentication](https://bytekit.com/docs/guides/authentication) guides.\n\n- [Scrape](https://bytekit.com/docs/api/scrape/createscrape) — Fetch any URL as raw HTML, clean markdown, or structured content.\n- [Screenshots](https://bytekit.com/docs/api/screenshots/createscreenshot) — Capture full-page or viewport PNG/JPEG.\n- [Recordings](https://bytekit.com/docs/api/recordings/createrecording) — Generate a scrolling video of a page.\n- [Bulk](https://bytekit.com/docs/api/bulk/createbulk) — Fan out many URLs in parallel with per-item webhooks.\n- [Monitors](https://bytekit.com/docs/api/monitors/createmonitor) — Watch a URL on a schedule and webhook on change.\n- [Sitemap](https://bytekit.com/docs/api/sitemap/createsitemap) — Discover URLs from a domain's sitemap or by crawling.\n- [Fetch](https://bytekit.com/docs/api/fetch/postfetch) — Low-latency raw HTTP fetch with optional conversion."
|
|
21
26
|
},
|
|
22
27
|
"cli/account": {
|
|
23
28
|
"title": "Account",
|
|
@@ -44,15 +49,10 @@
|
|
|
44
49
|
"section": "General",
|
|
45
50
|
"body": "# Monitors\n\nPage-change monitor operations\n\nPage-change monitor operations\n\nFirst-capture behavior is the same for both monitor types: the first capture is a silent baseline (`has_change: false`, `change_pct: null`) with no `change_detected` webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.\n\n### monitors › captures\n\nMonitor capture sub-resources\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### monitors › captures › list\n\nList captures for a monitor\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit monitors captures list <id>\n```\n\n### monitors › create\n\nCreate a page-change monitor\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to monitor |\n| `--interval-type <type>` | Check interval: hourly, daily, weekly, or cron |\n| `--webhook-url <url>` | HTTPS webhook URL notified on change |\n| `--cron <expr>` | Cron expression (required when --interval-type is |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit monitors create --url <url> --interval-type <type> --webhook-url <url> --cron <expr>\n```\n\n### monitors › list\n\nList all monitors\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit monitors list\n```\n\n### monitors › get\n\nGet a monitor by ID\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit monitors get <id>\n```\n\n### monitors › update\n\nUpdate a monitor\n\n| Option | Description |\n| --- | --- |\n| `--interval-type <type>` | New check interval: hourly, daily, weekly, or cron |\n| `--cron <expr>` | New cron expression (when interval-type is cron, e.g. |\n| `--webhook-url <url>` | New HTTPS webhook URL |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit monitors update <id> --interval-type <type> --cron <expr> --webhook-url <url>\n```\n\n### monitors › delete\n\nDelete a monitor\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit monitors delete <id>\n```"
|
|
46
51
|
},
|
|
47
|
-
"cli/recordings": {
|
|
48
|
-
"title": "Recordings",
|
|
49
|
-
"section": "General",
|
|
50
|
-
"body": "# Recordings\n\nRecording operations\n\nRecording operations\n\n### recordings › create\n\nStart a page recording\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to record |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit recordings create --url <url>\n```\n\n### recordings › get\n\nGet a recording by ID\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit recordings get <id>\n```"
|
|
51
|
-
},
|
|
52
52
|
"cli/scrape": {
|
|
53
53
|
"title": "Scrape",
|
|
54
54
|
"section": "General",
|
|
55
|
-
"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
|
|
55
|
+
"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```"
|
|
56
56
|
},
|
|
57
57
|
"cli/screenshots": {
|
|
58
58
|
"title": "Screenshots",
|
|
@@ -64,26 +64,6 @@
|
|
|
64
64
|
"section": "General",
|
|
65
65
|
"body": "# Sitemap\n\nSitemap crawl operations\n\nSitemap crawl operations\n\n### sitemap › create\n\nStart a sitemap crawl\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | Root URL to crawl |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit sitemap create --url <url>\n```\n\n### sitemap › get\n\nGet a sitemap job by ID\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit sitemap get <id>\n```"
|
|
66
66
|
},
|
|
67
|
-
"api": {
|
|
68
|
-
"title": "API Reference",
|
|
69
|
-
"section": "API Reference",
|
|
70
|
-
"body": "# API Reference\n\nEvery ByteKit endpoint, request, and response.\n\nThe ByteKit REST API is organized by capability. Every endpoint shares one base\nURL and Bearer authentication — start with the [Quickstart](https://bytekit.com/docs/quickstart) and\n[Authentication](https://bytekit.com/docs/guides/authentication) guides.\n\n- [Scrape](https://bytekit.com/docs/api/scrape/createscrape) — Fetch any URL as raw HTML, clean markdown, or structured content.\n- [Screenshots](https://bytekit.com/docs/api/screenshots/createscreenshot) — Capture full-page or viewport PNG/JPEG.\n- [Recordings](https://bytekit.com/docs/api/recordings/createrecording) — Generate a scrolling video of a page.\n- [Bulk](https://bytekit.com/docs/api/bulk/createbulk) — Fan out many URLs in parallel with per-item webhooks.\n- [Monitors](https://bytekit.com/docs/api/monitors/createmonitor) — Watch a URL on a schedule and webhook on change.\n- [Sitemap](https://bytekit.com/docs/api/sitemap/createsitemap) — Discover URLs from a domain's sitemap or by crawling.\n- [Fetch](https://bytekit.com/docs/api/fetch/postfetch) — Low-latency raw HTTP fetch with optional conversion."
|
|
71
|
-
},
|
|
72
|
-
"libraries/go": {
|
|
73
|
-
"title": "Go",
|
|
74
|
-
"section": "General",
|
|
75
|
-
"body": "# Go\n\nCall the ByteKit REST API from Go with the standard library.\n\nByteKit is a plain REST API. There is no Go SDK — and you do not need one. The\nTypeScript and Python SDKs are thin wrappers over the same HTTP endpoints, so\ncalling ByteKit from Go is just a standard `net/http` request.\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tbody := bytes.NewBufferString(`{\"url\":\"https://example.com\",\"formats\":[\"markdown\"]}`)\n\treq, _ := http.NewRequest(\"POST\", \"https://api.bytekit.com/v1/scrape\", body)\n\treq.Header.Set(\"Authorization\", \"Bearer sk_live_your_api_key_here\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\tout, _ := io.ReadAll(resp.Body)\n\tfmt.Println(string(out))\n}\n```\n\n## Next steps\n\n- [API Reference](https://bytekit.com/docs/api) — every endpoint, request, and response.\n- [TypeScript SDK](https://bytekit.com/docs/libraries/typescript) and [Python SDK](https://bytekit.com/docs/libraries/python) — typed clients over the same REST API."
|
|
76
|
-
},
|
|
77
|
-
"libraries/python": {
|
|
78
|
-
"title": "Python SDK",
|
|
79
|
-
"section": "General",
|
|
80
|
-
"body": "# Python SDK\n\nOfficial Python client for ByteKit, with sync and async support.\n\nThe official Python SDK is generated from the ByteKit OpenAPI spec, so its models and\nmethods always match the API. Every operation ships in both synchronous and asynchronous form.\n\n## Install\n\n```bash\npip install bytekit\n```\n\n## Your first scrape\n\n```python\nfrom bytekit import AuthenticatedClient\nfrom bytekit.api.scrape import create_scrape\nfrom bytekit.models.scrape_request import ScrapeRequest\nfrom bytekit.models.scrape_request_formats_item import ScrapeRequestFormatsItem\nfrom bytekit.models.scrape_success_envelope import ScrapeSuccessEnvelope\n\nclient = AuthenticatedClient(\n base_url=\"https://api.bytekit.com\",\n token=\"sk_live_your_api_key_here\",\n)\n\n# Request the markdown format explicitly — otherwise response.formats.markdown is UNSET.\nbody = ScrapeRequest(\n url=\"https://example.com\",\n formats=[ScrapeRequestFormatsItem.MARKDOWN],\n)\nresponse = create_scrape.sync(client=client, body=body)\n\n# .sync() returns None on a transport error, and a queued/error envelope on the\n# async or failure paths. Only a ScrapeSuccessEnvelope carries populated formats.\nif response is None:\n print(\"Request failed — no response returned.\")\nelif isinstance(response, ScrapeSuccessEnvelope) and isinstance(response.formats.markdown, str):\n print(response.formats.markdown)\nelse:\n # Queued (ScrapeQueuedEnvelope) or error (ScrapeErrorEnvelope) — inspect `response`.\n print(f\"Scrape not complete: {response}\")\n```\n\nEach operation exposes four call styles:\n\n- `create_scrape.sync(...)` — returns the parsed model (or `None`).\n- `create_scrape.sync_detailed(...)` — returns the full `Response` (status code, headers, body).\n- `create_scrape.asyncio(...)` — awaitable form of `sync`.\n- `create_scrape.asyncio_detailed(...)` — awaitable form of `sync_detailed`.\n\n## Async usage\n\n```python\nimport asyncio\nfrom bytekit import AuthenticatedClient\nfrom bytekit.api.screenshots import create_screenshot\nfrom bytekit.models.screenshot_request import ScreenshotRequest\n\nasync def main():\n client = AuthenticatedClient(\n base_url=\"https://api.bytekit.com\",\n token=\"sk_live_your_api_key_here\",\n )\n body = ScreenshotRequest(url=\"https://example.com\")\n response = await create_screenshot.asyncio(client=client, body=body)\n print(response)\n\nasyncio.run(main())\n```\n\n## What's available\n\nOperations are grouped by capability under `bytekit.api.*`: `scrape`, `scrape_bulk`,\n`screenshots`, `recordings`, `bulk`, `fetch`, `fetch_bulk`, `monitors`, `sitemap`, and\n`account`.\n\nSee the [Python SDK Reference](https://bytekit.com/docs/sdk/python/client) for every module, function, and model.\n\n## Next steps\n\n- [TypeScript SDK](https://bytekit.com/docs/libraries/typescript) — the same API surface in TypeScript.\n- [API Reference](https://bytekit.com/docs/api) — the underlying REST endpoints.\n- [Errors](https://bytekit.com/docs/guides/errors) — error codes and retry guidance."
|
|
81
|
-
},
|
|
82
|
-
"libraries/typescript": {
|
|
83
|
-
"title": "TypeScript SDK",
|
|
84
|
-
"section": "General",
|
|
85
|
-
"body": "# TypeScript SDK\n\nType-safe ByteKit client for Node.js and modern JavaScript runtimes.\n\nThe official TypeScript SDK is a thin, type-safe wrapper over the ByteKit REST API. It works\nin Node.js and any runtime with a global `fetch` (Bun, Deno, Cloudflare Workers, modern\nbrowsers).\n\n## Install\n\n```bash\nnpm install @bytekit/sdk\n```\n\n## Initialize\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## Your first scrape\n\n```ts\nconst result = await client.scrape.create({\n url: 'https://example.com',\n formats: ['markdown'],\n});\n\nconsole.log(result);\n```\n\n## Capture a screenshot\n\n```ts\nconst shot = await client.screenshots.create({\n url: 'https://example.com',\n full_page: true,\n});\n\nconsole.log(shot);\n```\n\n## Handle errors\n\nAny 4xx/5xx response throws a `RapidCrawlError` carrying the HTTP `status` and the API\n`error.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 } else {\n throw err;\n }\n}\n```\n\n## Async scrapes\n\nPass `async: true` to enqueue the job and poll by ID:\n\n```ts\nconst queued = await client.scrape.create({ url: 'https://example.com', async: true });\n// later — poll with the returned sc_… id\nconst final = await client.scrape.get('sc_...');\n```\n\n## What's available\n\nThe client exposes one resource per capability: `scrape`, `screenshots`, `recordings`, `bulk`,\n`fetch`, `monitors`, `sitemap`, and `account` (each with `create` / `get` / `list` methods as\napplicable, plus nested resources like `scrape.bulk` and `monitors.captures`).\n\nSee the [TypeScript SDK Reference](https://bytekit.com/docs/sdk/typescript/client) for every method and option.\n\n## Next steps\n\n- [Python SDK](https://bytekit.com/docs/libraries/python) — the same API surface in Python.\n- [API Reference](https://bytekit.com/docs/api) — the underlying REST endpoints.\n- [Errors](https://bytekit.com/docs/guides/errors) — error codes and retry guidance."
|
|
86
|
-
},
|
|
87
67
|
"guides/authentication": {
|
|
88
68
|
"title": "Authentication",
|
|
89
69
|
"section": "Guides",
|
|
@@ -109,6 +89,21 @@
|
|
|
109
89
|
"section": "Guides",
|
|
110
90
|
"body": "# Scraping\n\nScrape any URL as HTML, markdown, or structured content — formats, options, latency, and async polling.\n\n`POST /v1/scrape` fetches a URL and returns its content in the format you ask for. The same\nrequest shape works for every site; the options you pass determine the output and how long the\ncall takes.\n\n## Rendering & latency\n\nMost scrapes return in well under a second. Some options require ByteKit to fully render the page\nbefore it can return content, which takes longer — typically a few seconds. Pass these only when\nyou need them:\n\n| Option | When it adds latency |\n|--------|----------------------|\n| `cookies` | Non-empty array |\n| `headers` | Non-empty object |\n| `delay_ms` | Greater than `0` |\n| `async` | `true` (request is queued and processed off the fast path) |\n\nThe `country` option routes the request through a geo-located proxy. On its own it does not add\nrendering latency; it only does so when combined with one of the options above.\n\nLooking for `wait_for_selector` or `wait_until`? Those are not `ScrapeRequest` options — they\nbelong to the [Screenshot](https://bytekit.com/docs/api/screenshots/createscreenshot) and\n[Recording](https://bytekit.com/docs/api/recordings/createrecording) endpoints. Sending them to `/v1/scrape` returns\n`422`.\n\n```bash\n# A simple, low-latency scrape\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\": \"https://example.com\"}'\n```\n\n```bash\n# Slower: delay_ms forces a full render and waits before returning\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"url\": \"https://example.com\",\n \"delay_ms\": 2000\n }'\n```\n\n## Response fields\n\nThe default format is `raw_html` — pass `formats` to request others (`markdown`, `html`,\n`links`, `images`). The `formats` object in the response is keyed by the format you requested.\n\n| Field | Description |\n|-------|-------------|\n| `formats.raw_html` | Page content in the requested format (`raw_html` is the default when `formats` is omitted) |\n| `contentLength` | Compressed wire bytes — used for bandwidth billing |\n| `statusCode` | HTTP status code of the origin page |\n| `metadata.title` | Page `<title>` element |\n\nThe `X-Scrape-*` response headers describe how each request was handled (cache status, timing,\nand the final URL) — useful for debugging.\n\n## Async scrapes\n\nFor long-running pages, pass `\"async\": true` to get a `202 Accepted` response with a scrape\n`id` prefixed `sc_`. Poll the result with `GET /v1/scrape/{id}`.\n\n```bash\n# Start async scrape\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\": \"https://example.com\", \"async\": true}'\n\n# Poll for result\ncurl https://api.bytekit.com/v1/scrape/sc_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\n## Webhook event header\n\nEvery outbound webhook POST includes an `X-ByteKit-Event` header with the event type:\n\n| Event type | Trigger |\n|---|---|\n| `bulk.completed` | A bulk job finishes (all items processed) |\n| `scrape.completed` | An async scrape succeeds |\n| `scrape.failed` | An async scrape fails terminally |\n| `monitor.change_detected` | A monitor fires and detects a change (screenshot or content) |\n| `monitor.captured` | A monitor fires with no change detected (notify_on: every) |\n| `sitemap.completed` | A sitemap job finishes |\n| `sitemap.failed` | A sitemap job fails terminally |\n\nUse this header to dispatch events without inspecting the body shape:\n\n```python\nfrom flask import Flask, request\n\napp = Flask(__name__)\n\n@app.route(\"/webhooks/bytekit\", methods=[\"POST\"])\ndef handle():\n event = request.headers.get(\"X-ByteKit-Event\")\n if event == \"bulk.completed\":\n handle_bulk(request.json)\n elif event == \"scrape.completed\":\n handle_scrape(request.json)\n return \"\", 200\n```\n\n`X-ByteKit-Event` is a reserved header — you cannot supply it via `webhook_headers` in\nmonitor or bulk configuration. Attempts to do so will be rejected with a `422` at request\ntime.\n\n## Next steps\n\n- [Rate Limits](https://bytekit.com/docs/guides/rate-limits) — quota model and concurrency slots\n- [Errors](https://bytekit.com/docs/guides/errors) — how to interpret and retry error responses\n- [API Reference: Scrape](https://bytekit.com/docs/api/scrape/createscrape) — full request/response schema"
|
|
111
91
|
},
|
|
92
|
+
"libraries/go": {
|
|
93
|
+
"title": "Go",
|
|
94
|
+
"section": "General",
|
|
95
|
+
"body": "# Go\n\nCall the ByteKit REST API from Go with the standard library.\n\nByteKit is a plain REST API. There is no Go SDK — and you do not need one. The\nTypeScript and Python SDKs are thin wrappers over the same HTTP endpoints, so\ncalling ByteKit from Go is just a standard `net/http` request.\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tbody := bytes.NewBufferString(`{\"url\":\"https://example.com\",\"formats\":[\"markdown\"]}`)\n\treq, _ := http.NewRequest(\"POST\", \"https://api.bytekit.com/v1/scrape\", body)\n\treq.Header.Set(\"Authorization\", \"Bearer sk_live_your_api_key_here\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\tout, _ := io.ReadAll(resp.Body)\n\tfmt.Println(string(out))\n}\n```\n\n## Next steps\n\n- [API Reference](https://bytekit.com/docs/api) — every endpoint, request, and response.\n- [TypeScript SDK](https://bytekit.com/docs/libraries/typescript) and [Python SDK](https://bytekit.com/docs/libraries/python) — typed clients over the same REST API."
|
|
96
|
+
},
|
|
97
|
+
"libraries/python": {
|
|
98
|
+
"title": "Python SDK",
|
|
99
|
+
"section": "General",
|
|
100
|
+
"body": "# Python SDK\n\nOfficial Python client for ByteKit, with sync and async support.\n\nThe official Python SDK is generated from the ByteKit OpenAPI spec, so its models and\nmethods always match the API. Every operation ships in both synchronous and asynchronous form.\n\n## Install\n\n```bash\npip install bytekit\n```\n\n## Your first scrape\n\n```python\nfrom bytekit import AuthenticatedClient\nfrom bytekit.api.scrape import create_scrape\nfrom bytekit.models.scrape_request import ScrapeRequest\nfrom bytekit.models.scrape_request_formats_item import ScrapeRequestFormatsItem\nfrom bytekit.models.scrape_success_envelope import ScrapeSuccessEnvelope\n\nclient = AuthenticatedClient(\n base_url=\"https://api.bytekit.com\",\n token=\"sk_live_your_api_key_here\",\n)\n\n# Request the markdown format explicitly — otherwise response.formats.markdown is UNSET.\nbody = ScrapeRequest(\n url=\"https://example.com\",\n formats=[ScrapeRequestFormatsItem.MARKDOWN],\n)\nresponse = create_scrape.sync(client=client, body=body)\n\n# .sync() returns None on a transport error, and a queued/error envelope on the\n# async or failure paths. Only a ScrapeSuccessEnvelope carries populated formats.\nif response is None:\n print(\"Request failed — no response returned.\")\nelif isinstance(response, ScrapeSuccessEnvelope) and isinstance(response.formats.markdown, str):\n print(response.formats.markdown)\nelse:\n # Queued (ScrapeQueuedEnvelope) or error (ScrapeErrorEnvelope) — inspect `response`.\n print(f\"Scrape not complete: {response}\")\n```\n\nEach operation exposes four call styles:\n\n- `create_scrape.sync(...)` — returns the parsed model (or `None`).\n- `create_scrape.sync_detailed(...)` — returns the full `Response` (status code, headers, body).\n- `create_scrape.asyncio(...)` — awaitable form of `sync`.\n- `create_scrape.asyncio_detailed(...)` — awaitable form of `sync_detailed`.\n\n## Async usage\n\n```python\nimport asyncio\nfrom bytekit import AuthenticatedClient\nfrom bytekit.api.screenshots import create_screenshot\nfrom bytekit.models.screenshot_request import ScreenshotRequest\n\nasync def main():\n client = AuthenticatedClient(\n base_url=\"https://api.bytekit.com\",\n token=\"sk_live_your_api_key_here\",\n )\n body = ScreenshotRequest(url=\"https://example.com\")\n response = await create_screenshot.asyncio(client=client, body=body)\n print(response)\n\nasyncio.run(main())\n```\n\n## What's available\n\nOperations are grouped by capability under `bytekit.api.*`: `scrape`, `scrape_bulk`,\n`screenshots`, `recordings`, `bulk`, `fetch`, `fetch_bulk`, `monitors`, `sitemap`, and\n`account`.\n\nSee the [Python SDK Reference](https://bytekit.com/docs/sdk/python/client) for every module, function, and model.\n\n## Next steps\n\n- [TypeScript SDK](https://bytekit.com/docs/libraries/typescript) — the same API surface in TypeScript.\n- [API Reference](https://bytekit.com/docs/api) — the underlying REST endpoints.\n- [Errors](https://bytekit.com/docs/guides/errors) — error codes and retry guidance."
|
|
101
|
+
},
|
|
102
|
+
"libraries/typescript": {
|
|
103
|
+
"title": "TypeScript SDK",
|
|
104
|
+
"section": "General",
|
|
105
|
+
"body": "# TypeScript SDK\n\nType-safe ByteKit client for Node.js and modern JavaScript runtimes.\n\nThe official TypeScript SDK is a thin, type-safe wrapper over the ByteKit REST API. It works\nin Node.js and any runtime with a global `fetch` (Bun, Deno, Cloudflare Workers, modern\nbrowsers).\n\n## Install\n\n```bash\nnpm install @hunt-labs/bytekit-sdk\n```\n\n## Initialize\n\n```ts\nimport { RapidCrawl } from '@hunt-labs/bytekit-sdk';\n\nconst client = new RapidCrawl({\n apiKey: process.env.BYTEKIT_API_KEY!, // your sk_live_… key\n});\n```\n\n## Your first scrape\n\n```ts\nconst result = await client.scrape.create({\n url: 'https://example.com',\n formats: ['markdown'],\n});\n\nconsole.log(result);\n```\n\n## Capture a screenshot\n\n```ts\nconst shot = await client.screenshots.create({\n url: 'https://example.com',\n full_page: true,\n});\n\nconsole.log(shot);\n```\n\n## Handle errors\n\nAny 4xx/5xx response throws a `RapidCrawlError` carrying the HTTP `status` and the API\n`error.code`:\n\n```ts\nimport { RapidCrawl, RapidCrawlError } from '@hunt-labs/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 } else {\n throw err;\n }\n}\n```\n\n## Async scrapes\n\nPass `async: true` to enqueue the job and poll by ID:\n\n```ts\nconst queued = await client.scrape.create({ url: 'https://example.com', async: true });\n// later — poll with the returned sc_… id\nconst final = await client.scrape.get('sc_...');\n```\n\n## What's available\n\nThe client exposes one resource per capability: `scrape`, `screenshots`, `recordings`, `bulk`,\n`fetch`, `monitors`, `sitemap`, and `account` (each with `create` / `get` / `list` methods as\napplicable, plus nested resources like `scrape.bulk` and `monitors.captures`).\n\nSee the [TypeScript SDK Reference](https://bytekit.com/docs/sdk/typescript/client) for every method and option.\n\n## Next steps\n\n- [Python SDK](https://bytekit.com/docs/libraries/python) — the same API surface in Python.\n- [API Reference](https://bytekit.com/docs/api) — the underlying REST endpoints.\n- [Errors](https://bytekit.com/docs/guides/errors) — error codes and retry guidance."
|
|
106
|
+
},
|
|
112
107
|
"api/account/getaccount": {
|
|
113
108
|
"title": "Get account details",
|
|
114
109
|
"section": "API Reference",
|
|
@@ -119,6 +114,21 @@
|
|
|
119
114
|
"section": "API Reference",
|
|
120
115
|
"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
116
|
},
|
|
117
|
+
"api/fetch/getfetch": {
|
|
118
|
+
"title": "Fetch a URL (GET)",
|
|
119
|
+
"section": "API Reference",
|
|
120
|
+
"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"
|
|
121
|
+
},
|
|
122
|
+
"api/fetch": {
|
|
123
|
+
"title": "Fetch",
|
|
124
|
+
"section": "API Reference",
|
|
125
|
+
"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"
|
|
126
|
+
},
|
|
127
|
+
"api/fetch/postfetch": {
|
|
128
|
+
"title": "Fetch a URL (POST)",
|
|
129
|
+
"section": "API Reference",
|
|
130
|
+
"body": "# Fetch a URL (POST)\n\nSame as GET /v1/fetch but with a JSON request body."
|
|
131
|
+
},
|
|
122
132
|
"api/bulk/createbulk": {
|
|
123
133
|
"title": "Create mixed bulk job",
|
|
124
134
|
"section": "API Reference",
|
|
@@ -149,21 +159,6 @@
|
|
|
149
159
|
"section": "API Reference",
|
|
150
160
|
"body": "# List bulk job items"
|
|
151
161
|
},
|
|
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
|
-
},
|
|
167
162
|
"api/fetch-bulk/createfetchbulk": {
|
|
168
163
|
"title": "Bulk fetch URLs",
|
|
169
164
|
"section": "API Reference",
|
|
@@ -189,6 +184,16 @@
|
|
|
189
184
|
"section": "API Reference",
|
|
190
185
|
"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
186
|
},
|
|
187
|
+
"api/plans": {
|
|
188
|
+
"title": "Plans",
|
|
189
|
+
"section": "API Reference",
|
|
190
|
+
"body": "# Plans\n\nPlans API — endpoints, requests, and responses.\n\nThe **Plans** API. 1 endpoint:\n\n- [List public plan catalog](https://bytekit.com/docs/api/plans/listplans) — GET /v1/plans"
|
|
191
|
+
},
|
|
192
|
+
"api/plans/listplans": {
|
|
193
|
+
"title": "List public plan catalog",
|
|
194
|
+
"section": "API Reference",
|
|
195
|
+
"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"
|
|
196
|
+
},
|
|
192
197
|
"api/monitors/createmonitor": {
|
|
193
198
|
"title": "Create a change-detection monitor",
|
|
194
199
|
"section": "API Reference",
|
|
@@ -224,16 +229,6 @@
|
|
|
224
229
|
"section": "API Reference",
|
|
225
230
|
"body": "# Update monitor"
|
|
226
231
|
},
|
|
227
|
-
"api/plans": {
|
|
228
|
-
"title": "Plans",
|
|
229
|
-
"section": "API Reference",
|
|
230
|
-
"body": "# Plans\n\nPlans API — endpoints, requests, and responses.\n\nThe **Plans** API. 1 endpoint:\n\n- [List public plan catalog](https://bytekit.com/docs/api/plans/listplans) — GET /v1/plans"
|
|
231
|
-
},
|
|
232
|
-
"api/plans/listplans": {
|
|
233
|
-
"title": "List public plan catalog",
|
|
234
|
-
"section": "API Reference",
|
|
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"
|
|
236
|
-
},
|
|
237
232
|
"api/schema/createschemaextraction": {
|
|
238
233
|
"title": "Schema-driven structured extraction",
|
|
239
234
|
"section": "API Reference",
|
|
@@ -412,7 +407,7 @@
|
|
|
412
407
|
"sdk/typescript/account": {
|
|
413
408
|
"title": "Account",
|
|
414
409
|
"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<
|
|
410
|
+
"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\n`client.request()` short-circuits an empty body (204 or any empty response)\nto `undefined` before it would parse the body as JSON (#2450), so this\nmethod resolves cleanly on the gateway's empty 204 body.\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
411
|
},
|
|
417
412
|
"sdk/typescript/bulk": {
|
|
418
413
|
"title": "Bulk",
|
|
@@ -422,7 +417,7 @@
|
|
|
422
417
|
"sdk/typescript/client": {
|
|
423
418
|
"title": "Client",
|
|
424
419
|
"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 {
|
|
420
|
+
"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 { ByteKit } from '@hunt-labs/bytekit-sdk';\n\nconst client = new ByteKit({\n apiKey: process.env.BYTEKIT_API_KEY!, // your sk_live_… key\n});\n```\n\n## Options (`ByteKitOptions`)\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.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 `ByteKitError` carrying the HTTP `status` and the API `code`.\n\n```ts\nimport { ByteKit, ByteKitError } from '@hunt-labs/bytekit-sdk';\n\ntry {\n await client.scrape.create({ url: 'https://example.com' });\n} catch (err) {\n if (err instanceof ByteKitError) {\n console.error(`${err.status} ${err.code}: ${err.message}`);\n }\n}\n```"
|
|
426
421
|
},
|
|
427
422
|
"sdk/typescript/fetch-bulk": {
|
|
428
423
|
"title": "Fetch Bulk",
|
|
@@ -439,25 +434,20 @@
|
|
|
439
434
|
"section": "SDK Reference",
|
|
440
435
|
"body": "# Monitors\n\nWatch a URL on a schedule and webhook on change.\n\n# Monitors\n\nWatch a URL on a schedule and webhook on change. Accessed via `client.monitors`.\n\n## create\n\n```ts\nclient.monitors.create(opts: Record<string, unknown>): Promise<unknown>\n```\n\nPOST /v1/monitors — create a page-change monitor (screenshot or scrape capture).\nFirst-capture behavior is the same for both types: the first capture is a silent baseline (has_change=false, change_pct=null) with no change_detected webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.\n\n## list\n\n```ts\nclient.monitors.list(): Promise<unknown>\n```\n\nGET /v1/monitors — list all monitors for the account\n\n## get\n\n```ts\nclient.monitors.get(id: MonitorId): Promise<unknown>\n```\n\nGET /v1/monitors/\\{id\\} — get a monitor by ID\n\n## update\n\n```ts\nclient.monitors.update(id: MonitorId, opts: Record<string, unknown>): Promise<unknown>\n```\n\nPATCH /v1/monitors/\\{id\\} — update a monitor\n\n## delete\n\n```ts\nclient.monitors.delete(id: MonitorId): Promise<unknown>\n```\n\nDELETE /v1/monitors/\\{id\\} — delete a monitor\n\n## captures\n\n### list\n\n```ts\nclient.monitors.captures.list(id: MonitorId): Promise<unknown>\n```\n\nGET /v1/monitors/\\{id\\}/captures — list captures for a monitor"
|
|
441
436
|
},
|
|
442
|
-
"sdk/typescript/recordings": {
|
|
443
|
-
"title": "Recordings",
|
|
444
|
-
"section": "SDK Reference",
|
|
445
|
-
"body": "# Recordings\n\nGenerate a scrolling video of a page.\n\n# Recordings\n\nGenerate a scrolling video of a page. Accessed via `client.recordings`.\n\n## create\n\n```ts\nclient.recordings.create(opts: Record<string, unknown>): Promise<unknown>\n```\n\nPOST /v1/recordings — start a recording\n\n## get\n\n```ts\nclient.recordings.get(id: RecordingId): Promise<unknown>\n```\n\nGET /v1/recordings/\\{id\\} — poll a recording by ID"
|
|
446
|
-
},
|
|
447
437
|
"sdk/typescript/scrape-bulk": {
|
|
448
438
|
"title": "Scrape Bulk",
|
|
449
439
|
"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:
|
|
440
|
+
"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
441
|
},
|
|
452
442
|
"sdk/typescript/scrape": {
|
|
453
443
|
"title": "Scrape",
|
|
454
444
|
"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<
|
|
445
|
+
"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
446
|
},
|
|
457
447
|
"sdk/typescript/screenshots": {
|
|
458
448
|
"title": "Screenshots",
|
|
459
449
|
"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:
|
|
450
|
+
"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
451
|
},
|
|
462
452
|
"sdk/typescript/search": {
|
|
463
453
|
"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