bunnyquery 1.10.0 → 1.10.1

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.js CHANGED
@@ -7776,6 +7776,29 @@ Index the REMAINING windows - one record per row/item, looking at any page image
7776
7776
  }
7777
7777
  return !!m.isPending;
7778
7778
  }
7779
+ function overlayRunRecordVerdict(grp, rec, liveIndexKeys) {
7780
+ if (!grp.members.length || grp.status === "active" || grp.cancelling) return;
7781
+ if (rec.status === "working" || typeof rec.started !== "number") return;
7782
+ if (liveIndexKeys[grp.key] || liveIndexKeys[canonIndexKey(grp.key)]) return;
7783
+ var firstTs = grp.members[0].msg._ts;
7784
+ var lastTs = grp.members[grp.members.length - 1].msg._ts;
7785
+ if (typeof lastTs !== "number" || typeof firstTs !== "number") return;
7786
+ if (rec.started > lastTs) return;
7787
+ var when = typeof rec.finished === "number" ? rec.finished : void 0;
7788
+ if (when === void 0) return;
7789
+ if (when < firstTs) return;
7790
+ if (when < lastTs - 5e3) return;
7791
+ if (rec.status === "error" || rec.status === "cancelled") {
7792
+ grp.status = rec.status;
7793
+ } else if (rec.status === "done") {
7794
+ grp.status = "done";
7795
+ } else {
7796
+ return;
7797
+ }
7798
+ grp.finished = true;
7799
+ grp.resolving = false;
7800
+ grp.resolvingReason = void 0;
7801
+ }
7779
7802
  function buildChatDisplayList(messages, opts) {
7780
7803
  var list = Array.isArray(messages) ? messages : [];
7781
7804
  var liveIndexKeys = opts && opts.liveIndexKeys || {};
@@ -7983,6 +8006,15 @@ Index the REMAINING windows - one record per row/item, looking at any page image
7983
8006
  grp.resolving = false;
7984
8007
  }
7985
8008
  }
8009
+ var superseded = {};
8010
+ for (var sk in runsOfKey) {
8011
+ var srs = runsOfKey[sk];
8012
+ for (var sri = 0; sri < srs.length - 1; sri++) {
8013
+ var sgp = groups[srs[sri]];
8014
+ if (!sgp || sgp.status === "active" || sgp.cancelling) continue;
8015
+ superseded[srs[sri]] = true;
8016
+ }
8017
+ }
7986
8018
  var stubList = [];
7987
8019
  var runStubs = opts && opts.runStubs;
7988
8020
  if (runStubs) {
@@ -8091,6 +8123,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
8091
8123
  suppressAnchor[order[ti2]] = true;
8092
8124
  tg.runKey = "run:" + (tg.path || tg.key) + "#" + trec.started;
8093
8125
  stubList.push({ started: trec.started, group: tg });
8126
+ overlayRunRecordVerdict(tg, trec, liveIndexKeys);
8094
8127
  }
8095
8128
  }
8096
8129
  stubList.sort(function(a, b) {
@@ -8111,7 +8144,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
8111
8144
  out.push({ kind: "message", msg: list[j], index: j });
8112
8145
  continue;
8113
8146
  }
8114
- if (groups[r].anchorIndex === j && !suppressAnchor[r]) {
8147
+ if (groups[r].anchorIndex === j && !suppressAnchor[r] && !superseded[r]) {
8115
8148
  out.push({ kind: "indexing", group: groups[r], index: j });
8116
8149
  }
8117
8150
  }
@@ -8205,7 +8238,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
8205
8238
  (function() {
8206
8239
  var MCP_PROD = "https://mcp.broadwayinc.computer";
8207
8240
  var MCP_DEV = "https://mcp-dev.broadwayinc.computer";
8208
- var BQ_VERSION = "1.10.0" ;
8241
+ var BQ_VERSION = "1.10.1" ;
8209
8242
  var ATTACHMENT_URL_EXPIRES_SECONDS = 600;
8210
8243
  var GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
8211
8244
  var GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
package/dist/engine.cjs CHANGED
@@ -7920,6 +7920,29 @@ function isHiddenPass(m) {
7920
7920
  }
7921
7921
  return !!m.isPending;
7922
7922
  }
7923
+ function overlayRunRecordVerdict(grp, rec, liveIndexKeys) {
7924
+ if (!grp.members.length || grp.status === "active" || grp.cancelling) return;
7925
+ if (rec.status === "working" || typeof rec.started !== "number") return;
7926
+ if (liveIndexKeys[grp.key] || liveIndexKeys[canonIndexKey(grp.key)]) return;
7927
+ var firstTs = grp.members[0].msg._ts;
7928
+ var lastTs = grp.members[grp.members.length - 1].msg._ts;
7929
+ if (typeof lastTs !== "number" || typeof firstTs !== "number") return;
7930
+ if (rec.started > lastTs) return;
7931
+ var when = typeof rec.finished === "number" ? rec.finished : void 0;
7932
+ if (when === void 0) return;
7933
+ if (when < firstTs) return;
7934
+ if (when < lastTs - 5e3) return;
7935
+ if (rec.status === "error" || rec.status === "cancelled") {
7936
+ grp.status = rec.status;
7937
+ } else if (rec.status === "done") {
7938
+ grp.status = "done";
7939
+ } else {
7940
+ return;
7941
+ }
7942
+ grp.finished = true;
7943
+ grp.resolving = false;
7944
+ grp.resolvingReason = void 0;
7945
+ }
7923
7946
  function buildChatDisplayList(messages, opts) {
7924
7947
  var list = Array.isArray(messages) ? messages : [];
7925
7948
  var liveIndexKeys = opts && opts.liveIndexKeys || {};
@@ -8127,6 +8150,15 @@ function buildChatDisplayList(messages, opts) {
8127
8150
  grp.resolving = false;
8128
8151
  }
8129
8152
  }
8153
+ var superseded = {};
8154
+ for (var sk in runsOfKey) {
8155
+ var srs = runsOfKey[sk];
8156
+ for (var sri = 0; sri < srs.length - 1; sri++) {
8157
+ var sgp = groups[srs[sri]];
8158
+ if (!sgp || sgp.status === "active" || sgp.cancelling) continue;
8159
+ superseded[srs[sri]] = true;
8160
+ }
8161
+ }
8130
8162
  var stubList = [];
8131
8163
  var runStubs = opts && opts.runStubs;
8132
8164
  if (runStubs) {
@@ -8235,6 +8267,7 @@ function buildChatDisplayList(messages, opts) {
8235
8267
  suppressAnchor[order[ti2]] = true;
8236
8268
  tg.runKey = "run:" + (tg.path || tg.key) + "#" + trec.started;
8237
8269
  stubList.push({ started: trec.started, group: tg });
8270
+ overlayRunRecordVerdict(tg, trec, liveIndexKeys);
8238
8271
  }
8239
8272
  }
8240
8273
  stubList.sort(function(a, b) {
@@ -8255,7 +8288,7 @@ function buildChatDisplayList(messages, opts) {
8255
8288
  out.push({ kind: "message", msg: list[j], index: j });
8256
8289
  continue;
8257
8290
  }
8258
- if (groups[r].anchorIndex === j && !suppressAnchor[r]) {
8291
+ if (groups[r].anchorIndex === j && !suppressAnchor[r] && !superseded[r]) {
8259
8292
  out.push({ kind: "indexing", group: groups[r], index: j });
8260
8293
  }
8261
8294
  }