@kodaris/krubble-app-components 1.0.167 → 1.0.168
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/dist/chatbot.d.ts +16 -0
- package/dist/chatbot.d.ts.map +1 -1
- package/dist/chatbot.js +50 -1
- package/dist/chatbot.js.map +1 -1
- package/dist/krubble-app.bundled.js +50 -1
- package/dist/krubble-app.bundled.js.map +1 -1
- package/dist/krubble-app.bundled.min.js +39 -9
- package/dist/krubble-app.bundled.min.js.map +1 -1
- package/dist/krubble-app.umd.js +50 -1
- package/dist/krubble-app.umd.js.map +1 -1
- package/dist/krubble-app.umd.min.js +42 -12
- package/dist/krubble-app.umd.min.js.map +1 -1
- package/dist/krubble-shell-chatbot.umd.js +50 -1
- package/dist/krubble-shell-chatbot.umd.js.map +1 -1
- package/dist/krubble-shell-chatbot.umd.min.js +196 -166
- package/dist/krubble-shell-chatbot.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -24377,6 +24377,12 @@
|
|
|
24377
24377
|
}
|
|
24378
24378
|
return '$' + n.toFixed(2);
|
|
24379
24379
|
}
|
|
24380
|
+
_fmtPriceDetail(n) {
|
|
24381
|
+
if (n == null || isNaN(n)) {
|
|
24382
|
+
return '—';
|
|
24383
|
+
}
|
|
24384
|
+
return '$' + n.toFixed(4);
|
|
24385
|
+
}
|
|
24380
24386
|
_getCustomerPriceLabel() {
|
|
24381
24387
|
const rate = this._telemetry?.customerPricePerThousandTokens;
|
|
24382
24388
|
if (rate == null || isNaN(rate)) {
|
|
@@ -24384,6 +24390,28 @@
|
|
|
24384
24390
|
}
|
|
24385
24391
|
return `Customer price ($${rate}/1K)`;
|
|
24386
24392
|
}
|
|
24393
|
+
_getMarkupPriceLabel() {
|
|
24394
|
+
const pct = this._telemetry?.customerMarkupPercent;
|
|
24395
|
+
if (pct == null || isNaN(pct)) {
|
|
24396
|
+
return 'Customer price (markup)';
|
|
24397
|
+
}
|
|
24398
|
+
return `Customer price (${pct}% markup)`;
|
|
24399
|
+
}
|
|
24400
|
+
_getTurnCacheWriteTokens() {
|
|
24401
|
+
return this._iterationLog.reduce((sum, it) => sum + (it.iterationCacheWrite || 0), 0);
|
|
24402
|
+
}
|
|
24403
|
+
_renderMarkupBreakdown(input, output, cacheRead, cacheWrite) {
|
|
24404
|
+
return b `
|
|
24405
|
+
<span class="debug-metrics__key debug-metrics__key--sub">Input</span>
|
|
24406
|
+
<span class="debug-metrics__val debug-metrics__val--sub">${this._fmtPriceDetail(input)}</span>
|
|
24407
|
+
<span class="debug-metrics__key debug-metrics__key--sub">Output</span>
|
|
24408
|
+
<span class="debug-metrics__val debug-metrics__val--sub">${this._fmtPriceDetail(output)}</span>
|
|
24409
|
+
<span class="debug-metrics__key debug-metrics__key--sub">Cache read</span>
|
|
24410
|
+
<span class="debug-metrics__val debug-metrics__val--sub">${this._fmtPriceDetail(cacheRead)}</span>
|
|
24411
|
+
<span class="debug-metrics__key debug-metrics__key--sub">Cache write</span>
|
|
24412
|
+
<span class="debug-metrics__val debug-metrics__val--sub">${this._fmtPriceDetail(cacheWrite)}</span>
|
|
24413
|
+
`;
|
|
24414
|
+
}
|
|
24387
24415
|
/**
|
|
24388
24416
|
* INTERNAL-ONLY debug telemetry panel. Rendered only in the inline variant
|
|
24389
24417
|
* (guarded by the caller) and only when the user has toggled it open. Shows
|
|
@@ -24757,11 +24785,13 @@
|
|
|
24757
24785
|
<div class="debug-section__label">This turn</div>
|
|
24758
24786
|
<div class="debug-metrics">
|
|
24759
24787
|
<span class="debug-metrics__key">Input</span>
|
|
24760
|
-
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnInputTokens)}</span>
|
|
24788
|
+
<span class="debug-metrics__val">${this._fmtTokens(Math.max(0, (this._telemetry.turnInputTokens || 0) - this._getTurnCacheWriteTokens()))}</span>
|
|
24761
24789
|
<span class="debug-metrics__key">Output</span>
|
|
24762
24790
|
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnOutputTokens)}</span>
|
|
24763
24791
|
<span class="debug-metrics__key">Cache read</span>
|
|
24764
24792
|
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnCacheReadTokens)}</span>
|
|
24793
|
+
<span class="debug-metrics__key">Cache write</span>
|
|
24794
|
+
<span class="debug-metrics__val">${this._fmtTokens(this._getTurnCacheWriteTokens())}</span>
|
|
24765
24795
|
<span class="debug-metrics__key">Hit rate</span>
|
|
24766
24796
|
<span class="debug-metrics__val">${this._telemetry.turnHitRate ?? '—'}%</span>
|
|
24767
24797
|
<span class="debug-metrics__key">Total tokens</span>
|
|
@@ -24772,6 +24802,9 @@
|
|
|
24772
24802
|
<span class="debug-metrics__val debug-cost">${this._fmtCost(this._telemetry.turnCostUsd)}</span>
|
|
24773
24803
|
<span class="debug-metrics__key">${this._getCustomerPriceLabel()}</span>
|
|
24774
24804
|
<span class="debug-metrics__val debug-cost">${this._fmtPrice(this._telemetry.turnCustomerUsd)}</span>
|
|
24805
|
+
<span class="debug-metrics__key">${this._getMarkupPriceLabel()}</span>
|
|
24806
|
+
<span class="debug-metrics__val debug-cost">${this._fmtPrice(this._telemetry.turnMarkupCustomerUsd)}</span>
|
|
24807
|
+
${this._renderMarkupBreakdown(this._telemetry.turnMarkupInputUsd, this._telemetry.turnMarkupOutputUsd, this._telemetry.turnMarkupCacheReadUsd, this._telemetry.turnMarkupCacheWriteUsd)}
|
|
24775
24808
|
</div>
|
|
24776
24809
|
</div>
|
|
24777
24810
|
|
|
@@ -24792,6 +24825,9 @@
|
|
|
24792
24825
|
<span class="debug-metrics__val debug-cost">${this._fmtCost(this._telemetry.conversationCostUsd)}</span>
|
|
24793
24826
|
<span class="debug-metrics__key">${this._getCustomerPriceLabel()} so far</span>
|
|
24794
24827
|
<span class="debug-metrics__val debug-cost">${this._fmtPrice(this._telemetry.conversationCustomerUsd)}</span>
|
|
24828
|
+
<span class="debug-metrics__key">${this._getMarkupPriceLabel()} so far</span>
|
|
24829
|
+
<span class="debug-metrics__val debug-cost">${this._fmtPrice(this._telemetry.conversationMarkupCustomerUsd)}</span>
|
|
24830
|
+
${this._renderMarkupBreakdown(this._telemetry.conversationMarkupInputUsd, this._telemetry.conversationMarkupOutputUsd, this._telemetry.conversationMarkupCacheReadUsd, this._telemetry.conversationMarkupCacheWriteUsd)}
|
|
24795
24831
|
</div>
|
|
24796
24832
|
</div>
|
|
24797
24833
|
` : b `
|
|
@@ -24815,6 +24851,7 @@
|
|
|
24815
24851
|
<th>Reported</th>
|
|
24816
24852
|
<th>Cost</th>
|
|
24817
24853
|
<th>Price</th>
|
|
24854
|
+
<th>Markup $</th>
|
|
24818
24855
|
<th>Ckpt</th>
|
|
24819
24856
|
</tr>
|
|
24820
24857
|
</thead>
|
|
@@ -24833,6 +24870,7 @@
|
|
|
24833
24870
|
<td>${this._fmtTokens(it.reportedTotalTokens)}</td>
|
|
24834
24871
|
<td class="debug-cost">${this._fmtCost(it.iterationCostUsd)}</td>
|
|
24835
24872
|
<td class="debug-cost">${this._fmtPrice(it.iterationCustomerUsd)}</td>
|
|
24873
|
+
<td class="debug-cost">${this._fmtPrice(it.iterationMarkupCustomerUsd)}</td>
|
|
24836
24874
|
<td>${ckpt ? ckpt.mode : '—'}</td>
|
|
24837
24875
|
</tr>
|
|
24838
24876
|
`;
|
|
@@ -26964,6 +27002,17 @@
|
|
|
26964
27002
|
font-weight: 600;
|
|
26965
27003
|
}
|
|
26966
27004
|
|
|
27005
|
+
.debug-metrics__key--sub {
|
|
27006
|
+
padding-left: 14px;
|
|
27007
|
+
font-size: 12px;
|
|
27008
|
+
color: rgba(0, 0, 0, 0.65);
|
|
27009
|
+
}
|
|
27010
|
+
|
|
27011
|
+
.debug-metrics__val--sub {
|
|
27012
|
+
font-size: 12px;
|
|
27013
|
+
color: rgba(0, 0, 0, 0.65);
|
|
27014
|
+
}
|
|
27015
|
+
|
|
26967
27016
|
/* Per-iteration table (verbose). The wrapper scrolls horizontally on its own
|
|
26968
27017
|
so a wide table never forces the whole drawer to scroll sideways. */
|
|
26969
27018
|
.debug-iterations-scroll {
|