@hunt-labs/bytekit-mcp 0.2.6 → 0.2.7

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,19 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.2.7] - 2026-08-18
14
+
15
+ ### Changed
16
+
17
+ - **The generated scrape contract now carries the `billing` node** (#3139). `ScrapeSuccessEnvelope`
18
+ gained an optional `billing` object with `raw_bytes`, an ordered `factors` list of
19
+ `name`/`value`/`reason` entries, `multiplier` and `billed_bytes`. The factor list explains
20
+ exactly how a scrape's charge was composed — endpoint factor, cache-hit discount, clean-markdown
21
+ surcharge — and multiplies out to the `X-Billing-Multiplier` on the same response. The existing
22
+ flat `billing_multiplier` / `billed_bytes` pair is unchanged and still emitted beside it; this
23
+ release is a regeneration of the checked-in contract only, with no behavior change in the server
24
+ itself.
25
+
13
26
  ## [0.2.6] - 2026-08-12
14
27
 
15
28
  ### Changed
@@ -129,6 +129,9 @@ export interface ScrapeSuccessEnvelope {
129
129
  * stays 0.5 (Exception D-scrape, issue #2315). Raw cache hits are 0.5 in both.
130
130
  * NOTE: pre-clean_markdown-multiplier; on clean_markdown:true the final billed
131
131
  * usage is 3x this. Omitted on paths with no billing value (issue #1899).
132
+ * LEGACY (issue #3139): `billing` below is now the explanation of the charge —
133
+ * it names every factor and composes to the X-Billing-Multiplier header. Read
134
+ * that; this field is removed in the final slice of #3135.
132
135
  */
133
136
  billing_multiplier?: number;
134
137
  /**
@@ -139,8 +142,22 @@ export interface ScrapeSuccessEnvelope {
139
142
  * field round(content_length x 0.5), per Exception D-scrape (issue #2315).
140
143
  * (pre-clean_markdown-multiplier, like the header). Omitted on paths with no
141
144
  * billing value (issue #1899).
145
+ * LEGACY (issue #3139): read `billing.billed_bytes` below instead — it equals
146
+ * the X-Billable-Bytes header on the same response.
142
147
  */
143
148
  billed_bytes?: number;
149
+ /**
150
+ * The named billing factor list (issue #3139) — the DEFINITION of what this
151
+ * call is charged. `factors` lists every applying factor in composition order
152
+ * (`endpoint` -> `cache_hit` -> `clean_markdown`), non-applying factors
153
+ * absent; their product is `multiplier`, and `round(raw_bytes x multiplier)`
154
+ * is `billed_bytes`. `multiplier` and `billed_bytes` equal the
155
+ * X-Billing-Multiplier and X-Billable-Bytes headers on the same response,
156
+ * because both are rendered from this one list. Where this node and any other
157
+ * billing surface disagree, this node is correct and the other is the bug.
158
+ * Omitted on paths that produce no billing value.
159
+ */
160
+ billing?: BillingNode;
144
161
  }
145
162
  export interface ScrapeErrorEnvelope {
146
163
  schema_version: ScrapeEnvelopeSchemaVersion;
@@ -179,3 +196,31 @@ export interface ScrapeQueuedEnvelope {
179
196
  * remains valid only at explicit read/delivery boundaries typed more loosely.
180
197
  */
181
198
  export type ScrapeEnvelope = ScrapeSuccessEnvelope | ScrapeErrorEnvelope | ScrapeQueuedEnvelope;
199
+ /**
200
+ * The complete billing factor vocabulary — fixed and TOTAL, in the order the
201
+ * factors compose. A charge is explained by these three names or it is not
202
+ * explained at all.
203
+ */
204
+ export type BillingFactorName = 'endpoint' | 'cache_hit' | 'clean_markdown';
205
+ export interface BillingFactor {
206
+ name: BillingFactorName;
207
+ /** This factor's multiplicative contribution. */
208
+ value: number;
209
+ /**
210
+ * Human-readable explanation. Explanatory, NOT contractual — never branch on
211
+ * it; `name` + `value` are the machine-readable half.
212
+ */
213
+ reason: string;
214
+ }
215
+ /**
216
+ * The customer-visible billing node. Emitted verbatim by buildSuccessEnvelope
217
+ * and rendered into the X-Raw-Bytes / X-Billable-Bytes / X-Billing-Multiplier
218
+ * trio, so body and headers agree by construction rather than by two
219
+ * computations that happen to match.
220
+ */
221
+ export interface BillingNode {
222
+ raw_bytes: number;
223
+ factors: BillingFactor[];
224
+ multiplier: number;
225
+ billed_bytes: number;
226
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunt-labs/bytekit-mcp",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
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",