bunnyquery 1.10.6 → 1.10.7

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
@@ -1487,6 +1487,18 @@ Index the REMAINING windows - one record per row/item, looking at any page image
1487
1487
  return "";
1488
1488
  }
1489
1489
  }
1490
+ function formatDuration(ms) {
1491
+ if (typeof ms !== "number" || !isFinite(ms) || ms < 1e3) return "";
1492
+ var total = Math.floor(ms / 1e3);
1493
+ var h = Math.floor(total / 3600);
1494
+ var m = Math.floor(total % 3600 / 60);
1495
+ var s = total % 60;
1496
+ var out = [];
1497
+ if (h) out.push(h + "h");
1498
+ if (m) out.push(m + "m");
1499
+ out.push(s + "s");
1500
+ return out.join(" ");
1501
+ }
1490
1502
 
1491
1503
  // src/engine/ai_agent.ts
1492
1504
  function normalizePlatform(raw) {
@@ -3037,6 +3049,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
3037
3049
  var serverItemId = item && typeof item.id === "string" && item.id ? item.id : void 0;
3038
3050
  var createdTs = Number(item && item.created);
3039
3051
  var updatedTs = Number(item && item.updated);
3052
+ var executedTs = Number(item && item.executed);
3040
3053
  var userTs = isFinite(createdTs) && createdTs > 0 ? createdTs : isFinite(updatedTs) && updatedTs > 0 ? updatedTs : void 0;
3041
3054
  var replyTs = isFinite(updatedTs) && updatedTs > 0 ? updatedTs : isFinite(createdTs) && createdTs > 0 ? createdTs : void 0;
3042
3055
  if (userText) {
@@ -3105,6 +3118,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
3105
3118
  if (isCompact) okm._compact = true;
3106
3119
  if (serverItemId !== void 0) okm._serverItemId = serverItemId;
3107
3120
  if (replyTs !== void 0) okm._ts = replyTs;
3121
+ if (indexFile && isFinite(executedTs) && executedTs > 0) okm._tsStart = executedTs;
3108
3122
  if (reportedComplete) okm._indexComplete = true;
3109
3123
  mapped.push(okm);
3110
3124
  }
@@ -8263,7 +8277,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
8263
8277
  (function() {
8264
8278
  var MCP_PROD = "https://mcp.broadwayinc.computer";
8265
8279
  var MCP_DEV = "https://mcp-dev.broadwayinc.computer";
8266
- var BQ_VERSION = "1.10.6" ;
8280
+ var BQ_VERSION = "1.10.7" ;
8267
8281
  var ATTACHMENT_URL_EXPIRES_SECONDS = 600;
8268
8282
  var GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
8269
8283
  var GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
@@ -11540,6 +11554,10 @@ Index the REMAINING windows - one record per row/item, looking at any page image
11540
11554
  if (msg.isCancelled) bubble.appendChild(h("span", { class: "bq-cancel-error", text: "(cancelled)" }));
11541
11555
  if (msg._cancelError) bubble.appendChild(h("span", { class: "bq-cancel-error", text: msg._cancelError }));
11542
11556
  var ts = msg.isPending ? "" : formatChatTimestamp(msg._ts);
11557
+ if (ts && typeof msg._ts === "number" && typeof msg._tsStart === "number") {
11558
+ var dur = formatDuration(msg._ts - msg._tsStart);
11559
+ if (dur) ts += " (" + dur + ")";
11560
+ }
11543
11561
  if (ts) bubble.appendChild(h("time", { class: "bq-msg-time", text: ts }));
11544
11562
  }
11545
11563
  return h("div", { class: cls.join(" "), dataset: { msgIndex: String(idx) } }, bubble);
package/dist/engine.cjs CHANGED
@@ -1561,6 +1561,18 @@ function formatChatTimestamp(ms) {
1561
1561
  return "";
1562
1562
  }
1563
1563
  }
1564
+ function formatDuration(ms) {
1565
+ if (typeof ms !== "number" || !isFinite(ms) || ms < 1e3) return "";
1566
+ var total = Math.floor(ms / 1e3);
1567
+ var h = Math.floor(total / 3600);
1568
+ var m = Math.floor(total % 3600 / 60);
1569
+ var s = total % 60;
1570
+ var out = [];
1571
+ if (h) out.push(h + "h");
1572
+ if (m) out.push(m + "m");
1573
+ out.push(s + "s");
1574
+ return out.join(" ");
1575
+ }
1564
1576
 
1565
1577
  // src/engine/ai_agent.ts
1566
1578
  function normalizePlatform(raw) {
@@ -3181,6 +3193,7 @@ function mapHistoryListToMessages(list, platform, opts) {
3181
3193
  var serverItemId = item && typeof item.id === "string" && item.id ? item.id : void 0;
3182
3194
  var createdTs = Number(item && item.created);
3183
3195
  var updatedTs = Number(item && item.updated);
3196
+ var executedTs = Number(item && item.executed);
3184
3197
  var userTs = isFinite(createdTs) && createdTs > 0 ? createdTs : isFinite(updatedTs) && updatedTs > 0 ? updatedTs : void 0;
3185
3198
  var replyTs = isFinite(updatedTs) && updatedTs > 0 ? updatedTs : isFinite(createdTs) && createdTs > 0 ? createdTs : void 0;
3186
3199
  if (userText) {
@@ -3249,6 +3262,7 @@ function mapHistoryListToMessages(list, platform, opts) {
3249
3262
  if (isCompact) okm._compact = true;
3250
3263
  if (serverItemId !== void 0) okm._serverItemId = serverItemId;
3251
3264
  if (replyTs !== void 0) okm._ts = replyTs;
3265
+ if (indexFile && isFinite(executedTs) && executedTs > 0) okm._tsStart = executedTs;
3252
3266
  if (reportedComplete) okm._indexComplete = true;
3253
3267
  mapped.push(okm);
3254
3268
  }
@@ -8551,6 +8565,7 @@ exports.fillHistoryViewport = fillHistoryViewport;
8551
8565
  exports.filterListByClearHorizon = filterListByClearHorizon;
8552
8566
  exports.findAttachmentParser = findAttachmentParser;
8553
8567
  exports.formatChatTimestamp = formatChatTimestamp;
8568
+ exports.formatDuration = formatDuration;
8554
8569
  exports.getAttachmentParsers = getAttachmentParsers;
8555
8570
  exports.getChatHistory = getChatHistory;
8556
8571
  exports.getContextWindow = getContextWindow;