@hunt-labs/bytekit-sdk 0.11.10 → 0.11.11

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,24 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.11.11] - 2026-10-14
14
+
15
+ ### Changed
16
+
17
+ - **`scrape.create` takes the `json` format (#5133).** `ScrapeOpts.formats` now accepts one
18
+ `{ type: 'json', schema, model?, prompt? }` entry beside the string formats; before, the option
19
+ type rejected it at compile time. The generated bulk create types (`scrape.bulk.create`,
20
+ `bulk.create`) take the same entry in `defaults.formats` and `items[].formats`, and
21
+ `ScrapeRequestJsonFormat` is now usable as written: `schema` is a free-form object (it generated
22
+ as `Record<string, never>`, which no schema could satisfy) and `model` is optional (the spec's
23
+ `default` keyword typed it as required; the default is now stated in its description). Regenerated
24
+ `src/generated/api.d.ts`; a request with string formats only is unchanged.
25
+
26
+ - **`POST /v1/account/bootstrap` types describe the joined-invite outcome (#5093).** The internal
27
+ operation's description and `201` response said only "account created"; since #5058 a `201`
28
+ also means the caller joined the newest pending invite's account. Regenerated
29
+ `src/generated/api.d.ts`; description text only, no SDK method signature moves.
30
+
13
31
  ## [0.11.10] - 2026-10-02
14
32
 
15
33
  ### Changed
@@ -1207,8 +1207,11 @@ export interface paths {
1207
1207
  put?: never;
1208
1208
  /**
1209
1209
  * Bootstrap account
1210
- * @description First-time account creation for a Clerk-authenticated user.
1211
- * Idempotent — returns 200 if the account already exists, 201 on first creation.
1210
+ * @description First-time bootstrap for a Clerk-authenticated user: the caller joins the
1211
+ * account of the newest pending invite for the session email (on a live
1212
+ * account), or, with no such invite, a new account is created.
1213
+ * Idempotent — returns 200 if the account already exists, 201 on the first
1214
+ * successful bootstrap (either outcome).
1212
1215
  * Does not require an existing membership (allowNoMembership=true).
1213
1216
  */
1214
1217
  post: operations["bootstrapAccount"];
@@ -1578,6 +1581,10 @@ export interface components {
1578
1581
  formats?: {
1579
1582
  raw?: string | null;
1580
1583
  markdown?: string | null;
1584
+ /** @description The item's `formats.json` result (`data`, `validated`, `model`), present only when the job requested a `json` format and the serialized result fits the 8,192-character bound; `null` when the item has no result. */
1585
+ json?: {
1586
+ [key: string]: unknown;
1587
+ } | null;
1581
1588
  links?: null | (string | components["schemas"]["ScrapeScoredLink"])[];
1582
1589
  images?: null | (string | components["schemas"]["ScrapeScoredImage"])[];
1583
1590
  };
@@ -1770,10 +1777,10 @@ export interface components {
1770
1777
  * or `images`) or a `json` object entry that extracts structured data from the page.
1771
1778
  * The string `"json"` is not a format value; the `json` entry is an object, described
1772
1779
  * by `ScrapeRequestJsonFormat`. A list may hold at most one `json` entry, and a list
1773
- * holding only the `json` entry still captures `raw`. The `json` entry exists on
1774
- * `POST /v1/scrape` only: the bulk and monitor `formats` fields accept the string
1775
- * formats alone. Its result is `formats.json` on the response, and its price is
1776
- * described on `ScrapeRequestJsonFormat`.
1780
+ * holding only the `json` entry still captures `raw`. The `json` entry is accepted on
1781
+ * `POST /v1/scrape`, `POST /v1/scrape/bulk` and `POST /v1/bulk` (scrape entries);
1782
+ * monitor `formats` accept the string formats alone. Its result is `formats.json` on the
1783
+ * response, and its charge is described on `ScrapeRequestJsonFormat`.
1777
1784
  * @default [
1778
1785
  * "raw"
1779
1786
  * ]
@@ -1903,11 +1910,17 @@ export interface components {
1903
1910
  * @description The `json` entry of `ScrapeRequest.formats`: structured extraction over the scraped
1904
1911
  * page, using the same extractor as `POST /v1/schema`.
1905
1912
  *
1906
- * **Price.** Each `json` entry costs 10 credits, charged only when the extraction
1907
- * validates (`formats.json.validated` is `true`). The charge is on top of the scrape's
1908
- * own charge and is never scaled by the scrape's factors. The 10 credits are reserved at
1909
- * admission in every billing mode and released again when the extraction does not
1910
- * validate. This price is provisional.
1913
+ * **Charge.** Each `json` entry carries a flat per-extraction credit charge, on top of the
1914
+ * scrape's own bandwidth charge and never scaled by the scrape's factors. It is charged
1915
+ * only when the extraction validates (`formats.json.validated` is `true`). The credits are
1916
+ * reserved at admission in every billing mode and released again when the extraction does
1917
+ * not validate.
1918
+ *
1919
+ * **Where it applies.** The entry is accepted in `formats` on `POST /v1/scrape`, in
1920
+ * `defaults.formats` and each `items[].formats` of `POST /v1/scrape/bulk`, and in the same
1921
+ * fields of scrape entries on `POST /v1/bulk`. A list holds at most one `json` entry. On
1922
+ * the bulk endpoints each scrape item carries its own `formats.json` result; an item's own
1923
+ * `json` entry replaces the one in `defaults`.
1911
1924
  *
1912
1925
  * **Errors.** A `schema` the extractor cannot take is refused with
1913
1926
  * `422 schema_incompatible`, and a deployment with no extraction provider refuses the
@@ -1925,13 +1938,14 @@ export interface components {
1925
1938
  * most 8, it must compile under Ajv, and it must be normalizable into the extractor's
1926
1939
  * strict subset (root `type: object`, and only the keyword allowlist given there).
1927
1940
  */
1928
- schema: Record<string, never>;
1941
+ schema: {
1942
+ [key: string]: unknown;
1943
+ };
1929
1944
  /**
1930
- * @description Extraction model.
1931
- * @default openai/gpt-oss-20b
1945
+ * @description Extraction model. Defaults to `openai/gpt-oss-20b` when omitted.
1932
1946
  * @enum {string}
1933
1947
  */
1934
- model: "openai/gpt-oss-20b" | "openai/gpt-oss-120b";
1948
+ model?: "openai/gpt-oss-20b" | "openai/gpt-oss-120b";
1935
1949
  /** @description Optional natural-language extraction hint. */
1936
1950
  prompt?: string;
1937
1951
  };
@@ -1995,7 +2009,9 @@ export interface components {
1995
2009
  */
1996
2010
  json?: {
1997
2011
  /** @description The extracted object, or `null` whenever `validated` is `false`. */
1998
- data: Record<string, never> | null;
2012
+ data: {
2013
+ [key: string]: unknown;
2014
+ } | null;
1999
2015
  /** @description Whether the extraction produced output matching the schema. The `json` credits are charged only when `true`. */
2000
2016
  validated: boolean;
2001
2017
  /** @description The extraction model that ran. */
@@ -4192,7 +4208,7 @@ export interface operations {
4192
4208
  items?: {
4193
4209
  /** Format: uri */
4194
4210
  url: string;
4195
- formats?: ("raw" | "markdown" | "links" | "images")[];
4211
+ formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
4196
4212
  country?: string;
4197
4213
  delay_ms?: number;
4198
4214
  timeout_ms?: number;
@@ -4225,7 +4241,7 @@ export interface operations {
4225
4241
  * "raw"
4226
4242
  * ]
4227
4243
  */
4228
- formats?: ("raw" | "markdown" | "links" | "images")[];
4244
+ formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
4229
4245
  /** @default US */
4230
4246
  country?: string;
4231
4247
  /** @default 0 */
@@ -5273,7 +5289,7 @@ export interface operations {
5273
5289
  language?: string | null;
5274
5290
  dark_mode?: boolean;
5275
5291
  /** @description Scrape output formats (scrape entries). */
5276
- formats?: ("raw" | "markdown" | "links" | "images")[];
5292
+ formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
5277
5293
  /** @enum {string} */
5278
5294
  wait_until?: "load" | "domcontentloaded" | "networkidle";
5279
5295
  wait_for_selector?: string | null;
@@ -5326,7 +5342,7 @@ export interface operations {
5326
5342
  language?: string | null;
5327
5343
  /** @default false */
5328
5344
  dark_mode?: boolean;
5329
- formats?: ("raw" | "markdown" | "links" | "images")[];
5345
+ formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
5330
5346
  /**
5331
5347
  * @default load
5332
5348
  * @enum {string}
@@ -5700,10 +5716,14 @@ export interface operations {
5700
5716
  markdown?: string | null;
5701
5717
  /** @description `type: scrape` only. Pre-signed download URL for the markdown rendering of the page, valid for 600 seconds (10 minutes) from the moment this response was generated — the same signing TTL as `content_url` and `image_url` above. A new signature is minted on every poll for a completed item with a markdown key. For every other item the stored value is returned unchanged — `null` while no markdown has been stored, and otherwise a private, unsigned storage URL that returns 401 on download. No `artifact_warnings` entry is raised for this field; unlike `GET /v1/fetch/bulk/{id}`, this endpoint reports no `artifact_unavailable` when signing fails. */
5702
5718
  markdown_url?: string | null;
5703
- /** @description `type: scrape` only. Exact requested artifact values or signed references. Every key is present; unrequested or unavailable values are null, with nonfatal reference failures in `artifact_warnings`. */
5719
+ /** @description `type: scrape` only. Exact requested artifact values or signed references. `raw`, `markdown`, `links` and `images` are always present; unrequested or unavailable values are null, with nonfatal reference failures in `artifact_warnings`. `json` is present only on an item that requested a `json` format. */
5704
5720
  artifacts?: {
5705
5721
  raw: string | null;
5706
5722
  markdown: string | null;
5723
+ /** @description The item's `json` format result (`data`, `validated`, `model`); `null` while the item has stored none. */
5724
+ json?: {
5725
+ [key: string]: unknown;
5726
+ } | null;
5707
5727
  links: null | (string | components["schemas"]["ScrapeScoredLink"])[];
5708
5728
  images: null | (string | components["schemas"]["ScrapeScoredImage"])[];
5709
5729
  };
@@ -7752,7 +7772,7 @@ export interface operations {
7752
7772
  "application/json": components["schemas"]["Account"];
7753
7773
  };
7754
7774
  };
7755
- /** @description Account created. */
7775
+ /** @description First successful bootstrap: the caller joined a pending invite's account, or a new account was created. */
7756
7776
  201: {
7757
7777
  headers: {
7758
7778
  [name: string]: unknown;
@@ -1,5 +1,5 @@
1
1
  import type { ByteKit, RequestOptions } from '../client.js';
2
- import type { operations } from '../generated/api.js';
2
+ import type { components, operations } from '../generated/api.js';
3
3
  import type { ScrapeId, BulkId } from '../types.js';
4
4
  /**
5
5
  * Response of POST /v1/scrape — the WIRE union: a 200 terminal envelope or a 202
@@ -48,10 +48,13 @@ export type MarkdownLinks = 'inline' | 'references' | 'none' | 'text';
48
48
  export type MarkdownImages = 'inline' | 'references' | 'none' | 'text';
49
49
  /** Tokenizer encoding hint for `token_budget`. */
50
50
  export type TokenEncoding = 'cl100k_base' | 'o200k_base';
51
+ /** The `{ type: 'json', schema }` entry of `formats`, typed from the spec. */
52
+ type ScrapeJsonFormat = components['schemas']['ScrapeRequestJsonFormat'];
51
53
  /** Options for POST /v1/scrape. */
52
54
  export interface ScrapeOpts {
53
55
  url: string;
54
- formats?: Array<'raw' | 'markdown' | 'links' | 'images'>;
56
+ /** String formats, plus at most one `{ type: 'json', schema }` entry for structured extraction (the entry's result is `formats.json`). */
57
+ formats?: Array<'raw' | 'markdown' | 'links' | 'images' | ScrapeJsonFormat>;
55
58
  country?: string;
56
59
  delay_ms?: number;
57
60
  /** SERVER-side scrape budget in ms — how long the server may spend on the scrape itself. For the CLIENT-side abort budget (when this SDK gives up on the wire), see `RequestOptions.requestTimeoutMs`. */
package/dist/version.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * outbound request carries — see the emit site in `client.ts`. The header name is spelled
6
6
  * only there, so issue #2905's pre-merge gate 1 counts exactly one occurrence in `src/`.
7
7
  */
8
- export declare const SDK_VERSION = "0.11.10";
8
+ export declare const SDK_VERSION = "0.11.11";
package/dist/version.js CHANGED
@@ -9,4 +9,4 @@
9
9
  * outbound request carries — see the emit site in `client.ts`. The header name is spelled
10
10
  * only there, so issue #2905's pre-merge gate 1 counts exactly one occurrence in `src/`.
11
11
  */
12
- export const SDK_VERSION = '0.11.10';
12
+ export const SDK_VERSION = '0.11.11';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunt-labs/bytekit-sdk",
3
- "version": "0.11.10",
3
+ "version": "0.11.11",
4
4
  "description": "Official TypeScript SDK for the ByteKit API",
5
5
  "license": "MIT",
6
6
  "type": "module",