bunnyquery 1.10.6 → 1.10.8

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) {
@@ -3089,6 +3102,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
3089
3102
  if (item._isBgTask) em.isBackgroundTask = true;
3090
3103
  if (serverItemId !== void 0) em._serverItemId = serverItemId;
3091
3104
  if (replyTs !== void 0) em._ts = replyTs;
3105
+ if (indexFile && isFinite(executedTs) && executedTs > 0) em._tsStart = executedTs;
3092
3106
  mapped.push(em);
3093
3107
  } else if (isStreamPending) {
3094
3108
  var sp = { role: "assistant", content: "", _streamPending: true };
@@ -3105,6 +3119,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
3105
3119
  if (isCompact) okm._compact = true;
3106
3120
  if (serverItemId !== void 0) okm._serverItemId = serverItemId;
3107
3121
  if (replyTs !== void 0) okm._ts = replyTs;
3122
+ if (indexFile && isFinite(executedTs) && executedTs > 0) okm._tsStart = executedTs;
3108
3123
  if (reportedComplete) okm._indexComplete = true;
3109
3124
  mapped.push(okm);
3110
3125
  }
@@ -8263,7 +8278,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
8263
8278
  (function() {
8264
8279
  var MCP_PROD = "https://mcp.broadwayinc.computer";
8265
8280
  var MCP_DEV = "https://mcp-dev.broadwayinc.computer";
8266
- var BQ_VERSION = "1.10.6" ;
8281
+ var BQ_VERSION = "1.10.8" ;
8267
8282
  var ATTACHMENT_URL_EXPIRES_SECONDS = 600;
8268
8283
  var GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
8269
8284
  var GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
@@ -11540,6 +11555,10 @@ Index the REMAINING windows - one record per row/item, looking at any page image
11540
11555
  if (msg.isCancelled) bubble.appendChild(h("span", { class: "bq-cancel-error", text: "(cancelled)" }));
11541
11556
  if (msg._cancelError) bubble.appendChild(h("span", { class: "bq-cancel-error", text: msg._cancelError }));
11542
11557
  var ts = msg.isPending ? "" : formatChatTimestamp(msg._ts);
11558
+ if (ts && typeof msg._ts === "number" && typeof msg._tsStart === "number") {
11559
+ var dur = formatDuration(msg._ts - msg._tsStart);
11560
+ if (dur) ts += " (" + dur + ")";
11561
+ }
11543
11562
  if (ts) bubble.appendChild(h("time", { class: "bq-msg-time", text: ts }));
11544
11563
  }
11545
11564
  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) {
@@ -3233,6 +3246,7 @@ function mapHistoryListToMessages(list, platform, opts) {
3233
3246
  if (item._isBgTask) em.isBackgroundTask = true;
3234
3247
  if (serverItemId !== void 0) em._serverItemId = serverItemId;
3235
3248
  if (replyTs !== void 0) em._ts = replyTs;
3249
+ if (indexFile && isFinite(executedTs) && executedTs > 0) em._tsStart = executedTs;
3236
3250
  mapped.push(em);
3237
3251
  } else if (isStreamPending) {
3238
3252
  var sp = { role: "assistant", content: "", _streamPending: true };
@@ -3249,6 +3263,7 @@ function mapHistoryListToMessages(list, platform, opts) {
3249
3263
  if (isCompact) okm._compact = true;
3250
3264
  if (serverItemId !== void 0) okm._serverItemId = serverItemId;
3251
3265
  if (replyTs !== void 0) okm._ts = replyTs;
3266
+ if (indexFile && isFinite(executedTs) && executedTs > 0) okm._tsStart = executedTs;
3252
3267
  if (reportedComplete) okm._indexComplete = true;
3253
3268
  mapped.push(okm);
3254
3269
  }
@@ -8551,6 +8566,7 @@ exports.fillHistoryViewport = fillHistoryViewport;
8551
8566
  exports.filterListByClearHorizon = filterListByClearHorizon;
8552
8567
  exports.findAttachmentParser = findAttachmentParser;
8553
8568
  exports.formatChatTimestamp = formatChatTimestamp;
8569
+ exports.formatDuration = formatDuration;
8554
8570
  exports.getAttachmentParsers = getAttachmentParsers;
8555
8571
  exports.getChatHistory = getChatHistory;
8556
8572
  exports.getContextWindow = getContextWindow;