bunnyquery 1.10.0 → 1.10.2
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/bunnyquery.css +20 -0
- package/bunnyquery.js +40 -7
- package/dist/engine.cjs +38 -4
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.mts +18 -12
- package/dist/engine.d.ts +18 -12
- package/dist/engine.mjs +38 -4
- package/dist/engine.mjs.map +1 -1
- package/package.json +1 -1
- package/src/engine/indexing_groups.ts +86 -7
- package/src/engine/link_markup.ts +11 -4
- package/styles/chat.css +20 -0
package/bunnyquery.css
CHANGED
|
@@ -1520,6 +1520,26 @@
|
|
|
1520
1520
|
text-decoration: none;
|
|
1521
1521
|
cursor: default;
|
|
1522
1522
|
}
|
|
1523
|
+
/* An assistant bubble's chips are emitted by renderInlineLinkHtml INSIDE the
|
|
1524
|
+
v-html `.bq-md` block, where `.bq-md a` below (underline at rest, none on
|
|
1525
|
+
hover -- the prose-link convention) is (0,1,1) and outranks .bq-link-button
|
|
1526
|
+
at (0,1,0). So those chips rendered the exact inverse of the rule above:
|
|
1527
|
+
underlined at rest, underline gone under the pointer, while the same chip on
|
|
1528
|
+
a user bubble (outside .bq-md) behaved. Restate the chip rule at a
|
|
1529
|
+
specificity that wins inside .bq-md, the dead chip included. */
|
|
1530
|
+
.bq-md a.bq-link-button { text-decoration: none; }
|
|
1531
|
+
.bq-md a.bq-link-button:hover { text-decoration: underline; }
|
|
1532
|
+
.bq-md a.bq-link-button.is-unavailable:hover { text-decoration: none; }
|
|
1533
|
+
/* The ↗ / ✕ glyph is never underlined, at rest or on hover. Underlines propagate
|
|
1534
|
+
into every in-flow inline descendant and a descendant cannot cancel them, so
|
|
1535
|
+
`text-decoration: none` on the glyph alone does nothing; an atomic inline
|
|
1536
|
+
(inline-block) is exempt, and the spacing is a margin so no decorated space
|
|
1537
|
+
character carries the line up to the glyph. */
|
|
1538
|
+
.bq-link-glyph {
|
|
1539
|
+
display: inline-block;
|
|
1540
|
+
text-decoration: none;
|
|
1541
|
+
margin-right: 0.3em;
|
|
1542
|
+
}
|
|
1523
1543
|
|
|
1524
1544
|
/* ---- inline image previews ----------------------------------------------*/
|
|
1525
1545
|
/* The anchor IS the preview: picture on top, the ordinary chip underneath as a
|
package/bunnyquery.js
CHANGED
|
@@ -1330,7 +1330,8 @@ Index the REMAINING windows - one record per row/item, looking at any page image
|
|
|
1330
1330
|
if (refreshing) cls.push("is-refreshing");
|
|
1331
1331
|
if (unavailable) cls.push("is-unavailable");
|
|
1332
1332
|
if (preview) cls.push("is-image-preview");
|
|
1333
|
-
var
|
|
1333
|
+
var glyphHtml = '<span class="bq-link-glyph" translate="no">' + (unavailable ? INLINE_LINK_UNAVAILABLE_GLYPH : INLINE_LINK_GLYPH) + "</span>";
|
|
1334
|
+
var labelHtml = glyphHtml + escapeInlineHtml(link.label + (unavailable ? INLINE_LINK_UNAVAILABLE_SUFFIX : refreshing ? " (fetching...)" : ""));
|
|
1334
1335
|
var attrs = ['class="' + cls.join(" ") + '"'];
|
|
1335
1336
|
if (unavailable) attrs.push('aria-disabled="true"', 'data-bq-unavailable="1"');
|
|
1336
1337
|
else attrs.push('href="' + escapeInlineHtml(link.href) + '"', 'target="_blank"', 'rel="noopener noreferrer"');
|
|
@@ -1341,8 +1342,8 @@ Index the REMAINING windows - one record per row/item, looking at any page image
|
|
|
1341
1342
|
if (link.expiredHref) attrs.push('data-bq-expired-href="' + escapeInlineHtml(link.expiredHref) + '"');
|
|
1342
1343
|
if (link.remotePath) attrs.push('data-bq-remote-path="' + escapeInlineHtml(link.remotePath) + '"');
|
|
1343
1344
|
if (link.fullLabel) attrs.push('data-bq-full-label="' + escapeInlineHtml(link.fullLabel) + '"');
|
|
1344
|
-
if (!preview) return "<a " + attrs.join(" ") + ">" +
|
|
1345
|
-
return "<a " + attrs.join(" ") + '><img class="bq-img-preview" alt="' + escapeInlineHtml(full) + '" data-bq-img-path="' + escapeInlineHtml(link.remotePath || "") + '" data-bq-img-type="' + escapeInlineHtml(link.image ? link.image.contentType : "") + '" decoding="async"><span class="bq-loader" data-bq-img-loader="1"></span><span class="bq-img-preview-caption" translate="no">' +
|
|
1345
|
+
if (!preview) return "<a " + attrs.join(" ") + ">" + labelHtml + "</a>";
|
|
1346
|
+
return "<a " + attrs.join(" ") + '><img class="bq-img-preview" alt="' + escapeInlineHtml(full) + '" data-bq-img-path="' + escapeInlineHtml(link.remotePath || "") + '" data-bq-img-type="' + escapeInlineHtml(link.image ? link.image.contentType : "") + '" decoding="async"><span class="bq-loader" data-bq-img-loader="1"></span><span class="bq-img-preview-caption" translate="no">' + labelHtml + "</span></a>";
|
|
1346
1347
|
}
|
|
1347
1348
|
|
|
1348
1349
|
// src/engine/image_preview.ts
|
|
@@ -7776,6 +7777,29 @@ Index the REMAINING windows - one record per row/item, looking at any page image
|
|
|
7776
7777
|
}
|
|
7777
7778
|
return !!m.isPending;
|
|
7778
7779
|
}
|
|
7780
|
+
function overlayRunRecordVerdict(grp, rec, liveIndexKeys) {
|
|
7781
|
+
if (!grp.members.length || grp.status === "active" || grp.cancelling) return;
|
|
7782
|
+
if (rec.status === "working" || typeof rec.started !== "number") return;
|
|
7783
|
+
if (liveIndexKeys[grp.key] || liveIndexKeys[canonIndexKey(grp.key)]) return;
|
|
7784
|
+
var firstTs = grp.members[0].msg._ts;
|
|
7785
|
+
var lastTs = grp.members[grp.members.length - 1].msg._ts;
|
|
7786
|
+
if (typeof lastTs !== "number" || typeof firstTs !== "number") return;
|
|
7787
|
+
if (rec.started > lastTs) return;
|
|
7788
|
+
var when = typeof rec.finished === "number" ? rec.finished : void 0;
|
|
7789
|
+
if (when === void 0) return;
|
|
7790
|
+
if (when < firstTs) return;
|
|
7791
|
+
if (when < lastTs - 5e3) return;
|
|
7792
|
+
if (rec.status === "error" || rec.status === "cancelled") {
|
|
7793
|
+
grp.status = rec.status;
|
|
7794
|
+
} else if (rec.status === "done") {
|
|
7795
|
+
grp.status = "done";
|
|
7796
|
+
} else {
|
|
7797
|
+
return;
|
|
7798
|
+
}
|
|
7799
|
+
grp.finished = true;
|
|
7800
|
+
grp.resolving = false;
|
|
7801
|
+
grp.resolvingReason = void 0;
|
|
7802
|
+
}
|
|
7779
7803
|
function buildChatDisplayList(messages, opts) {
|
|
7780
7804
|
var list = Array.isArray(messages) ? messages : [];
|
|
7781
7805
|
var liveIndexKeys = opts && opts.liveIndexKeys || {};
|
|
@@ -7983,6 +8007,15 @@ Index the REMAINING windows - one record per row/item, looking at any page image
|
|
|
7983
8007
|
grp.resolving = false;
|
|
7984
8008
|
}
|
|
7985
8009
|
}
|
|
8010
|
+
var superseded = {};
|
|
8011
|
+
for (var sk in runsOfKey) {
|
|
8012
|
+
var srs = runsOfKey[sk];
|
|
8013
|
+
for (var sri = 0; sri < srs.length - 1; sri++) {
|
|
8014
|
+
var sgp = groups[srs[sri]];
|
|
8015
|
+
if (!sgp || sgp.status === "active" || sgp.cancelling) continue;
|
|
8016
|
+
superseded[srs[sri]] = true;
|
|
8017
|
+
}
|
|
8018
|
+
}
|
|
7986
8019
|
var stubList = [];
|
|
7987
8020
|
var runStubs = opts && opts.runStubs;
|
|
7988
8021
|
if (runStubs) {
|
|
@@ -8091,6 +8124,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
|
|
|
8091
8124
|
suppressAnchor[order[ti2]] = true;
|
|
8092
8125
|
tg.runKey = "run:" + (tg.path || tg.key) + "#" + trec.started;
|
|
8093
8126
|
stubList.push({ started: trec.started, group: tg });
|
|
8127
|
+
overlayRunRecordVerdict(tg, trec, liveIndexKeys);
|
|
8094
8128
|
}
|
|
8095
8129
|
}
|
|
8096
8130
|
stubList.sort(function(a, b) {
|
|
@@ -8111,7 +8145,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
|
|
|
8111
8145
|
out.push({ kind: "message", msg: list[j], index: j });
|
|
8112
8146
|
continue;
|
|
8113
8147
|
}
|
|
8114
|
-
if (groups[r].anchorIndex === j && !suppressAnchor[r]) {
|
|
8148
|
+
if (groups[r].anchorIndex === j && !suppressAnchor[r] && !superseded[r]) {
|
|
8115
8149
|
out.push({ kind: "indexing", group: groups[r], index: j });
|
|
8116
8150
|
}
|
|
8117
8151
|
}
|
|
@@ -8205,7 +8239,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
|
|
|
8205
8239
|
(function() {
|
|
8206
8240
|
var MCP_PROD = "https://mcp.broadwayinc.computer";
|
|
8207
8241
|
var MCP_DEV = "https://mcp-dev.broadwayinc.computer";
|
|
8208
|
-
var BQ_VERSION = "1.10.
|
|
8242
|
+
var BQ_VERSION = "1.10.2" ;
|
|
8209
8243
|
var ATTACHMENT_URL_EXPIRES_SECONDS = 600;
|
|
8210
8244
|
var GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
|
|
8211
8245
|
var GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
|
|
@@ -10299,8 +10333,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
|
|
|
10299
10333
|
return href;
|
|
10300
10334
|
}
|
|
10301
10335
|
function fileToAnchorHtml(filename, href) {
|
|
10302
|
-
|
|
10303
|
-
return '<a class="bq-file-download" href="' + escapeHtml(href) + '" download="' + escapeHtml(filename) + '" target="_blank" rel="noopener noreferrer">' + escapeHtml(text) + "</a>";
|
|
10336
|
+
return '<a class="bq-file-download" href="' + escapeHtml(href) + '" download="' + escapeHtml(filename) + '" target="_blank" rel="noopener noreferrer"><span class="bq-link-glyph" translate="no">\u2197</span>' + escapeHtml(filename) + "</a>";
|
|
10304
10337
|
}
|
|
10305
10338
|
function linkToAnchorHtml(link, allowImagePreview) {
|
|
10306
10339
|
return renderInlineLinkHtml(link, {
|
package/dist/engine.cjs
CHANGED
|
@@ -1398,7 +1398,8 @@ function renderInlineLinkHtml(link, opts) {
|
|
|
1398
1398
|
if (refreshing) cls.push("is-refreshing");
|
|
1399
1399
|
if (unavailable) cls.push("is-unavailable");
|
|
1400
1400
|
if (preview) cls.push("is-image-preview");
|
|
1401
|
-
var
|
|
1401
|
+
var glyphHtml = '<span class="bq-link-glyph" translate="no">' + (unavailable ? INLINE_LINK_UNAVAILABLE_GLYPH : INLINE_LINK_GLYPH) + "</span>";
|
|
1402
|
+
var labelHtml = glyphHtml + escapeInlineHtml(link.label + (unavailable ? INLINE_LINK_UNAVAILABLE_SUFFIX : refreshing ? " (fetching...)" : ""));
|
|
1402
1403
|
var attrs = ['class="' + cls.join(" ") + '"'];
|
|
1403
1404
|
if (unavailable) attrs.push('aria-disabled="true"', 'data-bq-unavailable="1"');
|
|
1404
1405
|
else attrs.push('href="' + escapeInlineHtml(link.href) + '"', 'target="_blank"', 'rel="noopener noreferrer"');
|
|
@@ -1409,8 +1410,8 @@ function renderInlineLinkHtml(link, opts) {
|
|
|
1409
1410
|
if (link.expiredHref) attrs.push('data-bq-expired-href="' + escapeInlineHtml(link.expiredHref) + '"');
|
|
1410
1411
|
if (link.remotePath) attrs.push('data-bq-remote-path="' + escapeInlineHtml(link.remotePath) + '"');
|
|
1411
1412
|
if (link.fullLabel) attrs.push('data-bq-full-label="' + escapeInlineHtml(link.fullLabel) + '"');
|
|
1412
|
-
if (!preview) return "<a " + attrs.join(" ") + ">" +
|
|
1413
|
-
return "<a " + attrs.join(" ") + '><img class="bq-img-preview" alt="' + escapeInlineHtml(full) + '" data-bq-img-path="' + escapeInlineHtml(link.remotePath || "") + '" data-bq-img-type="' + escapeInlineHtml(link.image ? link.image.contentType : "") + '" decoding="async"><span class="bq-loader" data-bq-img-loader="1"></span><span class="bq-img-preview-caption" translate="no">' +
|
|
1413
|
+
if (!preview) return "<a " + attrs.join(" ") + ">" + labelHtml + "</a>";
|
|
1414
|
+
return "<a " + attrs.join(" ") + '><img class="bq-img-preview" alt="' + escapeInlineHtml(full) + '" data-bq-img-path="' + escapeInlineHtml(link.remotePath || "") + '" data-bq-img-type="' + escapeInlineHtml(link.image ? link.image.contentType : "") + '" decoding="async"><span class="bq-loader" data-bq-img-loader="1"></span><span class="bq-img-preview-caption" translate="no">' + labelHtml + "</span></a>";
|
|
1414
1415
|
}
|
|
1415
1416
|
|
|
1416
1417
|
// src/engine/image_preview.ts
|
|
@@ -7920,6 +7921,29 @@ function isHiddenPass(m) {
|
|
|
7920
7921
|
}
|
|
7921
7922
|
return !!m.isPending;
|
|
7922
7923
|
}
|
|
7924
|
+
function overlayRunRecordVerdict(grp, rec, liveIndexKeys) {
|
|
7925
|
+
if (!grp.members.length || grp.status === "active" || grp.cancelling) return;
|
|
7926
|
+
if (rec.status === "working" || typeof rec.started !== "number") return;
|
|
7927
|
+
if (liveIndexKeys[grp.key] || liveIndexKeys[canonIndexKey(grp.key)]) return;
|
|
7928
|
+
var firstTs = grp.members[0].msg._ts;
|
|
7929
|
+
var lastTs = grp.members[grp.members.length - 1].msg._ts;
|
|
7930
|
+
if (typeof lastTs !== "number" || typeof firstTs !== "number") return;
|
|
7931
|
+
if (rec.started > lastTs) return;
|
|
7932
|
+
var when = typeof rec.finished === "number" ? rec.finished : void 0;
|
|
7933
|
+
if (when === void 0) return;
|
|
7934
|
+
if (when < firstTs) return;
|
|
7935
|
+
if (when < lastTs - 5e3) return;
|
|
7936
|
+
if (rec.status === "error" || rec.status === "cancelled") {
|
|
7937
|
+
grp.status = rec.status;
|
|
7938
|
+
} else if (rec.status === "done") {
|
|
7939
|
+
grp.status = "done";
|
|
7940
|
+
} else {
|
|
7941
|
+
return;
|
|
7942
|
+
}
|
|
7943
|
+
grp.finished = true;
|
|
7944
|
+
grp.resolving = false;
|
|
7945
|
+
grp.resolvingReason = void 0;
|
|
7946
|
+
}
|
|
7923
7947
|
function buildChatDisplayList(messages, opts) {
|
|
7924
7948
|
var list = Array.isArray(messages) ? messages : [];
|
|
7925
7949
|
var liveIndexKeys = opts && opts.liveIndexKeys || {};
|
|
@@ -8127,6 +8151,15 @@ function buildChatDisplayList(messages, opts) {
|
|
|
8127
8151
|
grp.resolving = false;
|
|
8128
8152
|
}
|
|
8129
8153
|
}
|
|
8154
|
+
var superseded = {};
|
|
8155
|
+
for (var sk in runsOfKey) {
|
|
8156
|
+
var srs = runsOfKey[sk];
|
|
8157
|
+
for (var sri = 0; sri < srs.length - 1; sri++) {
|
|
8158
|
+
var sgp = groups[srs[sri]];
|
|
8159
|
+
if (!sgp || sgp.status === "active" || sgp.cancelling) continue;
|
|
8160
|
+
superseded[srs[sri]] = true;
|
|
8161
|
+
}
|
|
8162
|
+
}
|
|
8130
8163
|
var stubList = [];
|
|
8131
8164
|
var runStubs = opts && opts.runStubs;
|
|
8132
8165
|
if (runStubs) {
|
|
@@ -8235,6 +8268,7 @@ function buildChatDisplayList(messages, opts) {
|
|
|
8235
8268
|
suppressAnchor[order[ti2]] = true;
|
|
8236
8269
|
tg.runKey = "run:" + (tg.path || tg.key) + "#" + trec.started;
|
|
8237
8270
|
stubList.push({ started: trec.started, group: tg });
|
|
8271
|
+
overlayRunRecordVerdict(tg, trec, liveIndexKeys);
|
|
8238
8272
|
}
|
|
8239
8273
|
}
|
|
8240
8274
|
stubList.sort(function(a, b) {
|
|
@@ -8255,7 +8289,7 @@ function buildChatDisplayList(messages, opts) {
|
|
|
8255
8289
|
out.push({ kind: "message", msg: list[j], index: j });
|
|
8256
8290
|
continue;
|
|
8257
8291
|
}
|
|
8258
|
-
if (groups[r].anchorIndex === j && !suppressAnchor[r]) {
|
|
8292
|
+
if (groups[r].anchorIndex === j && !suppressAnchor[r] && !superseded[r]) {
|
|
8259
8293
|
out.push({ kind: "indexing", group: groups[r], index: j });
|
|
8260
8294
|
}
|
|
8261
8295
|
}
|