bunnyquery 1.15.1 → 1.15.4

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
@@ -1435,6 +1435,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
1435
1435
  "claude-fable-5-1": 1e6,
1436
1436
  "claude-opus-5-5": 1e6,
1437
1437
  "claude-sonnet-5-5": 1e6,
1438
+ "claude-haiku-5-5": 1e6,
1438
1439
  "claude-fable-5": 1e6,
1439
1440
  "claude-opus-5": 1e6,
1440
1441
  "claude-opus-4-8": 1e6,
@@ -1480,6 +1481,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
1480
1481
  "claude-fable-5-1": 128e3,
1481
1482
  "claude-opus-5-5": 128e3,
1482
1483
  "claude-sonnet-5-5": 128e3,
1484
+ "claude-haiku-5-5": 128e3,
1483
1485
  "claude-fable-5": 128e3,
1484
1486
  "claude-opus-5": 128e3,
1485
1487
  "claude-opus-4-8": 128e3,
@@ -2676,8 +2678,8 @@ Index the REMAINING windows - one record per row/item, looking at any page image
2676
2678
  return [openaiWebSearchTool()] ;
2677
2679
  };
2678
2680
  var MCP_NAME = "BunnyQuery";
2679
- var DEFAULT_CLAUDE_MODEL = "claude-sonnet-5-5";
2680
- var DEFAULT_OPENAI_MODEL = "gpt-6.1-sol";
2681
+ var DEFAULT_CLAUDE_MODEL = "claude-haiku-5-5";
2682
+ var DEFAULT_OPENAI_MODEL = "gpt-6-luna";
2681
2683
  var mcpUrl = () => chatEngineConfig().mcpBaseUrl;
2682
2684
  function withMcpParams(base, params) {
2683
2685
  if (!base) return base;
@@ -4357,6 +4359,9 @@ Index the REMAINING windows - one record per row/item, looking at any page image
4357
4359
  this._liveIndexKey = "";
4358
4360
  this._liveIndexAt = 0;
4359
4361
  this._indexClaims = {};
4362
+ this._bgQueueByFile = null;
4363
+ this._bgQueueStamp = { arr: null, length: 0, first: void 0, last: void 0 };
4364
+ this._bgQueueIndexRebuilds = 0;
4360
4365
  }
4361
4366
  /** What the display layer needs to decide whether a run is finished. `keys` holds
4362
4367
  * every file the server still has indexing work for; `checked` is false until the
@@ -4393,13 +4398,10 @@ Index the REMAINING windows - one record per row/item, looking at any page image
4393
4398
  */
4394
4399
  hasLiveIndexRun(storagePath) {
4395
4400
  if (!storagePath) return false;
4396
- var claimed = this._indexClaims[this._indexClaimKey(storagePath)];
4401
+ var scoped = this._indexClaimKey(storagePath);
4402
+ var claimed = this._indexClaims[scoped];
4397
4403
  if (claimed && nowMs() - claimed < INDEX_DISPATCH_CLAIM_MS) return true;
4398
- var id = this.host.getIdentity();
4399
- for (var i = 0; i < this.bgTaskQueue.length; i++) {
4400
- var e = this.bgTaskQueue[i];
4401
- if (e && e.storagePath === storagePath && e.projectId === id.projectId && e.platform === id.platform) return true;
4402
- }
4404
+ if (this._bgQueueIndex()[scoped] > 0) return true;
4403
4405
  return this.state.messages.some(function(m) {
4404
4406
  if (!m.isBackgroundTask || m.role !== "user" || m.isCancelled) return false;
4405
4407
  if (!(m.isPendingQueued || m.isPendingInProcess || m.isSendingToServer)) return false;
@@ -4412,6 +4414,47 @@ Index the REMAINING windows - one record per row/item, looking at any page image
4412
4414
  var id = this.host.getIdentity();
4413
4415
  return indexScopeKey(id.projectId, id.platform) + "|" + storagePath;
4414
4416
  }
4417
+ /**
4418
+ * bgTaskQueue as a map: scoped path (indexScopeKey(projectId, platform) +
4419
+ * '|' + storagePath, the key the claims and the stops use) -> entries.
4420
+ *
4421
+ * The array stays the source of truth because the engine does not own every
4422
+ * write to it: both hosts hand in their own array (the dashboard a Vue
4423
+ * reactive one it pushes to from the Files page and splices from its
4424
+ * fallback poller), and tests push to it directly. So the map is DERIVED, and
4425
+ * rebuilt when a cheap stamp says the array changed: its identity, its length,
4426
+ * its first and its last entry.
4427
+ *
4428
+ * Why that stamp is exact for this array: every write to bgTaskQueue is either
4429
+ * a push of a NEW entry object or a splice that removes one (nothing inserts
4430
+ * in the middle, replaces in place or re-pushes a removed entry). Under those
4431
+ * two operations, same length plus same last entry means the same contents:
4432
+ * a push changes the last entry unless that same push is removed again, and a
4433
+ * removal changes the length unless a push restores it, which changes the
4434
+ * last entry. The first entry is in the stamp as margin. A rebuild is one
4435
+ * pass over the array, paid once per change instead of once per claim.
4436
+ */
4437
+ _bgQueueIndex() {
4438
+ var q = this.bgTaskQueue;
4439
+ var n = q ? q.length : 0;
4440
+ var first = n ? q[0] : void 0;
4441
+ var last = n ? q[n - 1] : void 0;
4442
+ var st = this._bgQueueStamp;
4443
+ if (this._bgQueueByFile && st.arr === q && st.length === n && st.first === first && st.last === last) {
4444
+ return this._bgQueueByFile;
4445
+ }
4446
+ var idx = {};
4447
+ for (var i = 0; i < n; i++) {
4448
+ var e = q[i];
4449
+ if (!e || !e.storagePath) continue;
4450
+ var k = indexScopeKey(e.projectId, e.platform) + "|" + e.storagePath;
4451
+ idx[k] = (idx[k] || 0) + 1;
4452
+ }
4453
+ this._bgQueueByFile = idx;
4454
+ this._bgQueueStamp = { arr: q, length: n, first, last };
4455
+ this._bgQueueIndexRebuilds++;
4456
+ return idx;
4457
+ }
4415
4458
  /**
4416
4459
  * Take this file's indexing slot, or report that someone already has it.
4417
4460
  *
@@ -9119,7 +9162,7 @@ Index the REMAINING windows - one record per row/item, looking at any page image
9119
9162
  (function() {
9120
9163
  var MCP_PROD = "https://mcp.broadwayinc.computer";
9121
9164
  var MCP_DEV = "https://mcp-dev.broadwayinc.computer";
9122
- var BQ_VERSION = "1.15.1" ;
9165
+ var BQ_VERSION = "1.15.4" ;
9123
9166
  var ATTACHMENT_URL_EXPIRES_SECONDS = 600;
9124
9167
  var GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
9125
9168
  var GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
package/dist/engine.cjs CHANGED
@@ -1518,6 +1518,7 @@ var CONTEXT_WINDOW_BY_MODEL = {
1518
1518
  "claude-fable-5-1": 1e6,
1519
1519
  "claude-opus-5-5": 1e6,
1520
1520
  "claude-sonnet-5-5": 1e6,
1521
+ "claude-haiku-5-5": 1e6,
1521
1522
  "claude-fable-5": 1e6,
1522
1523
  "claude-opus-5": 1e6,
1523
1524
  "claude-opus-4-8": 1e6,
@@ -1563,6 +1564,7 @@ var MAX_OUTPUT_BY_MODEL = {
1563
1564
  "claude-fable-5-1": 128e3,
1564
1565
  "claude-opus-5-5": 128e3,
1565
1566
  "claude-sonnet-5-5": 128e3,
1567
+ "claude-haiku-5-5": 128e3,
1566
1568
  "claude-fable-5": 128e3,
1567
1569
  "claude-opus-5": 128e3,
1568
1570
  "claude-opus-4-8": 128e3,
@@ -2798,8 +2800,8 @@ var webToolsForChat = (platform, webAccess) => {
2798
2800
  return [openaiWebSearchTool()] ;
2799
2801
  };
2800
2802
  var MCP_NAME = "BunnyQuery";
2801
- var DEFAULT_CLAUDE_MODEL = "claude-sonnet-5-5";
2802
- var DEFAULT_OPENAI_MODEL = "gpt-6.1-sol";
2803
+ var DEFAULT_CLAUDE_MODEL = "claude-haiku-5-5";
2804
+ var DEFAULT_OPENAI_MODEL = "gpt-6-luna";
2803
2805
  var mcpUrl = () => chatEngineConfig().mcpBaseUrl;
2804
2806
  function withMcpParams(base, params) {
2805
2807
  if (!base) return base;
@@ -4538,6 +4540,9 @@ var ChatSession = class {
4538
4540
  this._liveIndexKey = "";
4539
4541
  this._liveIndexAt = 0;
4540
4542
  this._indexClaims = {};
4543
+ this._bgQueueByFile = null;
4544
+ this._bgQueueStamp = { arr: null, length: 0, first: void 0, last: void 0 };
4545
+ this._bgQueueIndexRebuilds = 0;
4541
4546
  }
4542
4547
  /** What the display layer needs to decide whether a run is finished. `keys` holds
4543
4548
  * every file the server still has indexing work for; `checked` is false until the
@@ -4574,13 +4579,10 @@ var ChatSession = class {
4574
4579
  */
4575
4580
  hasLiveIndexRun(storagePath) {
4576
4581
  if (!storagePath) return false;
4577
- var claimed = this._indexClaims[this._indexClaimKey(storagePath)];
4582
+ var scoped = this._indexClaimKey(storagePath);
4583
+ var claimed = this._indexClaims[scoped];
4578
4584
  if (claimed && nowMs() - claimed < INDEX_DISPATCH_CLAIM_MS) return true;
4579
- var id = this.host.getIdentity();
4580
- for (var i = 0; i < this.bgTaskQueue.length; i++) {
4581
- var e = this.bgTaskQueue[i];
4582
- if (e && e.storagePath === storagePath && e.projectId === id.projectId && e.platform === id.platform) return true;
4583
- }
4585
+ if (this._bgQueueIndex()[scoped] > 0) return true;
4584
4586
  return this.state.messages.some(function(m) {
4585
4587
  if (!m.isBackgroundTask || m.role !== "user" || m.isCancelled) return false;
4586
4588
  if (!(m.isPendingQueued || m.isPendingInProcess || m.isSendingToServer)) return false;
@@ -4593,6 +4595,47 @@ var ChatSession = class {
4593
4595
  var id = this.host.getIdentity();
4594
4596
  return indexScopeKey(id.projectId, id.platform) + "|" + storagePath;
4595
4597
  }
4598
+ /**
4599
+ * bgTaskQueue as a map: scoped path (indexScopeKey(projectId, platform) +
4600
+ * '|' + storagePath, the key the claims and the stops use) -> entries.
4601
+ *
4602
+ * The array stays the source of truth because the engine does not own every
4603
+ * write to it: both hosts hand in their own array (the dashboard a Vue
4604
+ * reactive one it pushes to from the Files page and splices from its
4605
+ * fallback poller), and tests push to it directly. So the map is DERIVED, and
4606
+ * rebuilt when a cheap stamp says the array changed: its identity, its length,
4607
+ * its first and its last entry.
4608
+ *
4609
+ * Why that stamp is exact for this array: every write to bgTaskQueue is either
4610
+ * a push of a NEW entry object or a splice that removes one (nothing inserts
4611
+ * in the middle, replaces in place or re-pushes a removed entry). Under those
4612
+ * two operations, same length plus same last entry means the same contents:
4613
+ * a push changes the last entry unless that same push is removed again, and a
4614
+ * removal changes the length unless a push restores it, which changes the
4615
+ * last entry. The first entry is in the stamp as margin. A rebuild is one
4616
+ * pass over the array, paid once per change instead of once per claim.
4617
+ */
4618
+ _bgQueueIndex() {
4619
+ var q = this.bgTaskQueue;
4620
+ var n = q ? q.length : 0;
4621
+ var first = n ? q[0] : void 0;
4622
+ var last = n ? q[n - 1] : void 0;
4623
+ var st = this._bgQueueStamp;
4624
+ if (this._bgQueueByFile && st.arr === q && st.length === n && st.first === first && st.last === last) {
4625
+ return this._bgQueueByFile;
4626
+ }
4627
+ var idx = {};
4628
+ for (var i = 0; i < n; i++) {
4629
+ var e = q[i];
4630
+ if (!e || !e.storagePath) continue;
4631
+ var k = indexScopeKey(e.projectId, e.platform) + "|" + e.storagePath;
4632
+ idx[k] = (idx[k] || 0) + 1;
4633
+ }
4634
+ this._bgQueueByFile = idx;
4635
+ this._bgQueueStamp = { arr: q, length: n, first, last };
4636
+ this._bgQueueIndexRebuilds++;
4637
+ return idx;
4638
+ }
4596
4639
  /**
4597
4640
  * Take this file's indexing slot, or report that someone already has it.
4598
4641
  *