blun-king-cli 9.1.584 → 9.1.585

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 +17 -15
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 9.1.585 - 2026-09-08
2
+
3
+ - Managed WebSearch validates result envelopes and source rows even when optional search status metadata is absent.
4
+ - Malformed successful HTTP responses no longer appear as empty searches; invalid source rows fail the whole response before results or partial-source notices are returned.
5
+ - Valid legacy responses, empty result arrays and empty string excerpts remain supported. Cancellation, request authentication, FetchURL and Telegram behavior are unchanged.
6
+
1
7
  ## 9.1.584 - 2026-09-08
2
8
 
3
9
  - WebSearch forwards caller cancellation through the tool and managed HTTP search request, including response-body reads.
package/blun.mjs CHANGED
@@ -315303,10 +315303,25 @@ var init_blun_web_search = __esmMin((() => {
315303
315303
  }
315304
315304
  const json = (await response.json());
315305
315305
  signal?.throwIfAborted();
315306
- const raw = Array.isArray(json.search_results) ? json.search_results : [];
315306
+ if (!json || typeof json !== 'object' || Array.isArray(json) || !Array.isArray(json.search_results))
315307
+ throw new Error('Invalid search results response.');
315308
+ const raw = json.search_results;
315309
+ if (!raw.every(row => {
315310
+ if (!row || typeof row.title !== 'string' || !row.title.trim()
315311
+ || typeof row.snippet !== 'string' || typeof row.url !== 'string')
315312
+ return false;
315313
+ try {
315314
+ const url = new URL(row.url);
315315
+ return (url.protocol === 'https:' || url.protocol === 'http:') && !url.username && !url.password;
315316
+ }
315317
+ catch {
315318
+ return false;
315319
+ }
315320
+ }))
315321
+ throw new Error('Invalid search results response.');
315307
315322
  const status = json.search_status;
315308
315323
  if (status !== undefined) {
315309
- if (!status || typeof status !== 'object' || !Array.isArray(json.search_results)
315324
+ if (!status || typeof status !== 'object'
315310
315325
  || !Number.isInteger(status.failed_sources) || typeof status.failed_sources !== 'number'
315311
315326
  || status.failed_sources < 0 || status.failed_sources > 128
315312
315327
  || (status.state !== 'complete' && status.state !== 'partial')
@@ -315314,19 +315329,6 @@ var init_blun_web_search = __esmMin((() => {
315314
315329
  || (status.state === 'partial' && (status.failed_sources === 0 || raw.length === 0))) {
315315
315330
  throw new Error('Invalid search status response.');
315316
315331
  }
315317
- if (!raw.every(row => {
315318
- if (!row || typeof row.title !== 'string' || !row.title.trim()
315319
- || typeof row.snippet !== 'string' || typeof row.url !== 'string')
315320
- return false;
315321
- try {
315322
- const url = new URL(row.url);
315323
- return (url.protocol === 'https:' || url.protocol === 'http:') && !url.username && !url.password;
315324
- }
315325
- catch {
315326
- return false;
315327
- }
315328
- }))
315329
- throw new Error('Invalid search results response.');
315330
315332
  if (status.state === 'partial') {
315331
315333
  if (!supportsNotices)
315332
315334
  throw new Error('Partial search results require a notice consumer.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.584",
3
+ "version": "9.1.585",
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": {