bunnyquery 1.21.0 → 1.21.4

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/README.md CHANGED
@@ -165,10 +165,11 @@ Mounts the widget. Returns the `BunnyQuery` object.
165
165
  | `hostDomain` | `string` | `null` | db-CDN host for temporary file URLs. Defaults to `skapi.app` (dev) / `skapi.com` (prod). |
166
166
  | `attachmentParsers` | `array` | `null` | Client-side attachment parsers. See [Attachment parser plugins](#attachment-parser-plugins). |
167
167
  | `windowedIndexing` | `boolean` | `true` | Server-driven windowed indexing for text and grid files (see [file types](#supported-file-types)). Pass `false` to fall back to agent-driven paging, which keeps the traversal inside the model's turn budget and the tab open. |
168
+ | `workerIndexEndings` | `boolean` | `false` | The worker writes the ending (done marker, run status) of a file read in one pass, such as an image, so closing or opening a page mid-pass cannot leave it 'working' or mark it "the page was closed". Turn on only once the skapi workers in your region carry the 2026-11-25 change. |
168
169
  | `allowAnonymous` | `boolean` | `null` | Open the chat with no login for visitors without an account. `null` follows the project's own "Allow anonymous users" setting (`getConnectionInfo().conf.require_login`); `true`/`false` pins it. |
169
170
  | `webAccess` | `boolean` | `null` | Whether the chat's answers may reach the open web (Claude `web_fetch`, OpenAI `web_search`). The project's own **Web access for answers** switch on its Project Settings page (the `web_access` key of the project's `bq::settings` record, **off** unless the owner turned it on) is the **ceiling**, and this option may only restrict below it: `effective = projectSetting && webAccess !== false`. `null` or `true` follows the project; `false` turns the web off for this page whatever the project says; a value above the project setting has no effect. With the web off, answers come only from the project's files and database. Indexing is not affected. |
170
171
  | `skipDuplicateFiles` | `boolean` | `null` | Whether a chat attachment the signed-in user **already uploaded** to this project (same stored file name, same size in bytes, same uploader, found from the file's `src::` record, and a stored copy that finished indexing or is still being indexed) is skipped: it is neither uploaded nor indexed again, the chip reads "already uploaded", and the message uses the stored copy's url. The project's **Skip duplicate files** setting (the `skip_duplicate_files` key of `bq::settings`, **on** unless the owner turned it off) is the **ceiling**, and this option may only restrict below it: `effective = projectSetting && skipDuplicateFiles !== false`. `null` or `true` follows the project; `false` lets this page re-upload duplicates; a value above the project setting has no effect. A stored copy whose indexing failed or was cancelled is not a duplicate, so the file uploads as usual. The check never blocks an upload: a failed lookup, or one slower than 15 seconds, uploads as usual. |
171
- | `reuseMcpToolList` | `boolean` | `false` | OpenAI chat turns only: reuse the MCP tool listing OpenAI returned on an earlier turn of this page, so OpenAI does not fetch it again (about 0.6 s per turn). Off unless `true`. Each reused turn's request and stored history row is about 31 to 34 KB larger. See `reuseMcpToolList` under `configureChatEngine`. |
172
+ | `reuseMcpToolList` | `boolean` | `true` | OpenAI chat turns only: reuse the MCP tool listing OpenAI returned on an earlier turn of this page, so OpenAI does not fetch it again (about 0.6 s per turn). On unless `false`. Each reused turn's request and stored history row is about 31 to 34 KB larger. See `reuseMcpToolList` under `configureChatEngine`. |
172
173
  | `liveStreaming` | `boolean` | `false` | Deliver the streamed reply over skapi's websocket as well as the poll, so each piece lands the moment the server relays it instead of on the next one-second poll tick. Streaming itself is not an option: the widget streams every reply whenever the page's `skapi-js` can carry skapi's half of the stream flag (it checks for `forwardRequestStream` and `forwardRequestFinalize`), and otherwise warns once and buffers. Off unless you ask for it: skapi's `joinRealtime` **replaces** the connection's group, so for the length of a turn it takes the room out from under whatever else your app uses realtime for. Purely an accelerator; with it off the reply still streams, on the poll's cadence. Before 1.16.0 this key meant "stream at all" and the socket was `liveStreamingRealtime`; that name is now ignored. |
173
174
  | `statusPush` | `boolean` | `false` | Indexing status over skapi's websocket: each indexing pass asks the server for status messages, its poll then reads once a minute while they arrive and at once when one names it, and the chat re-reads its history when the socket reconnects. Off unless you ask for it, because it keeps a websocket open on your page's skapi instance (your own realtime callback never sees these messages). Needs skapi-js 2.5.0 or newer; with an older one it stays off. Purely an accelerator: every status on screen still comes from reading the request. |
174
175
 
@@ -246,6 +247,14 @@ picture** and **reads any text in it (OCR)**. Works on both Claude and OpenAI.
246
247
  Only images referenced in the **most recent** message are inlined (older links
247
248
  may have expired).
248
249
 
250
+ When an image file is indexed, the model transcribes every character at whatever
251
+ angle it sits and reports how the text is turned (`text_rotation`). With the
252
+ 2026-11-25 skapi worker, a photo whose orientation tag or format the AI would
253
+ misread (a sideways phone photo, a `.tif` or `.bmp` scan) goes out as an upright
254
+ converted copy, a photo whose text is still turned gets one second look turned
255
+ upright, and the transcription is stored as the file's page text, so a search for
256
+ a serial or part number finds the photo. This applies to new and re-indexed files.
257
+
249
258
  ### 2. PDFs: text pages as text, the rest as page images
250
259
 
251
260
  `.pdf`
@@ -272,7 +281,7 @@ search it for an exact phrase or number and cite the page.
272
281
 
273
282
  ```
274
283
  .xls .xlsx .xlsm grids: rows stored by the server directly, plus embedded photos
275
- .ods OpenDocument sheets: character windows, plus photos
284
+ .ods OpenDocument sheets: rows stored by the server, like .xlsx
276
285
  .csv .tsv .tab row-bounded windows with absolute row numbers
277
286
  .doc .docx .docm word processor documents
278
287
  .ppt .pptx .pptm slide decks
@@ -305,6 +314,12 @@ one record per row itself, with no model call and no tokens spent on the rows.
305
314
  Word, text and e-mail windows are read in parallel lanes like PDF pages, and a
306
315
  project indexes up to three documents at once.
307
316
 
317
+ A document whose pages are pictures (a scanned `.hwpx`, `.hwp`, `.docx`, `.pptx`,
318
+ `.odt` and so on, with no text or only a title) is read like a scanned PDF: with
319
+ the 2026-11-25 skapi worker, each page-sized picture is shown to the model as a
320
+ page, and its transcription is stored as that page's text. This applies to new and
321
+ re-indexed files.
322
+
308
323
  ### 4. Everything else extractable: inlined as text server-side
309
324
 
310
325
  The skapi proxy downloads the file, extracts its text **server-side**, and
@@ -534,9 +549,10 @@ helpers. See the `.d.ts` shipped with `bunnyquery/engine`.
534
549
  | `poll` | `number?` | Value attached as `poll` on every request. Omit it if your `forwardRequest` already resolves with the final body; pass `0` for the deployed `skapi-js@latest` (needed for the early ack + a manual `.poll()` handle that powers queued-send cancel, the widget's case). |
535
550
  | `attachmentParsers` | `array?` | Client-side attachment parsers, registered at configure time. More can be added later with `registerAttachmentParser()`. See [Attachment parser plugins](#attachment-parser-plugins). |
536
551
  | `windowedIndexing` | `boolean?` | Opt in to **server-driven** windowed indexing for text and grid files (see [file types](#supported-file-types)). Off by default in the engine; the widget passes it as `true`. The deployed skapi workers support it; only leave it off against a self-hosted worker that does not yet strip the `_skapi_window` directive, where it would reach the provider as an unknown body field and fail the call terminally with no retry. |
552
+ | `workerIndexEndings` | `boolean?` | The worker writes the done marker and run status of a single-pass indexing file (an image, or any file not rendered, windowed or paged), and the engine no longer marks such a run "Indexing stopped ... (the page was closed)". The engine always sends the request flag (`index_end` on the file's `_skapi_file_urls` entry; older workers ignore it); this switch only stops the client-side "lost" verdict. Off unless `true`: with a worker that predates it, a page closed mid-pass would leave the run 'working'. bunnyquery.com turns it on. |
537
553
  | `webAccess` | `boolean?` | Whether a chat turn may reach the open web: Claude's `web_fetch` and OpenAI's `web_search` are attached to a chat request only when this resolves to `true`. The project's own `web_access` setting (the `bq::settings` record, read through `configureProjectSettings`; **off** unless the project owner turned it on) is the **ceiling** and this option may only restrict below it: `effective = projectSetting && webAccess !== false`. Leave it out or pass `true` to follow the project; `false` turns the web off for your host; a value above the project setting has no effect. `webAccessEnabled(serviceId)` and `resolveWebAccess(serviceId, override?)` answer the resolved switch (sync from the cache, or awaiting the settings fetch; `override` is a per-call host value that restricts the same way). Indexing passes keep their tools regardless. Pass the same value to `buildChatSystemPrompt({ webAccess })` so the prompt matches the tool list. |
538
554
  | `skipDuplicateFiles` | `boolean?` | Whether an attachment the signed-in user already uploaded to the project (same stored name, same size, same uploader) is skipped by `ChatSession`'s upload path: not uploaded, not indexed, the turn using the stored copy's url. The project's `skip_duplicate_files` setting (**on** unless the owner turned it off) is the **ceiling** and this option may only restrict: `effective = projectSetting && skipDuplicateFiles !== false`. The check runs only when the host implements the optional `findDuplicateUpload(file)` hook; `findDuplicateUpload(skapi, { name, size }, userId, { service?, timeoutMs? })` from the barrel is the ready-made implementation, and bunnyquery.com uses it too: an ends-with `getUniqueId` lookup narrowed to `src::<name>` and `src::.../<name>`, then the first record whose `data.size_bytes` and `user_id` match AND whose stored copy finished indexing (`done::<path>` exists) or is still being indexed (its `run::<path>` record is `working` and started less than `RUN_RECORD_WORKING_STALE_MS`, 6 hours, ago). The match carries `indexing: 'done' | 'running'`. A copy whose indexing failed or was cancelled is not a match. It never throws and answers within `timeoutMs` (default `DUPLICATE_LOOKUP_TIMEOUT_MS`, 15 seconds): a failed or slow lookup answers `null` and the file uploads as usual. `skipDuplicateFilesEnabled(serviceId)` and `resolveSkipDuplicateFiles(serviceId)` answer the resolved switch. |
539
- | `reuseMcpToolList` | `boolean?` | OpenAI chat turns sent by `ChatSession` only: keep the `mcp_list_tools` item a response returned and send it in the next turn's `input`, so OpenAI skips the MCP tool handshake (about 0.6 s). **Off** unless `true`; turn it on after one live OpenAI chat on a dev project has answered with it on. Details and costs under "MCP tool listing reuse" below. |
555
+ | `reuseMcpToolList` | `boolean?` | OpenAI chat turns sent by `ChatSession` only: keep the `mcp_list_tools` item a response returned and send it in the next turn's `input`, so OpenAI skips the MCP tool handshake (about 0.6 s). **Off** unless `true` (the widget and bunnyquery.com turn it on; verified live on an OpenAI project 2026-11-25). Details and costs under "MCP tool listing reuse" below. |
540
556
  | `forwardRequestFinalize` | `function?` | `skapi.forwardRequestFinalize`, bound to your Skapi instance. Stores the version of a streamed turn that history keeps (the engine sends the assembled provider body, so it reads back exactly like a buffered turn) and releases that request's chunks. Without it a streamed turn is never finalized and its row stays empty. Together with `forwardRequestStream` it is what turns streaming on. |
541
557
  | `forwardRequestStream` | `function?` | `skapi.forwardRequestStream`, bound to your Skapi instance. The **second half of the durability guarantee**: a row that settles while no poll is attached (closed tab, discarded background tab, slept device) is never finalized, so its answer stays in the chunk store and its history row is terminal and empty. Given the request id this drains that turn's chunks in one pass; the engine parses them exactly as it parses a live stream and finalizes what it read, so each row is recovered at most once. Without it the engine mints no recovery marker at all, and without the pair the engine does not stream. |
542
558
  | `onLiveStreamUpdate` | `function?` | Observation hook for a streaming turn (`{ serverItemId, ownerKey, phase, text, thinkingText, toolNames, complete, errored }`). The engine already paints the answer text itself, so this is only for affordances it does not decide the presentation of. Never throw from it. |
@@ -575,12 +591,12 @@ Mythos) and only on chat turns, never on indexing passes. The barrel exports
575
591
  `normalizeAnswerMode`, `answerModeFrom`, `projectAnswerMode(serviceId)`,
576
592
  `resolveAnswerMode(serviceId)` and `chatEffortFields(platform, model, mode)`.
577
593
 
578
- **MCP tool listing reuse (OpenAI, off by default).** With `reuseMcpToolList: true` in
594
+ **MCP tool listing reuse (OpenAI, off by default in the engine, on in the widget).** With `reuseMcpToolList: true` in
579
595
  `configureChatEngine`, on an OpenAI chat turn sent by `ChatSession` the engine keeps the
580
596
  `mcp_list_tools` item the response returned and puts it in the next turn's `input`, right
581
597
  after the system message, so OpenAI does not ask the MCP server for its tools again (four
582
- requests, about 0.6 s). Leave it off until one real OpenAI chat on a dev project has
583
- answered with it on. The item is kept in memory only, per exact MCP server URL, signed-in
598
+ requests, about 0.6 s). Verified on a live OpenAI chat on 2026-11-25: the next turn sent only
599
+ `initialize` before its first tool call. The item is kept in memory only, per exact MCP server URL, signed-in
584
600
  or anonymous, project and user; a page reload starts empty. If a turn that carried it
585
601
  fails, the entry is dropped and the turn is not retried (its error shows as usual). An
586
602
  error that names the item turns reuse off for that project in this browser (localStorage);