@hunt-labs/bytekit-mcp 0.3.1 → 0.3.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/CHANGELOG.md CHANGED
@@ -10,6 +10,17 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.3.2] - 2026-08-31
14
+
15
+ ### Changed
16
+
17
+ - Refreshed the bundled documentation snapshot after the CLI's new changelog entry (#3691).
18
+ The only bundled byte that moves is the `changelog` page's truncation notice, which reports the
19
+ full page size: `149708` becomes `151210` bytes. That page concatenates four package changelogs
20
+ and is bound to 16,384 bytes (#3233), so the CLI section itself is still far past the cut and is
21
+ **not** in the bundle — the notice's byte count is the whole delta. The page count stays at 108
22
+ and no tool, argument, or response shape changes.
23
+
13
24
  ## [0.3.1] - 2026-08-25
14
25
 
15
26
  ### Changed
@@ -277,7 +277,7 @@
277
277
  "changelog": {
278
278
  "title": "Changelog",
279
279
  "section": "General",
280
- "body": "# Changelog\n\nRelease history for the ByteKit SDKs, CLI, and MCP server\n\nEach section below is the `CHANGELOG.md` kept alongside that client’s source in the ByteKit\nrepository. Entries record what a release changed, including names and options it retired.\n\n## @hunt-labs/bytekit-sdk\n\nTypeScript SDK, published on npm.\n\n### [Unreleased]\n\n### [0.9.1] - 2026-08-25\n\n#### Fixed\n\n- The generated `paths` type for the `200` of `GET /v1/scrape/bulk/{id}` now declares `items`\n (#3632). The route builds one body and varies only the status code, so the terminal `200`\n has always carried the per-URL scrape envelopes — but only the `202` documented them, so\n `scrape.bulk.get()` typed the results away at exactly the poll that has them. Types only:\n the field was already on the wire, and server behavior is unchanged.\n\n- The generated `paths` types now describe the `202` that `GET /v1/scrape/bulk/{id}`,\n `GET /v1/fetch/bulk/{id}` and `GET /v1/bulk/{id}` already serve while a bulk job is\n non-terminal (#3533). Each of the three returns 202 with the job envelope until the job is\n terminal and 200 afterwards, but only the 200 was declared, so anything typed off the spec\n had no shape for the response the very first poll receives. Types only: `scrape.bulk.get()`,\n `fetch.bulk.get()` and `bulk.get()` already resolved the body on any 2xx, and server behavior\n is unchanged.\n\n#### Changed\n\n- The generated `topup_balance_bytes` description on `GET /v1/usage` now states that the value is\n the remaining purchased top-up bytes, already net of any overage consumed against them (#3459).\n Types only: the field's name, type and wire format are unchanged. The server previously\n subtracted the consumed overage a second time when computing this value, so the number a client\n reads is larger than before for accounts that ran past their included allowance.\n\n### [0.9.0] - 2026-08-20\n\n#### Removed\n\n- **BREAKING: the `cookies` and `headers` request-body fields are gone from every capture\n endpoint** (#3242) — `/v1/scrape`, `/v1/scrape/bulk`, `/v1/screenshots`, `/v1/recordings` and\n `/v1/schema`. A request that carries either field is rejected with `400 validation_error`; it\n is not ignored, and there is no deprecation window, feature flag, or compatibility header.\n `ScrapeOpts.cookies`, `ScrapeOpts.headers` and the exported `ScrapeCookie` type are removed\n from the SDK surface, so a call that still passes them no longer compiles.\n\n ```ts\n // before — compiled, and the values were forwarded to the target site\n await client.scrape.create({ url, cookies: [{ name: 'session', value: 'abc' }] });\n // after — does not compile; the same body over raw HTTP is a 400 validation_error\n await client.scrape.create({ url });\n ```\n\n ByteKit continues to manage its own cookie jar and request headers internally; what was removed\n is the caller's ability to inject or override them.\n\n#### Changed\n\n- **The generated types now declare the `503` response of `GET`/`POST /v1/fetch`** (#3372).\n `/v1/fetch` answers `503` on two conditions and both carry the ordinary `Error` envelope, so\n a typed consumer reading `operations['getFetch']['responses']` / `['postFetch']` can handle it\n instead of meeting an undeclared status at runtime. Read `error.code` to tell the two apart,\n because they disagree about `error.http_status`:\n - `upstream_error` — the target returned HTTP `502`, relayed at `503` because Cloudflare\n replaces a clean origin 502 with its own error page. `error.http_status` stays `502`, the\n **true upstream status**, and is the only surviving record of what the target answered.\n - `internal_error` (`Fetch service unavailable.`) — the fetch service was unreachable. There\n is no upstream, so `error.http_status` reports `503`, matching what was served.\n\n No runtime behaviour changes, and every other documented `/v1/fetch` status is unaffected.\n\n### [0.8.0] - 2026-08-19\n\n#### Removed\n\n- **BREAKING: `billing_multiplier` and `billed_bytes` are gone from the scrape success\n envelope** (#3143). Read `billing` instead — a `BillingNode` that names every factor\n applied to the charge, the multiplier they compose to, and the resulting billed bytes:\n\n ```ts\n // before\n const spend = res.billed_bytes; // flat, base-endpoint only\n // after\n const spend = res.billing?.billed_bytes;\n const why = res.billing?.factors; // [{ name: 'endpoint', value: 1.5, reason: 'scrape_md' }, …]\n ```\n\n This is a correction, not a rename: the two surfaces reported **different numbers for the\n same charge**. The flat pair carried the BASE-endpoint composition, so a markdown cache hit\n read `0.5` / `400` while the real charge — and the `X-Billing-Multiplier` header — was\n `0.75` / `600`; an html-only miss read the per-format credits estimate `1.5` / `150` against\n an endpoint factor of `1.0` / `100`. The flat pair also never carried the `clean_markdown`\n ×3 surcharge, so on a successful clean it under-reported the amount billed by two thirds.\n `billing.multiplier` composes every applied factor behind exactly one rounding, so it is the\n number that predicts your invoice.\n\n `billing` is optional and is **absent** on resources that completed before the billing node\n existed. A pre-node row omits the field rather than reporting a zero node, because a zero\n node would assert that a real past charge was zero. Test the node for presence\n (`res.billing !== undefined`, or equivalently a plain truthiness check — `billing` is an\n object or `undefined`, and an object is always truthy, so the two are the same test here).\n The hazard is a condition that reaches _into_ the node: `if (res.billing?.billed_bytes)`\n silently skips a genuine zero-byte charge, because `0` is falsy. Check that the node is\n present, then read `billed_bytes` from it.\n\n ```ts\n // wrong — a real 0-byte charge is falsy and disappears\n if (res.billing?.billed_bytes) record(res.billing.billed_bytes);\n // right — presence first, value second\n if (res.billing) record(res.billing.billed_bytes); // 0 is a charge, not an absence\n ```\n\n Two endpoints deliberately carry no node: `/v1/search` is billed per credit and reports\n `credits_used`, and a single `/v1/fetch` reports its charge through response headers only.\n The `/v1/logs` row field named `billing_multiplier` is a **different field** and is not the\n envelope field this release removed. It carries the BASE settled `credits_charged` factor,\n not the composed real-endpoint value the `X-Billing-Multiplier` header reports — a markdown\n cache hit reads `0.5` on the logs row and `0.75` on the header.\n\n#### Changed\n\n- Generated `ScrapeErrorEnvelope` types now describe terminal asynchronous `scrape.failed`\n webhook delivery (#1856). No runtime SDK behavior or API shape changed.\n\n#### Fixed\n\n- **`GET /v1/logs` entries now carry `billing_multiplier`, as a JSON number** (#3022). The\n gateway had been serializing that value under an undeclared key `credits`, and as the raw\n Postgres `NUMERIC(10,2)` string (`\"1.50\"`), while the OpenAPI spec — and therefore the\n generated types in `src/generated/api.d.ts` — declared `billing_multiplier?: number | null`.\n Anything typed against this package read `undefined` for the field.\n\n **Breaking at the wire level:** the undeclared `credits` key is gone from every `/v1/logs`\n entry. Code that reached past the generated types to read `credits` must read\n `billing_multiplier`. No SDK method exposes this endpoint, so the only change inside this\n package is the regenerated type description.\n\n- **`change_threshold` (on `monitors.create`/`monitors.list`/`monitors.get`/\n `monitors.update` responses) and `change_pct` (on `monitors.captures.list` entries)\n now serialize as JSON numbers, not strings** (#3021). Both are Postgres `NUMERIC(5,2)`\n columns; the gateway passed the raw driver string through unconverted (`\"5.00\"` /\n `\"7.25\"`) while the OpenAPI spec's _request_ schemas already declared `number` — only\n the _response_ schemas had been (incorrectly) edited to match the buggy string output.\n This release fixes the gateway serializer and corrects the two response schemas to\n `number` / `number | null`, so spec and runtime now agree.\n\n **Breaking at the wire level:** `client.monitors.create()`, `client.monitors.list()`,\n `client.monitors.get()`, and `client.monitors.update()` now return a JS number for\n `change_threshold` instead of a string (screenshot-type monitors only); the create\n response's `MonitorCreateResponse` and every other monitor route serialize through the\n same `MonitorResponse` schema, so all four are affected identically.\n `client.monitors.captures.list()` now returns a JS number for `change_pct` instead of a\n string. Code doing `parseFloat(monitor.change_threshold)` or template-literal\n interpolation keeps working; strict `typeof x === 'string'` checks or string methods\n (`.trim()`, `.padStart()`) will now throw. `change_pct` is `null` (not `0`) when there is\n no prior capture to diff against, unchanged from before. No SDK method-level shape\n changed otherwise — the only change inside this package is the regenerated type\n description.\n\n### [0.7.4] - 2026-08-19\n\n#### Changed\n\n- **`gen:version` no longer runs as part of `build`** (#3144). `scripts/gen-version.ts` writes\n `src/version.ts`, a _tracked_ source file, and it was chained into the `build` script. That made\n a build silently rewrite committed source whenever the file disagreed with the manifest: local\n runs went green on a tree CI could fail, the resulting ` M src/version.ts` was indistinguishable\n from routine build noise, and in CI the outcome depended on whether Turbo's build cache hit\n (restoring `dist/**` without re-running the generator) or missed. `build` now starts at\n `rm -rf dist ...`, so building this package touches nothing tracked. This changes `prepack` /\n `prepublishOnly` behavior too: both call `build`, so the publish path now reads the committed\n `src/version.ts` rather than regenerating it, and the committed value is what ships.\n- **New `gen:version-check` script**, `pnpm gen:version && git diff --exit-code src/version.ts`,\n mirroring the existing `gen:types-check` in the same manifest. It runs in `.woodpecker/ci.yaml`'s\n `types-drift` step, so a manifest bump without the matching `src/version.ts` regeneration now\n fails a named PR check instead of reaching `staging`. `src/__tests__/version-parity.test.ts`\n stays in place as the in-suite assertion; the gate is what makes its failure reachable before\n merge rather than after.\n\nNo runtime or type changes. `SDK_VERSION` and the `X-ByteKit-Client: sdk_ts/<version>` affix\nbehave exactly as before.\n\n### [0.7.3] - 2026-08-18\n\n#### Changed\n\n- **`XFetchContentLength`'s description no longer calls the header a wire-byte count** (#3133).\n `X-Fetch-Content-Length` is the byte length of the response body actually served: on a\n passthrough `/v1/fetch` (no `format`) that is the relayed upstream payload, so it does equal\n the upstream wire bytes — but with `format=html` or `format=markdown` the gateway overwrites\n it with the transformed document's length, which is typically far smaller than what is billed.\n The old description therefore read as a billing discrepancy on every transform request. Billing\n is unchanged and has always used the upstream compressed wire bytes reported by `X-Raw-Bytes` /\n `X-Billable-Bytes`. Generated-type comments only; no type or runtime behavior changes.\n\n### [0.7.2] - 2026-08-17\n\n#### Changed\n\n- **`ScrapeResponses.202`'s headers no longer advertise `X-Raw-Bytes`, `X-Billable-Bytes`, or\n `X-Billing-Multiplier`** (#3068). The gateway's async `/v1/scrape` path only ever emitted\n `X-Scrape-ID` and `X-Scrape-Status: queued` on a 202 — a queued scrape has no finalized byte\n charge yet — but `docs/api/openapi.yaml` documented the billing-transparency trio there too,\n so `src/generated/api.d.ts` typed three response headers the runtime never sends. This corrects\n the generated type to match the gateway's actual behavior; it does not change any runtime\n behavior. The synchronous `200` response, and `/v1/screenshots`' `202` (which does finalize a\n charge before responding), are unaffected.\n\n### [0.7.1] - 2026-08-11\n\n#### Changed\n\n- **Generated types follow the spec's corrected error and format vocabularies** (#2959). Two\n vocabulary corrections in `docs/api/openapi.yaml` flow through `src/generated/api.d.ts`:\n - `ScrapeErrorEnvelope.error.code` no longer lists `quota_exhausted`. The API has emitted\n `quota_exceeded` since #1539 and there is no throw site for `quota_exhausted` anywhere in\n the gateway, so this removes a code that has never been sent — not one that stops being\n sent. A consumer switching on it was matching a branch that could not be reached; the\n live code for an exceeded quota is `quota_exceeded`. `invalid_url`, which the API does\n emit, is unchanged and still listed.\n - `createBulk`'s `formats` now spells the raw-HTML value `raw_html`, matching `ScrapeRequest`\n and `createScrapeBulk`. `/v1/bulk` previously accepted only the internal `rawHtml`\n spelling and the spec documented that; it now accepts both, so the one endpoint that\n disagreed with the rest of the surface no longer does. `rawHtml` keeps working.\n\n#### Added\n\n- **`ByteKitError.headers` — the failing response's headers, so you can write your own backoff**\n (#2957). This SDK performs exactly one `fetch` per call and never retries, deliberately, so that\n retry policy stays the caller's. But the policy was unwritable: `ByteKitError` carried no\n headers and `requestWithResponse` returns headers only on 2xx — which a rate-limited request\n never reaches — so `Retry-After` and the `X-RateLimit-*` family were unreachable through the SDK\n at every entry point. `err.headers` closes that:\n\n ```ts\n if (err instanceof ByteKitError && err.status === 429) {\n const waitMs = Number(err.headers?.get('Retry-After') ?? 1) * 1000;\n }\n ```\n\n It is the runtime's own `Headers` object rather than a snapshot, so `get()` stays\n case-insensitive whatever casing the wire used. **Strictly additive**: it is optional and last\n on the constructor, follows the same `declare` discipline `details` uses, and an error\n constructed without one carries no `headers` key at all — `'headers' in err`, spreads and\n `JSON.stringify` are unchanged for every pre-existing construction, as are `status`, `code`,\n `message`, `details` and both 2xx return shapes. Only **response** headers are exposed;\n `Authorization` rides on the request and is never reachable through it.\n `ByteKitConnectionError` is unchanged — no response, no headers to carry.\n\n#### Fixed\n\n- **`screenshots.getWithResponse`'s docstring no longer promises headers that endpoint never\n emits** (#2957). The JSDoc — the one an IDE surfaces on hover, and the one the published SDK\n reference is generated from — claimed the documented `X-Screenshot-*` / `X-Raw-Bytes` /\n `X-Billable-Bytes` / `X-Billing-Multiplier` headers \"are on `headers`\". They are not:\n `GET /v1/screenshots/{id}` is declared with **no** `X-*` response headers, which is what\n `ByteKit.requestWithResponse`'s own doc comment and the README have said all along, and what a\n live GET confirms. Documentation only — no signature, return type or runtime behavior changed.\n `screenshots.createWithResponse` (`POST /v1/screenshots`) really does emit that family, and its\n docstring still says so.\n\n- **README documents the `signal`-vs-`timeoutMs` precedence and the `requestTimeoutMs` escape\n hatch** (#2957). Passing your own `AbortSignal` silently disables the constructor's `timeoutMs`\n — the signal becomes the request's only abort source, so a client built with `timeoutMs: 200`\n waits indefinitely if the signal never fires. That precedence was documented on\n `RequestOptions.signal` in the types, where only a reader already inspecting the option would\n meet it, and nowhere in the README. A new \"Timeouts and cancellation\" section states it with the\n full four-row precedence ta\n\n---\n[Truncated to the 16384-byte per-page limit — this page is 149708 bytes in full. The text cut here is not searchable either: search_docs matches only the part kept above. Read all of it at https://bytekit.com/docs/changelog]"
280
+ "body": "# Changelog\n\nRelease history for the ByteKit SDKs, CLI, and MCP server\n\nEach section below is the `CHANGELOG.md` kept alongside that client’s source in the ByteKit\nrepository. Entries record what a release changed, including names and options it retired.\n\n## @hunt-labs/bytekit-sdk\n\nTypeScript SDK, published on npm.\n\n### [Unreleased]\n\n### [0.9.1] - 2026-08-25\n\n#### Fixed\n\n- The generated `paths` type for the `200` of `GET /v1/scrape/bulk/{id}` now declares `items`\n (#3632). The route builds one body and varies only the status code, so the terminal `200`\n has always carried the per-URL scrape envelopes — but only the `202` documented them, so\n `scrape.bulk.get()` typed the results away at exactly the poll that has them. Types only:\n the field was already on the wire, and server behavior is unchanged.\n\n- The generated `paths` types now describe the `202` that `GET /v1/scrape/bulk/{id}`,\n `GET /v1/fetch/bulk/{id}` and `GET /v1/bulk/{id}` already serve while a bulk job is\n non-terminal (#3533). Each of the three returns 202 with the job envelope until the job is\n terminal and 200 afterwards, but only the 200 was declared, so anything typed off the spec\n had no shape for the response the very first poll receives. Types only: `scrape.bulk.get()`,\n `fetch.bulk.get()` and `bulk.get()` already resolved the body on any 2xx, and server behavior\n is unchanged.\n\n#### Changed\n\n- The generated `topup_balance_bytes` description on `GET /v1/usage` now states that the value is\n the remaining purchased top-up bytes, already net of any overage consumed against them (#3459).\n Types only: the field's name, type and wire format are unchanged. The server previously\n subtracted the consumed overage a second time when computing this value, so the number a client\n reads is larger than before for accounts that ran past their included allowance.\n\n### [0.9.0] - 2026-08-20\n\n#### Removed\n\n- **BREAKING: the `cookies` and `headers` request-body fields are gone from every capture\n endpoint** (#3242) — `/v1/scrape`, `/v1/scrape/bulk`, `/v1/screenshots`, `/v1/recordings` and\n `/v1/schema`. A request that carries either field is rejected with `400 validation_error`; it\n is not ignored, and there is no deprecation window, feature flag, or compatibility header.\n `ScrapeOpts.cookies`, `ScrapeOpts.headers` and the exported `ScrapeCookie` type are removed\n from the SDK surface, so a call that still passes them no longer compiles.\n\n ```ts\n // before — compiled, and the values were forwarded to the target site\n await client.scrape.create({ url, cookies: [{ name: 'session', value: 'abc' }] });\n // after — does not compile; the same body over raw HTTP is a 400 validation_error\n await client.scrape.create({ url });\n ```\n\n ByteKit continues to manage its own cookie jar and request headers internally; what was removed\n is the caller's ability to inject or override them.\n\n#### Changed\n\n- **The generated types now declare the `503` response of `GET`/`POST /v1/fetch`** (#3372).\n `/v1/fetch` answers `503` on two conditions and both carry the ordinary `Error` envelope, so\n a typed consumer reading `operations['getFetch']['responses']` / `['postFetch']` can handle it\n instead of meeting an undeclared status at runtime. Read `error.code` to tell the two apart,\n because they disagree about `error.http_status`:\n - `upstream_error` — the target returned HTTP `502`, relayed at `503` because Cloudflare\n replaces a clean origin 502 with its own error page. `error.http_status` stays `502`, the\n **true upstream status**, and is the only surviving record of what the target answered.\n - `internal_error` (`Fetch service unavailable.`) — the fetch service was unreachable. There\n is no upstream, so `error.http_status` reports `503`, matching what was served.\n\n No runtime behaviour changes, and every other documented `/v1/fetch` status is unaffected.\n\n### [0.8.0] - 2026-08-19\n\n#### Removed\n\n- **BREAKING: `billing_multiplier` and `billed_bytes` are gone from the scrape success\n envelope** (#3143). Read `billing` instead — a `BillingNode` that names every factor\n applied to the charge, the multiplier they compose to, and the resulting billed bytes:\n\n ```ts\n // before\n const spend = res.billed_bytes; // flat, base-endpoint only\n // after\n const spend = res.billing?.billed_bytes;\n const why = res.billing?.factors; // [{ name: 'endpoint', value: 1.5, reason: 'scrape_md' }, …]\n ```\n\n This is a correction, not a rename: the two surfaces reported **different numbers for the\n same charge**. The flat pair carried the BASE-endpoint composition, so a markdown cache hit\n read `0.5` / `400` while the real charge — and the `X-Billing-Multiplier` header — was\n `0.75` / `600`; an html-only miss read the per-format credits estimate `1.5` / `150` against\n an endpoint factor of `1.0` / `100`. The flat pair also never carried the `clean_markdown`\n ×3 surcharge, so on a successful clean it under-reported the amount billed by two thirds.\n `billing.multiplier` composes every applied factor behind exactly one rounding, so it is the\n number that predicts your invoice.\n\n `billing` is optional and is **absent** on resources that completed before the billing node\n existed. A pre-node row omits the field rather than reporting a zero node, because a zero\n node would assert that a real past charge was zero. Test the node for presence\n (`res.billing !== undefined`, or equivalently a plain truthiness check — `billing` is an\n object or `undefined`, and an object is always truthy, so the two are the same test here).\n The hazard is a condition that reaches _into_ the node: `if (res.billing?.billed_bytes)`\n silently skips a genuine zero-byte charge, because `0` is falsy. Check that the node is\n present, then read `billed_bytes` from it.\n\n ```ts\n // wrong — a real 0-byte charge is falsy and disappears\n if (res.billing?.billed_bytes) record(res.billing.billed_bytes);\n // right — presence first, value second\n if (res.billing) record(res.billing.billed_bytes); // 0 is a charge, not an absence\n ```\n\n Two endpoints deliberately carry no node: `/v1/search` is billed per credit and reports\n `credits_used`, and a single `/v1/fetch` reports its charge through response headers only.\n The `/v1/logs` row field named `billing_multiplier` is a **different field** and is not the\n envelope field this release removed. It carries the BASE settled `credits_charged` factor,\n not the composed real-endpoint value the `X-Billing-Multiplier` header reports — a markdown\n cache hit reads `0.5` on the logs row and `0.75` on the header.\n\n#### Changed\n\n- Generated `ScrapeErrorEnvelope` types now describe terminal asynchronous `scrape.failed`\n webhook delivery (#1856). No runtime SDK behavior or API shape changed.\n\n#### Fixed\n\n- **`GET /v1/logs` entries now carry `billing_multiplier`, as a JSON number** (#3022). The\n gateway had been serializing that value under an undeclared key `credits`, and as the raw\n Postgres `NUMERIC(10,2)` string (`\"1.50\"`), while the OpenAPI spec — and therefore the\n generated types in `src/generated/api.d.ts` — declared `billing_multiplier?: number | null`.\n Anything typed against this package read `undefined` for the field.\n\n **Breaking at the wire level:** the undeclared `credits` key is gone from every `/v1/logs`\n entry. Code that reached past the generated types to read `credits` must read\n `billing_multiplier`. No SDK method exposes this endpoint, so the only change inside this\n package is the regenerated type description.\n\n- **`change_threshold` (on `monitors.create`/`monitors.list`/`monitors.get`/\n `monitors.update` responses) and `change_pct` (on `monitors.captures.list` entries)\n now serialize as JSON numbers, not strings** (#3021). Both are Postgres `NUMERIC(5,2)`\n columns; the gateway passed the raw driver string through unconverted (`\"5.00\"` /\n `\"7.25\"`) while the OpenAPI spec's _request_ schemas already declared `number` — only\n the _response_ schemas had been (incorrectly) edited to match the buggy string output.\n This release fixes the gateway serializer and corrects the two response schemas to\n `number` / `number | null`, so spec and runtime now agree.\n\n **Breaking at the wire level:** `client.monitors.create()`, `client.monitors.list()`,\n `client.monitors.get()`, and `client.monitors.update()` now return a JS number for\n `change_threshold` instead of a string (screenshot-type monitors only); the create\n response's `MonitorCreateResponse` and every other monitor route serialize through the\n same `MonitorResponse` schema, so all four are affected identically.\n `client.monitors.captures.list()` now returns a JS number for `change_pct` instead of a\n string. Code doing `parseFloat(monitor.change_threshold)` or template-literal\n interpolation keeps working; strict `typeof x === 'string'` checks or string methods\n (`.trim()`, `.padStart()`) will now throw. `change_pct` is `null` (not `0`) when there is\n no prior capture to diff against, unchanged from before. No SDK method-level shape\n changed otherwise — the only change inside this package is the regenerated type\n description.\n\n### [0.7.4] - 2026-08-19\n\n#### Changed\n\n- **`gen:version` no longer runs as part of `build`** (#3144). `scripts/gen-version.ts` writes\n `src/version.ts`, a _tracked_ source file, and it was chained into the `build` script. That made\n a build silently rewrite committed source whenever the file disagreed with the manifest: local\n runs went green on a tree CI could fail, the resulting ` M src/version.ts` was indistinguishable\n from routine build noise, and in CI the outcome depended on whether Turbo's build cache hit\n (restoring `dist/**` without re-running the generator) or missed. `build` now starts at\n `rm -rf dist ...`, so building this package touches nothing tracked. This changes `prepack` /\n `prepublishOnly` behavior too: both call `build`, so the publish path now reads the committed\n `src/version.ts` rather than regenerating it, and the committed value is what ships.\n- **New `gen:version-check` script**, `pnpm gen:version && git diff --exit-code src/version.ts`,\n mirroring the existing `gen:types-check` in the same manifest. It runs in `.woodpecker/ci.yaml`'s\n `types-drift` step, so a manifest bump without the matching `src/version.ts` regeneration now\n fails a named PR check instead of reaching `staging`. `src/__tests__/version-parity.test.ts`\n stays in place as the in-suite assertion; the gate is what makes its failure reachable before\n merge rather than after.\n\nNo runtime or type changes. `SDK_VERSION` and the `X-ByteKit-Client: sdk_ts/<version>` affix\nbehave exactly as before.\n\n### [0.7.3] - 2026-08-18\n\n#### Changed\n\n- **`XFetchContentLength`'s description no longer calls the header a wire-byte count** (#3133).\n `X-Fetch-Content-Length` is the byte length of the response body actually served: on a\n passthrough `/v1/fetch` (no `format`) that is the relayed upstream payload, so it does equal\n the upstream wire bytes — but with `format=html` or `format=markdown` the gateway overwrites\n it with the transformed document's length, which is typically far smaller than what is billed.\n The old description therefore read as a billing discrepancy on every transform request. Billing\n is unchanged and has always used the upstream compressed wire bytes reported by `X-Raw-Bytes` /\n `X-Billable-Bytes`. Generated-type comments only; no type or runtime behavior changes.\n\n### [0.7.2] - 2026-08-17\n\n#### Changed\n\n- **`ScrapeResponses.202`'s headers no longer advertise `X-Raw-Bytes`, `X-Billable-Bytes`, or\n `X-Billing-Multiplier`** (#3068). The gateway's async `/v1/scrape` path only ever emitted\n `X-Scrape-ID` and `X-Scrape-Status: queued` on a 202 — a queued scrape has no finalized byte\n charge yet — but `docs/api/openapi.yaml` documented the billing-transparency trio there too,\n so `src/generated/api.d.ts` typed three response headers the runtime never sends. This corrects\n the generated type to match the gateway's actual behavior; it does not change any runtime\n behavior. The synchronous `200` response, and `/v1/screenshots`' `202` (which does finalize a\n charge before responding), are unaffected.\n\n### [0.7.1] - 2026-08-11\n\n#### Changed\n\n- **Generated types follow the spec's corrected error and format vocabularies** (#2959). Two\n vocabulary corrections in `docs/api/openapi.yaml` flow through `src/generated/api.d.ts`:\n - `ScrapeErrorEnvelope.error.code` no longer lists `quota_exhausted`. The API has emitted\n `quota_exceeded` since #1539 and there is no throw site for `quota_exhausted` anywhere in\n the gateway, so this removes a code that has never been sent — not one that stops being\n sent. A consumer switching on it was matching a branch that could not be reached; the\n live code for an exceeded quota is `quota_exceeded`. `invalid_url`, which the API does\n emit, is unchanged and still listed.\n - `createBulk`'s `formats` now spells the raw-HTML value `raw_html`, matching `ScrapeRequest`\n and `createScrapeBulk`. `/v1/bulk` previously accepted only the internal `rawHtml`\n spelling and the spec documented that; it now accepts both, so the one endpoint that\n disagreed with the rest of the surface no longer does. `rawHtml` keeps working.\n\n#### Added\n\n- **`ByteKitError.headers` — the failing response's headers, so you can write your own backoff**\n (#2957). This SDK performs exactly one `fetch` per call and never retries, deliberately, so that\n retry policy stays the caller's. But the policy was unwritable: `ByteKitError` carried no\n headers and `requestWithResponse` returns headers only on 2xx — which a rate-limited request\n never reaches — so `Retry-After` and the `X-RateLimit-*` family were unreachable through the SDK\n at every entry point. `err.headers` closes that:\n\n ```ts\n if (err instanceof ByteKitError && err.status === 429) {\n const waitMs = Number(err.headers?.get('Retry-After') ?? 1) * 1000;\n }\n ```\n\n It is the runtime's own `Headers` object rather than a snapshot, so `get()` stays\n case-insensitive whatever casing the wire used. **Strictly additive**: it is optional and last\n on the constructor, follows the same `declare` discipline `details` uses, and an error\n constructed without one carries no `headers` key at all — `'headers' in err`, spreads and\n `JSON.stringify` are unchanged for every pre-existing construction, as are `status`, `code`,\n `message`, `details` and both 2xx return shapes. Only **response** headers are exposed;\n `Authorization` rides on the request and is never reachable through it.\n `ByteKitConnectionError` is unchanged — no response, no headers to carry.\n\n#### Fixed\n\n- **`screenshots.getWithResponse`'s docstring no longer promises headers that endpoint never\n emits** (#2957). The JSDoc — the one an IDE surfaces on hover, and the one the published SDK\n reference is generated from — claimed the documented `X-Screenshot-*` / `X-Raw-Bytes` /\n `X-Billable-Bytes` / `X-Billing-Multiplier` headers \"are on `headers`\". They are not:\n `GET /v1/screenshots/{id}` is declared with **no** `X-*` response headers, which is what\n `ByteKit.requestWithResponse`'s own doc comment and the README have said all along, and what a\n live GET confirms. Documentation only — no signature, return type or runtime behavior changed.\n `screenshots.createWithResponse` (`POST /v1/screenshots`) really does emit that family, and its\n docstring still says so.\n\n- **README documents the `signal`-vs-`timeoutMs` precedence and the `requestTimeoutMs` escape\n hatch** (#2957). Passing your own `AbortSignal` silently disables the constructor's `timeoutMs`\n — the signal becomes the request's only abort source, so a client built with `timeoutMs: 200`\n waits indefinitely if the signal never fires. That precedence was documented on\n `RequestOptions.signal` in the types, where only a reader already inspecting the option would\n meet it, and nowhere in the README. A new \"Timeouts and cancellation\" section states it with the\n full four-row precedence ta\n\n---\n[Truncated to the 16384-byte per-page limit — this page is 151210 bytes in full. The text cut here is not searchable either: search_docs matches only the part kept above. Read all of it at https://bytekit.com/docs/changelog]"
281
281
  },
282
282
  "cli": {
283
283
  "title": "Install & Authenticate",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunt-labs/bytekit-mcp",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "ByteKit MCP server — exposes ByteKit web-data tools (scrape, screenshot, search, docs) to AI agents over the Model Context Protocol, hosted or as a local stdio server.",
5
5
  "license": "MIT",
6
6
  "type": "module",