blun-king-cli 9.1.581 → 9.1.582

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/blun.mjs +25 -2
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 9.1.582 - 2026-09-08
2
+
3
+ - Stop oversized local page responses while reading their body, including responses without a reliable Content-Length header. Cancel the stream when received bytes exceed the existing ten MiB limit.
4
+ - Apply the limit to the delivered response stream after HTTP decompression and preserve UTF-8 characters split across chunks. Transport buffers and the crossing chunk may already exist; this is not an exact process-memory ceiling.
5
+ - Keep the research fixes from 9.1.581. Telegram delivery, incoming addressing and model timing logic are unchanged.
6
+
1
7
  ## 9.1.581
2
8
 
3
9
  - Local HTML fetching now rejects extraction results that are empty after cleanup, instead of presenting a document title alone as page content.
package/blun.mjs CHANGED
@@ -315127,9 +315127,32 @@ var init_local_fetch_url = __esmMin((() => {
315127
315127
  const contentLengthRaw = response.headers.get("content-length");
315128
315128
  if (contentLengthRaw !== null) {
315129
315129
  const cl = Number(contentLengthRaw);
315130
- if (Number.isFinite(cl) && cl > this.maxBytes) throw new Error(`Response body too large: ${String(cl)} bytes exceeds maxBytes (${String(this.maxBytes)}).`);
315130
+ if (Number.isFinite(cl) && cl > this.maxBytes) {
315131
+ await response.body?.cancel().catch(() => {});
315132
+ throw new Error(`Response body too large: ${String(cl)} bytes exceeds maxBytes (${String(this.maxBytes)}).`);
315133
+ }
315134
+ }
315135
+ let body = "";
315136
+ if (response.body !== null) {
315137
+ const reader = response.body.getReader();
315138
+ const decoder = new TextDecoder();
315139
+ let receivedBytes = 0;
315140
+ try {
315141
+ while (true) {
315142
+ const { done, value } = await reader.read();
315143
+ if (done) break;
315144
+ receivedBytes += value.byteLength;
315145
+ if (receivedBytes > this.maxBytes) {
315146
+ await reader.cancel().catch(() => {});
315147
+ throw new Error(`Response body too large: ${String(receivedBytes)} bytes exceeds maxBytes (${String(this.maxBytes)}).`);
315148
+ }
315149
+ body += decoder.decode(value, { stream: true });
315150
+ }
315151
+ body += decoder.decode();
315152
+ } finally {
315153
+ reader.releaseLock();
315154
+ }
315131
315155
  }
315132
- const body = await response.text();
315133
315156
  const actualBytes = Buffer.byteLength(body, "utf8");
315134
315157
  if (actualBytes > this.maxBytes) throw new Error(`Response body too large: ${String(actualBytes)} bytes exceeds maxBytes (${String(this.maxBytes)}).`);
315135
315158
  const contentType = (response.headers.get("content-type") ?? "").toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.581",
3
+ "version": "9.1.582",
4
4
  "description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
5
5
  "license": "MIT",
6
6
  "bin": {