bunnyquery 1.19.0 → 1.19.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.css CHANGED
@@ -732,6 +732,21 @@
732
732
  pointer-events: none;
733
733
  opacity: 0.92;
734
734
  }
735
+ /* "Preparing files..." between a drop and its chips (agent.vue / main.less
736
+ .bq-drop-preparing). Swallows clicks on purpose, unlike the drag overlay:
737
+ it sits over controls whose files are still being read. */
738
+ .bq-drop-preparing {
739
+ position: absolute;
740
+ inset: 0;
741
+ z-index: 11;
742
+ display: flex;
743
+ align-items: center;
744
+ justify-content: center;
745
+ background: color-mix(in srgb, var(--bq-paper) 85%, transparent);
746
+ pointer-events: auto;
747
+ cursor: progress;
748
+ user-select: none;
749
+ }
735
750
  .bq-drop-overlay-inner {
736
751
  display: flex;
737
752
  flex-direction: column;
package/bunnyquery.js CHANGED
@@ -2741,12 +2741,38 @@ Index the REMAINING windows - one record per row/item, looking at any page image
2741
2741
  } else if (!grp.finished && grp.driver === "worker" && !liveIndexChecked && !liveIndexKeys[grp.key]) {
2742
2742
  grp.resolving = true;
2743
2743
  grp.resolvingReason = "status";
2744
+ var openRun = opts && opts.runStubs && (grp.path && opts.runStubs[grp.path] || opts.runStubs[grp.key]);
2745
+ var runNow = opts && opts.liveIndexRunningKeys;
2746
+ if (opts && opts.liveIndexRunningChecked && openRun && openRun.status === "working" && runNow && !runNow[grp.key] && !(grp.path && runNow[grp.path]) && !(grp.name && runNow[grp.name])) {
2747
+ grp.resolving = false;
2748
+ grp.resolvingReason = void 0;
2749
+ grp.queued = true;
2750
+ }
2744
2751
  } else {
2745
2752
  grp.resolving = false;
2746
2753
  }
2747
2754
  var runningNow = opts && opts.liveIndexRunningKeys;
2748
- if (runningNow && !grp.finished && !grp.resolving && grp.status === "active" && (liveIndexKeys[grp.key] || grp.path && liveIndexKeys[grp.path]) && !runningNow[grp.key] && !(grp.path && runningNow[grp.path]) && !(grp.name && runningNow[grp.name])) {
2749
- grp.queued = true;
2755
+ if (runningNow && !grp.finished && !grp.resolving && grp.status === "active" && !runningNow[grp.key] && !(grp.path && runningNow[grp.path]) && !(grp.name && runningNow[grp.name])) {
2756
+ var otherRunning = false;
2757
+ if (opts && opts.liveIndexRunningChecked) {
2758
+ for (var rk in runningNow) {
2759
+ if (runningNow[rk] && rk !== grp.key && rk !== grp.path && rk !== grp.name) {
2760
+ otherRunning = true;
2761
+ break;
2762
+ }
2763
+ }
2764
+ }
2765
+ var openRun2 = opts && opts.runStubs && (grp.path && opts.runStubs[grp.path] || opts.runStubs[grp.key]);
2766
+ var waitingOpenRun = !!(opts && opts.liveIndexRunningChecked && openRun2 && openRun2.status === "working");
2767
+ var startedRun = false;
2768
+ for (var mi = 0; mi < grp.members.length; mi++) {
2769
+ var mm = grp.members[mi].msg;
2770
+ if (mm && mm.role === "assistant" && !mm.isPending && !mm.isPendingInProcess && !mm.isPendingQueued) {
2771
+ startedRun = true;
2772
+ break;
2773
+ }
2774
+ }
2775
+ if (!startedRun && (liveIndexKeys[grp.key] || grp.path && liveIndexKeys[grp.path] || otherRunning || waitingOpenRun)) grp.queued = true;
2750
2776
  }
2751
2777
  }
2752
2778
  var superseded = {};
@@ -2773,6 +2799,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
2773
2799
  }
2774
2800
  var now = opts && typeof opts.now === "number" ? opts.now : Date.now();
2775
2801
  var runningKeys = opts && opts.liveIndexRunningKeys;
2802
+ var runningChecked = !!(opts && opts.liveIndexRunningChecked);
2776
2803
  var stubClearedAt = opts && typeof opts.stubClearedAt === "number" && opts.stubClearedAt > 0 ? opts.stubClearedAt : 0;
2777
2804
  for (var sp in runStubs) {
2778
2805
  var rec = runStubs[sp];
@@ -2799,6 +2826,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
2799
2826
  var st = "active";
2800
2827
  var fin = false;
2801
2828
  var res = false;
2829
+ var waitingStub = false;
2802
2830
  var reason;
2803
2831
  if (!live) {
2804
2832
  if (rec.status === "done" || doneKeys[sp] || doneKeys[canonIndexKey(sp)] || doneKeys[fname] || doneKeys[canonIndexKey(fname)]) {
@@ -2816,6 +2844,8 @@ Index the REMAINING windows - one record per row/item, looking at any page image
2816
2844
  } else if (typeof rec.started === "number" && now - rec.started > RUN_RECORD_WORKING_STALE_MS) {
2817
2845
  st = "error";
2818
2846
  fin = true;
2847
+ } else if (runningChecked && rec.status === "working") {
2848
+ waitingStub = true;
2819
2849
  } else {
2820
2850
  res = true;
2821
2851
  reason = "status";
@@ -2849,7 +2879,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
2849
2879
  resolving: res,
2850
2880
  resolvingReason: reason,
2851
2881
  stub: true,
2852
- queued: live && !!runningKeys && !runningKeys[sp] && !runningKeys[canonIndexKey(sp)] && !runningKeys[fname] ? true : void 0,
2882
+ queued: waitingStub || live && !!runningKeys && !runningKeys[sp] && !runningKeys[canonIndexKey(sp)] && !runningKeys[fname] ? true : void 0,
2853
2883
  stubError: rec.error || (st === "error" && !rec.error ? "Indexing did not finish." : void 0)
2854
2884
  };
2855
2885
  stubList.push({ started: typeof rec.started === "number" ? rec.started : Infinity, group: sg });
@@ -5210,6 +5240,8 @@ Index the REMAINING windows - one record per row/item, looking at any page image
5210
5240
  passPaging: {},
5211
5241
  liveIndexChecked: false,
5212
5242
  liveIndexRunning: {},
5243
+ liveIndexRunningChecked: false,
5244
+ liveIndexSettled: {},
5213
5245
  stoppedIndexIds: {}
5214
5246
  };
5215
5247
  this.bgTaskQueue = [];
@@ -5237,7 +5269,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
5237
5269
  * every file the server still has indexing work for; `checked` is false until the
5238
5270
  * first answer for this chat, and false means "we do not know yet". */
5239
5271
  getLiveIndexState() {
5240
- return { keys: this.state.liveIndexKeys, checked: this.state.liveIndexChecked, running: this.state.liveIndexRunning || {} };
5272
+ return { keys: this.state.liveIndexKeys, checked: this.state.liveIndexChecked, running: this.state.liveIndexRunning || {}, runningChecked: !!this.state.liveIndexRunningChecked, settled: this.state.liveIndexSettled || {} };
5241
5273
  }
5242
5274
  /** Passes that were on a row when the user stopped it, so the display layer can
5243
5275
  * still tell that this run was stopped once the stop has left no other trace.
@@ -5521,6 +5553,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
5521
5553
  var next = {};
5522
5554
  var running = {};
5523
5555
  var truncated = false;
5556
+ var runningTruncated = false;
5524
5557
  var settledIds = {};
5525
5558
  this.state.messages.forEach(function(m) {
5526
5559
  if (!m._serverItemId) return;
@@ -5529,7 +5562,15 @@ Index the REMAINING windows - one record per row/item, looking at any page image
5529
5562
  });
5530
5563
  for (var li = 0; li < lists.length; li++) {
5531
5564
  var list = lists[li] && Array.isArray(lists[li].list) ? lists[li].list : [];
5532
- if (list.length >= WORKER_PASS_ADOPT_LIMIT) truncated = true;
5565
+ if (list.length >= WORKER_PASS_ADOPT_LIMIT || lists[li] && lists[li].endOfList === false) {
5566
+ truncated = true;
5567
+ for (var si = 0; si < list.length; si++) {
5568
+ if (list[si] && list[si].status === "running") {
5569
+ runningTruncated = true;
5570
+ break;
5571
+ }
5572
+ }
5573
+ }
5533
5574
  for (var i = 0; i < list.length; i++) {
5534
5575
  var item = list[i];
5535
5576
  if (!item || item.status !== "pending" && item.status !== "running") continue;
@@ -5574,7 +5615,19 @@ Index the REMAINING windows - one record per row/item, looking at any page image
5574
5615
  }
5575
5616
  }
5576
5617
  this.state.liveIndexKeys = next;
5618
+ if (this.state.liveIndexRunningChecked !== !runningTruncated) changed = true;
5619
+ var settledNow = this.state.liveIndexSettled || {};
5620
+ var settledNext = {};
5621
+ for (var sk in settledNow) if (settledNow[sk] && !next[sk]) settledNext[sk] = true;
5622
+ if (nowChecked) {
5623
+ for (var wk in was) if (was[wk] && !next[wk]) {
5624
+ if (!settledNext[wk]) changed = true;
5625
+ settledNext[wk] = true;
5626
+ }
5627
+ }
5628
+ this.state.liveIndexSettled = settledNext;
5577
5629
  this.state.liveIndexRunning = running;
5630
+ this.state.liveIndexRunningChecked = !runningTruncated;
5578
5631
  this.state.liveIndexChecked = nowChecked;
5579
5632
  this._liveIndexAt = nowMs();
5580
5633
  this._liveIndexKey = this.getHistoryCacheKey();
@@ -5585,6 +5638,8 @@ Index the REMAINING windows - one record per row/item, looking at any page image
5585
5638
  _resetLiveIndexKeys() {
5586
5639
  this.state.liveIndexKeys = {};
5587
5640
  this.state.liveIndexRunning = {};
5641
+ this.state.liveIndexRunningChecked = false;
5642
+ this.state.liveIndexSettled = {};
5588
5643
  this.state.liveIndexChecked = false;
5589
5644
  this._liveIndexAt = 0;
5590
5645
  this.state.passPaging = {};
@@ -8953,9 +9008,23 @@ Index the REMAINING windows - one record per row/item, looking at any page image
8953
9008
  });
8954
9009
  }
8955
9010
  /** The page progress to show for a file's row, or null (see _refreshPageProgress). */
8956
- pageProgressFor(storagePath) {
8957
- if (!storagePath || !this.state.indexPageProgress) return null;
8958
- var p = this.state.indexPageProgress[storagePath];
9011
+ pageProgressFor(storagePath, fileName) {
9012
+ var map = this.state.indexPageProgress;
9013
+ if (!map) return null;
9014
+ var p = storagePath ? map[storagePath] : void 0;
9015
+ if (!p && fileName) {
9016
+ var hit = null;
9017
+ for (var k in map) {
9018
+ if (k === fileName || k.slice(-(fileName.length + 1)) === "/" + fileName) {
9019
+ if (hit) {
9020
+ hit = null;
9021
+ break;
9022
+ }
9023
+ hit = k;
9024
+ }
9025
+ }
9026
+ if (hit) p = map[hit];
9027
+ }
8959
9028
  return p ? { saved: p.saved, total: p.total } : null;
8960
9029
  }
8961
9030
  _noteLiveLook(svcId, platform, results) {
@@ -8963,7 +9032,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
8963
9032
  var complete = true;
8964
9033
  for (var r = 0; r < results.length; r++) {
8965
9034
  var list = results[r] && Array.isArray(results[r].list) ? results[r].list : [];
8966
- if (list.length >= WORKER_PASS_ADOPT_LIMIT) complete = false;
9035
+ if (list.length >= WORKER_PASS_ADOPT_LIMIT || results[r] && results[r].endOfList === false) complete = false;
8967
9036
  for (var i = 0; i < list.length; i++) if (list[i] && typeof list[i].id === "string") ids[list[i].id] = true;
8968
9037
  }
8969
9038
  this._lastLiveLook = complete ? { svcId, platform, at: Date.now(), ids } : null;
@@ -9994,6 +10063,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
9994
10063
  uploadSingleAttachment(att, stageId) {
9995
10064
  var self = this;
9996
10065
  var id = this.host.getIdentity();
10066
+ var isIndexRetry = att.status === "indexError";
9997
10067
  att.status = "uploading";
9998
10068
  att.progress = null;
9999
10069
  att.errorMessage = "";
@@ -10046,7 +10116,12 @@ Index the REMAINING windows - one record per row/item, looking at any page image
10046
10116
  }
10047
10117
  });
10048
10118
  };
10049
- return findDuplicate(member).then(function(dup) {
10119
+ if (isIndexRetry) {
10120
+ hadExists = true;
10121
+ existedBefore = true;
10122
+ }
10123
+ return (isIndexRetry ? Promise.resolve(null) : findDuplicate(member)).then(function(dup) {
10124
+ if (isIndexRetry) return;
10050
10125
  if (dup) {
10051
10126
  duplicateOf = dup;
10052
10127
  console.log("[chat-engine] skipping an upload the user already has:", member.storagePath, "->", dup);
@@ -10073,7 +10148,19 @@ Index the REMAINING windows - one record per row/item, looking at any page image
10073
10148
  });
10074
10149
  }).then(function() {
10075
10150
  if (skipped) return;
10076
- return self.host.getTemporaryUrl(duplicateOf || member.storagePath);
10151
+ return Promise.resolve(self.host.getTemporaryUrl(duplicateOf || member.storagePath)).catch(function(err) {
10152
+ var ecode = err && (err.code || err.body && err.body.code);
10153
+ var emsg = String(err && (err.message || err.body && err.body.message) || err || "");
10154
+ var refused = /no access to this file/i.test(emsg) || ecode === "INVALID_REQUEST" && /access/i.test(emsg);
10155
+ if (duplicateOf || !refused || typeof self.host.ensureFileIndexRecord !== "function") throw err;
10156
+ return Promise.resolve(self.host.ensureFileIndexRecord(member.storagePath, {
10157
+ name: member.file.name,
10158
+ mime: member.file.type || self.host.getMimeType(member.file.name),
10159
+ size: member.file.size
10160
+ })).then(function() {
10161
+ return self.host.getTemporaryUrl(member.storagePath);
10162
+ });
10163
+ });
10077
10164
  }).then(function(url) {
10078
10165
  if (skipped) return;
10079
10166
  if (duplicateOf) {
@@ -10243,7 +10330,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
10243
10330
  if (!self.state.attachments.some(function(a) {
10244
10331
  return a.id === att.id;
10245
10332
  })) return;
10246
- if (att.status === "done" || att.status === "indexError") {
10333
+ if (att.status === "done") {
10247
10334
  if (att.kind === "folder" && att.uploadedUrls) {
10248
10335
  att.uploadedUrls.forEach(function(u) {
10249
10336
  collected.push({ name: u.path, url: u.url, storagePath: u.storagePath });
@@ -10298,7 +10385,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
10298
10385
  (function() {
10299
10386
  var MCP_PROD = "https://mcp.broadwayinc.computer";
10300
10387
  var MCP_DEV = "https://mcp-dev.broadwayinc.computer";
10301
- var BQ_VERSION = "1.19.0" ;
10388
+ var BQ_VERSION = "1.19.1" ;
10302
10389
  var ATTACHMENT_URL_EXPIRES_SECONDS = 600;
10303
10390
  var GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
10304
10391
  var GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
@@ -10651,7 +10738,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
10651
10738
  return h(
10652
10739
  "div",
10653
10740
  {
10654
- class: "bq-bunny-loader" + (""),
10741
+ class: "bq-bunny-loader" + (overlay ? " bq-bunny-loader--overlay" : ""),
10655
10742
  "aria-hidden": "true",
10656
10743
  translate: "no"
10657
10744
  },
@@ -12553,6 +12640,21 @@ Index the REMAINING windows - one record per row/item, looking at any page image
12553
12640
  }
12554
12641
  });
12555
12642
  }
12643
+ var genDotTick = 0, genDotTimer = null;
12644
+ function startGenDotTicker() {
12645
+ if (genDotTimer) return;
12646
+ genDotTimer = setInterval(function() {
12647
+ var els = CS.typing && CS.messagesBox ? CS.messagesBox.querySelectorAll(".bq-gen-dots") : [];
12648
+ if (!els.length) {
12649
+ clearInterval(genDotTimer);
12650
+ genDotTimer = null;
12651
+ genDotTick = 0;
12652
+ return;
12653
+ }
12654
+ genDotTick = (genDotTick + 1) % 3;
12655
+ for (var i = 0; i < els.length; i++) els[i].textContent = ".".repeat(genDotTick + 1);
12656
+ }, 400);
12657
+ }
12556
12658
  function parseMsgPartsHtml(content, opts) {
12557
12659
  var noPreviews = !!(opts && opts.imagePreviews === false);
12558
12660
  var placeholderHtml = [];
@@ -12573,7 +12675,8 @@ Index the REMAINING windows - one record per row/item, looking at any page image
12573
12675
  if (CS.typing) {
12574
12676
  var openFence = working.match(/```([^\n`]+?\.[^\s.`]+)\n?/);
12575
12677
  if (openFence && typeof openFence.index === "number") {
12576
- working = working.slice(0, openFence.index) + "\n[generating " + openFence[1] + "\u2026]";
12678
+ working = working.slice(0, openFence.index) + "\n[generating " + openFence[1] + pushPlaceholder('<span class="bq-gen-dots">' + ".".repeat(genDotTick + 1) + "</span>") + "]";
12679
+ startGenDotTicker();
12577
12680
  }
12578
12681
  }
12579
12682
  var codeMasks = [];
@@ -12735,9 +12838,32 @@ Index the REMAINING windows - one record per row/item, looking at any page image
12735
12838
  var fields = signed && signed.fields ? signed.fields : {};
12736
12839
  for (var name in fields) form.append(name, fields[name]);
12737
12840
  form.append("file", file);
12738
- return xhrUploadForm(signed.url, form, onProgress, setAbort);
12841
+ return xhrUploadForm(signed.url, form, onProgress, setAbort).catch(function(err) {
12842
+ if (err && (err === "Aborted" || err.message === "Aborted")) throw err;
12843
+ var sum = summarizeUploadError(err);
12844
+ var e = new Error("Upload failed for " + file.name + (sum.message ? ": " + sum.message : ""));
12845
+ if (sum.code) e.code = sum.code;
12846
+ throw e;
12847
+ });
12739
12848
  });
12740
12849
  }
12850
+ function summarizeUploadError(err) {
12851
+ if (!err) return { code: "", message: "" };
12852
+ if (typeof err === "string") {
12853
+ var c = /<Code>([^<]+)<\/Code>/.exec(err), m = /<Message>([^<]+)<\/Message>/.exec(err);
12854
+ var code = c ? c[1] : "", msg = m ? m[1] : "";
12855
+ if (code || msg) return { code, message: msg || code };
12856
+ return { code: "", message: err.length > 300 ? err.slice(0, 300) : err };
12857
+ }
12858
+ var ecode = err.code || err.body && err.body.code || "";
12859
+ var emsg = err.message || err.body && err.body.message || "";
12860
+ if (ecode || emsg) return { code: ecode, message: emsg };
12861
+ try {
12862
+ return { code: "", message: JSON.stringify(err).slice(0, 300) };
12863
+ } catch (x) {
12864
+ return { code: "", message: String(err) };
12865
+ }
12866
+ }
12741
12867
  var DECORATION_START = /^[<>:"\\|?*]/;
12742
12868
  function deleteFileIndexDecorations(storagePath) {
12743
12869
  if (!S.skapi || typeof S.skapi.getUniqueId !== "function") return Promise.resolve();
@@ -13365,7 +13491,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
13365
13491
  if (inputEl) inputEl.value = "";
13366
13492
  }
13367
13493
  function setupDragAndDrop(chatEl) {
13368
- var depth = 0, overlay = null;
13494
+ var depth = 0, overlay = null, preparing = null;
13369
13495
  function showOverlay() {
13370
13496
  if (overlay || S.aiPlatform === "none") return;
13371
13497
  overlay = h(
@@ -13417,7 +13543,20 @@ Index the REMAINING windows - one record per row/item, looking at any page image
13417
13543
  e.preventDefault();
13418
13544
  depth = 0;
13419
13545
  hideOverlay();
13420
- handleDrop(e.dataTransfer);
13546
+ if (preparing) return;
13547
+ preparing = h(
13548
+ "div",
13549
+ { class: "bq-drop-preparing", role: "status", "aria-live": "polite" },
13550
+ bunnyLoader("Preparing files...", false)
13551
+ );
13552
+ chatEl.appendChild(preparing);
13553
+ var done = function() {
13554
+ if (preparing && preparing.parentNode) preparing.parentNode.removeChild(preparing);
13555
+ preparing = null;
13556
+ };
13557
+ Promise.resolve().then(function() {
13558
+ return handleDrop(e.dataTransfer);
13559
+ }).then(done, done);
13421
13560
  });
13422
13561
  }
13423
13562
  function handleDrop(dt) {
@@ -13431,7 +13570,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
13431
13570
  var entry2 = it.webkitGetAsEntry ? it.webkitGetAsEntry() : null;
13432
13571
  entries.push(entry2 || it.getAsFile());
13433
13572
  }
13434
- Promise.all(entries.map(function(entry3) {
13573
+ return Promise.all(entries.map(function(entry3) {
13435
13574
  if (!entry3) return Promise.resolve(null);
13436
13575
  if (entry3 instanceof File) return Promise.resolve(newAttachment({ kind: "file", name: entry3.name, file: entry3 }));
13437
13576
  if (entry3.isFile) {
@@ -13595,11 +13734,20 @@ Index the REMAINING windows - one record per row/item, looking at any page image
13595
13734
  anchor.click();
13596
13735
  return;
13597
13736
  }
13737
+ var busy = document.createTextNode(" (fetching...)");
13738
+ anchor.classList.add("is-refreshing");
13739
+ anchor.appendChild(busy);
13740
+ var unbusy = function() {
13741
+ anchor.classList.remove("is-refreshing");
13742
+ if (busy.parentNode) busy.parentNode.removeChild(busy);
13743
+ };
13598
13744
  fetchFreshHrefForExpiredLink(originalHref, anchor.dataset.bqRemotePath).then(function(fresh) {
13745
+ unbusy();
13599
13746
  anchor.href = fresh;
13600
13747
  anchor.dataset.bqExpired = "0";
13601
13748
  anchor.click();
13602
13749
  }).catch(function(err) {
13750
+ unbusy();
13603
13751
  console.error("[bunnyquery] expired link refresh failed", err);
13604
13752
  markLinkUnavailable(linkUnavailableKeyForHref(originalHref));
13605
13753
  if (anchor.dataset.bqRemotePath) markLinkUnavailable(linkUnavailableKeyForPath(anchor.dataset.bqRemotePath));
@@ -13874,7 +14022,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
13874
14022
  }
13875
14023
  function indexGroupCount(group) {
13876
14024
  if (group.stub) return "";
13877
- var prog = group.status === "active" && session && session.pageProgressFor ? session.pageProgressFor(group.path) : null;
14025
+ var prog = group.status === "active" && session && session.pageProgressFor ? session.pageProgressFor(group.path || group.key, group.name) : null;
13878
14026
  var pages = prog ? prog.total ? prog.saved + " of " + prog.total + " pages" : prog.saved + " pages" : "";
13879
14027
  var passes = group.passCount <= 1 && !group.mayHaveOlder ? "" : group.passCount + (group.mayHaveOlder ? "+" : "") + " passes";
13880
14028
  return [pages, passes].filter(Boolean).join(" \xB7 ");
@@ -14045,6 +14193,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
14045
14193
  liveIndexChecked: liveIndex.checked,
14046
14194
  // Which live files have a pass running: a live row without one says "Queued".
14047
14195
  liveIndexRunningKeys: liveIndex.running,
14196
+ liveIndexRunningChecked: liveIndex.runningChecked,
14048
14197
  // Runs the user stopped. A stop that landed on a RUNNING pass leaves no
14049
14198
  // cancelled bubble behind (that pass finishes and answers normally), so
14050
14199
  // without this the row reports the stop as a finished "Indexed".
@@ -14052,7 +14201,8 @@ Index the REMAINING windows - one record per row/item, looking at any page image
14052
14201
  // Durable completion markers + run records (one sweep, see above).
14053
14202
  // doneKeys settle worker-run greens without a queue round trip;
14054
14203
  // runStubs paint rows for runs whose passes are not loaded yet.
14055
- doneKeys: fresh ? markerSweep.done : void 0,
14204
+ // Plus the files the queue check saw leave the queue (agent.vue same).
14205
+ doneKeys: Object.assign({}, fresh ? markerSweep.done : {}, liveIndex.settled || {}),
14056
14206
  runStubs: stubs,
14057
14207
  // Records are service-wide and horizon-blind; without this every
14058
14208
  // "Clear chat history" resurrected one row per indexed file.
@@ -14552,6 +14702,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
14552
14702
  var moPatch = { status: "done", finished: typeof moLast === "number" ? moLast : Date.now() };
14553
14703
  if (typeof moFirst === "number") moPatch.started = moFirst;
14554
14704
  if (mog.name) moPatch.filename = mog.name;
14705
+ if (S.aiPlatform === "claude" || S.aiPlatform === "openai") moPatch.platform = S.aiPlatform;
14555
14706
  void upsertIndexRunRecordDb(S.projectId, mog.path, moPatch);
14556
14707
  if (morec) morec.status = "done";
14557
14708
  else markerSweep.runs[mog.path] = { status: "done" };
@@ -14731,10 +14882,10 @@ Index the REMAINING windows - one record per row/item, looking at any page image
14731
14882
  }
14732
14883
  });
14733
14884
  input.addEventListener("keydown", function(e) {
14734
- if (e.key === "Enter" && !e.shiftKey && !composing) {
14735
- e.preventDefault();
14736
- sendMessage();
14737
- }
14885
+ if (e.key !== "Enter" || e.shiftKey || e.ctrlKey || e.metaKey || e.altKey) return;
14886
+ if (composing || e.isComposing || e.keyCode === 229) return;
14887
+ e.preventDefault();
14888
+ sendMessage();
14738
14889
  });
14739
14890
  requestAnimationFrame(function() {
14740
14891
  autoGrowInput(input);
@@ -14799,6 +14950,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
14799
14950
  CS.historyStartKeyHistory = Array.isArray(loaded.startKeyHistory) ? loaded.startKeyHistory.slice() : [];
14800
14951
  session.aiChatHistoryCache[cacheKey2] = Object.assign({}, loaded, { messages: restored });
14801
14952
  renderMessages();
14953
+ scrollToBottom();
14802
14954
  }
14803
14955
  if (loaded && !session.needsHistoryRefetch()) {
14804
14956
  session.drainBgTaskQueue();