blun-king-cli 9.1.237 → 9.1.238

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.
@@ -1,13 +1,39 @@
1
1
  'use strict';
2
2
 
3
+ const STEP_END_LIVE_ONLY_FIELDS = [
4
+ 'llmFirstTokenLatencyMs',
5
+ 'llmStreamDurationMs',
6
+ 'llmRequestBuildMs',
7
+ 'llmServerFirstTokenMs',
8
+ 'llmServerDecodeMs',
9
+ 'llmClientConsumeMs',
10
+ 'messageId',
11
+ ];
12
+
13
+ function hasOwn(object, key) {
14
+ return Object.prototype.hasOwnProperty.call(object, key);
15
+ }
16
+
3
17
  function projectLoopEventForRecord(event) {
4
- if (
5
- event?.type !== 'tool.call'
6
- || (!Object.prototype.hasOwnProperty.call(event, 'display')
7
- && !Object.prototype.hasOwnProperty.call(event, 'description'))
8
- ) return event;
18
+ if (event?.type === 'tool.call' && (hasOwn(event, 'display') || hasOwn(event, 'description'))) {
19
+ const { display: _display, description: _description, ...recordedEvent } = event;
20
+ return recordedEvent;
21
+ }
22
+
23
+ if (event?.type !== 'step.end' || !STEP_END_LIVE_ONLY_FIELDS.some((field) => hasOwn(event, field))) {
24
+ return event;
25
+ }
9
26
 
10
- const { display: _display, description: _description, ...recordedEvent } = event;
27
+ const {
28
+ llmFirstTokenLatencyMs: _llmFirstTokenLatencyMs,
29
+ llmStreamDurationMs: _llmStreamDurationMs,
30
+ llmRequestBuildMs: _llmRequestBuildMs,
31
+ llmServerFirstTokenMs: _llmServerFirstTokenMs,
32
+ llmServerDecodeMs: _llmServerDecodeMs,
33
+ llmClientConsumeMs: _llmClientConsumeMs,
34
+ messageId: _messageId,
35
+ ...recordedEvent
36
+ } = event;
11
37
  return recordedEvent;
12
38
  }
13
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.237",
3
+ "version": "9.1.238",
4
4
  "description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
5
5
  "license": "MIT",
6
6
  "bin": {