bunnyquery 1.21.4 → 1.21.12
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 +38 -2
- package/bunnyquery.css +70 -0
- package/bunnyquery.js +660 -29
- package/dist/engine.cjs +636 -13
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.mts +350 -1
- package/dist/engine.d.ts +350 -1
- package/dist/engine.mjs +606 -14
- package/dist/engine.mjs.map +1 -1
- package/package.json +1 -1
- package/src/engine/host.ts +7 -0
- package/src/engine/identical.ts +448 -0
- package/src/engine/index.ts +46 -0
- package/src/engine/indexing_groups.ts +129 -2
- package/src/engine/link_markup.ts +51 -2
- package/src/engine/office.ts +2 -0
- package/src/engine/project_settings.ts +37 -0
- package/src/engine/prompts/chat_system_prompt.ts +14 -1
- package/src/engine/prompts/indexing_system_prompt.ts +1 -1
- package/src/engine/prompts/indexing_user_message.ts +6 -1
- package/src/engine/requests.ts +38 -2
- package/src/engine/session.ts +210 -5
- package/src/engine/time.ts +21 -0
- package/src/widget.css +10 -0
- package/styles/chat.css +60 -0
package/README.md
CHANGED
|
@@ -59,7 +59,9 @@ release-by-release changelog is [HISTORY.md](HISTORY.md).
|
|
|
59
59
|
across as many passes as it takes. A file's passes collapse into a single
|
|
60
60
|
status row in the chat that can be expanded, and stopped: "Stop" cancels every
|
|
61
61
|
queued and running pass at once and ends the continuation chain, and its confirm
|
|
62
|
-
dialog can take every other file being indexed down with it.
|
|
62
|
+
dialog can take every other file being indexed down with it. A file that
|
|
63
|
+
finished indexing says how long it took beside its passes ("11 passes ·
|
|
64
|
+
12 min 5 s"), from its `run::` record's start and finish.
|
|
63
65
|
- **Stop waiting**: a reply that is taking too long can be given up on. The
|
|
64
66
|
"Thinking" bubble carries a small x that cancels the running request on the
|
|
65
67
|
server, marks the question as cancelled, and lets the next message go out
|
|
@@ -398,6 +400,40 @@ knowledge rather than duplicating it. That includes the file's contents list, it
|
|
|
398
400
|
search glossary and everything search has learned about it from people's
|
|
399
401
|
questions and corrections, which the dialog says.
|
|
400
402
|
|
|
403
|
+
### Files with the same content
|
|
404
|
+
|
|
405
|
+
Files whose stored bytes are identical (same md5 and size, same kind of file, whoever
|
|
406
|
+
uploaded them and whatever they are called) share **one index**. The first one is
|
|
407
|
+
indexed as usual and becomes the original; every later one is linked to it on the
|
|
408
|
+
server in a second or two, with no AI call, and search, outlines and totals count the
|
|
409
|
+
content once. The project's **Share one index for identical files** setting (the
|
|
410
|
+
`share_identical_files` key of `bq::settings`, **on** unless the owner turned it off)
|
|
411
|
+
decides it: while it is on, the engine adds `share_identical: true` to the
|
|
412
|
+
`_skapi_file_urls` entry of every file's FIRST indexing pass (never a continue pass),
|
|
413
|
+
and BunnyQuery's MCP reads the key again before it links anything. There is no
|
|
414
|
+
`init()` option for it.
|
|
415
|
+
|
|
416
|
+
- **In the chat** a linked file's row reads "Indexed <file>" with "Same content as
|
|
417
|
+
<original>: linked in 1.2 s, no AI used" in place of the pass count. When the model
|
|
418
|
+
cites it, it cites the original and says the copy is the same file.
|
|
419
|
+
- **A copy only links to a file at least as open as itself** (private to the same
|
|
420
|
+
uploader's private files, authorized or public; authorized to authorized or public;
|
|
421
|
+
public to public), so a link never points a reader at rows they could not read, and
|
|
422
|
+
the server answers a reader who cannot read the original as having no index rather
|
|
423
|
+
than naming it.
|
|
424
|
+
- **Overwriting an original** sends its copies to indexing again: the oldest becomes
|
|
425
|
+
the new original (one real AI run) and the others link to it. A copy overwritten with
|
|
426
|
+
different bytes simply gets its own index. Only the copies the overwriting user may
|
|
427
|
+
re-index are sent (their own uploads; every copy for the project owner). Another
|
|
428
|
+
user's copy keeps its link, the server answers it as having no index once the
|
|
429
|
+
original holds other content (never the new content), and the Files page shows it
|
|
430
|
+
red with a Reindex.
|
|
431
|
+
|
|
432
|
+
The engine's `identical.ts` exports what both clients use: `copyStatusOf` (a copy's
|
|
433
|
+
"Indexed via", "Waiting for", "Original removed or failed" state from its markers and
|
|
434
|
+
the live claim ids), `listLinkedCopies`, `listContentClaims`, `copiesToPromote` (with `promotableCopies`),
|
|
435
|
+
`indexGroupLinkedLabel`, and the owner's `findIdenticalFiles` / `linkIdenticalFile`.
|
|
436
|
+
|
|
401
437
|
### Filenames
|
|
402
438
|
|
|
403
439
|
Storage keys preserve Unicode letters, digits and spaces, NFC-normalized, so
|
|
@@ -693,7 +729,7 @@ page waits for a second look, and puts the answer in `state.indexQueues[projectI
|
|
|
693
729
|
## OAuth & redirects
|
|
694
730
|
|
|
695
731
|
BunnyQuery connects to your AI agent through an MCP OAuth server
|
|
696
|
-
(`mcp.skapi.com` in production, `mcp
|
|
732
|
+
(`mcp.skapi.com` in production, `mcp.broadwayinc.computer` when
|
|
697
733
|
`dev: true`). After authorization, the OAuth server redirects back to **the current
|
|
698
734
|
host page**: BunnyQuery reads the `?code=…&state=…` parameters, completes the
|
|
699
735
|
exchange, and cleans them from the URL automatically. No dedicated callback page is
|
package/bunnyquery.css
CHANGED
|
@@ -993,6 +993,16 @@
|
|
|
993
993
|
font-size: 0.75rem;
|
|
994
994
|
line-height: 1.3;
|
|
995
995
|
}
|
|
996
|
+
/* Informational, not an error: what the user just cancelled (uploads). Muted
|
|
997
|
+
ink on the paper, the chip row's own neutral look; the x dismisses it. */
|
|
998
|
+
.bq-attachment-warning.is-notice {
|
|
999
|
+
align-items: center;
|
|
1000
|
+
border-color: var(--bq-line);
|
|
1001
|
+
background: var(--bq-paper);
|
|
1002
|
+
color: var(--bq-muted);
|
|
1003
|
+
}
|
|
1004
|
+
.bq-attachment-warning.is-notice > span { flex: 1 1 auto; min-width: 0; }
|
|
1005
|
+
.bq-attachment-warning.is-notice .bq-attachment-remove { flex: none; margin-left: 0; }
|
|
996
1006
|
|
|
997
1007
|
/* ============================================================================
|
|
998
1008
|
* MODALS (appended to <body> under .bq-modal-root)
|
|
@@ -1564,6 +1574,28 @@
|
|
|
1564
1574
|
in a block <p>. Inline it so the row stays one line high. */
|
|
1565
1575
|
.bq-index-label .bq-md,
|
|
1566
1576
|
.bq-index-label .bq-md p { display: inline; margin: 0; }
|
|
1577
|
+
/* A row whose file name is a fitted chip (renderInlineLinkHtml fitLabel) lays
|
|
1578
|
+
the label out as a flex line instead: the verb keeps its width and the chip
|
|
1579
|
+
takes whatever is left, so the name shows in full when the row has room and is
|
|
1580
|
+
cut to the row (stem ellipsis, end of the name and extension kept) only when it
|
|
1581
|
+
does not. The counts and the Stop button are siblings of .bq-index-label and
|
|
1582
|
+
never shrink, so a narrow screen cuts the name, not them. A label with no chip
|
|
1583
|
+
(a file without a stored path) keeps the inline layout and the label's own
|
|
1584
|
+
ellipsis above. */
|
|
1585
|
+
.bq-index-label .bq-md:has(.bq-link-fit),
|
|
1586
|
+
.bq-index-label .bq-md:has(.bq-link-fit) > p {
|
|
1587
|
+
display: flex;
|
|
1588
|
+
align-items: baseline;
|
|
1589
|
+
min-width: 0;
|
|
1590
|
+
column-gap: 0.35em;
|
|
1591
|
+
/* The bubble's break-anywhere wrapping would let the verb ("Indexed") give
|
|
1592
|
+
up its width a letter at a time before the name shrinks. Only the name's
|
|
1593
|
+
stem may give way. */
|
|
1594
|
+
white-space: nowrap;
|
|
1595
|
+
overflow-wrap: normal;
|
|
1596
|
+
word-break: normal;
|
|
1597
|
+
}
|
|
1598
|
+
.bq-index-label .bq-md:has(.bq-link-fit) > p { flex: 1 1 auto; }
|
|
1567
1599
|
/* Passes LOADED, never a server-side total: history pages newest-first, so any
|
|
1568
1600
|
total derived from what is on screen is a lower bound. */
|
|
1569
1601
|
.bq-index-count { flex: 0 0 auto; opacity: 0.75; font-size: 0.72rem; }
|
|
@@ -1712,6 +1744,44 @@
|
|
|
1712
1744
|
.bq-md a.bq-link-button { text-decoration: none; }
|
|
1713
1745
|
.bq-md a.bq-link-button:hover { text-decoration: underline; }
|
|
1714
1746
|
.bq-md a.bq-link-button.is-unavailable:hover { text-decoration: none; }
|
|
1747
|
+
/* A fitted chip (renderInlineLinkHtml fitLabel): the full name as a stem that
|
|
1748
|
+
ellipsizes and a tail (end of the name + extension) that never shrinks. Flex
|
|
1749
|
+
items are not atomic inlines, so an underline on the anchor would run under the
|
|
1750
|
+
glyph too; the hover underline goes on the two name parts instead. */
|
|
1751
|
+
.bq-link-button.bq-link-fit {
|
|
1752
|
+
display: inline-flex;
|
|
1753
|
+
align-items: baseline;
|
|
1754
|
+
flex: 0 1 auto;
|
|
1755
|
+
min-width: 0;
|
|
1756
|
+
max-width: 100%;
|
|
1757
|
+
overflow: hidden;
|
|
1758
|
+
}
|
|
1759
|
+
.bq-link-fit .bq-link-glyph { flex: none; }
|
|
1760
|
+
.bq-link-fit .bq-link-stem {
|
|
1761
|
+
flex: 0 1 auto;
|
|
1762
|
+
min-width: 0;
|
|
1763
|
+
overflow: hidden;
|
|
1764
|
+
text-overflow: ellipsis;
|
|
1765
|
+
white-space: pre;
|
|
1766
|
+
}
|
|
1767
|
+
/* The tail never shrinks while there is stem left to cut. Only a row too narrow
|
|
1768
|
+
for even the end of the name caps it (the chip's width less the glyph), and
|
|
1769
|
+
then with an ellipsis instead of a hard clip. A max-width, not a small
|
|
1770
|
+
flex-shrink: any shrink at all takes a fraction of a pixel off the tail and
|
|
1771
|
+
puts an ellipsis on a name that fits. */
|
|
1772
|
+
.bq-link-fit .bq-link-tail {
|
|
1773
|
+
flex: none;
|
|
1774
|
+
max-width: calc(100% - 1.2em);
|
|
1775
|
+
overflow: hidden;
|
|
1776
|
+
text-overflow: ellipsis;
|
|
1777
|
+
white-space: pre;
|
|
1778
|
+
}
|
|
1779
|
+
.bq-link-button.bq-link-fit:hover,
|
|
1780
|
+
.bq-md a.bq-link-button.bq-link-fit:hover { text-decoration: none; }
|
|
1781
|
+
.bq-link-button.bq-link-fit:hover .bq-link-stem,
|
|
1782
|
+
.bq-link-button.bq-link-fit:hover .bq-link-tail { text-decoration: underline; }
|
|
1783
|
+
.bq-link-button.bq-link-fit.is-unavailable:hover .bq-link-stem,
|
|
1784
|
+
.bq-link-button.bq-link-fit.is-unavailable:hover .bq-link-tail { text-decoration: none; }
|
|
1715
1785
|
/* The ↗ / ✕ glyph is never underlined, at rest or on hover. Underlines propagate
|
|
1716
1786
|
into every in-flow inline descendant and a descendant cannot cancel them, so
|
|
1717
1787
|
`text-decoration: none` on the glyph alone does nothing; an atomic inline
|