blun-king-cli 9.1.242 → 9.1.243

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.
@@ -9,6 +9,7 @@ const STEP_END_LIVE_ONLY_FIELDS = [
9
9
  'llmClientConsumeMs',
10
10
  'messageId',
11
11
  ];
12
+ const STEP_END_ROUTINE_FINISH_REASONS = new Set(['tool_use', 'end_turn']);
12
13
 
13
14
  function hasOwn(object, key) {
14
15
  return Object.prototype.hasOwnProperty.call(object, key);
@@ -54,11 +55,13 @@ function projectLoopEventForRecord(event) {
54
55
  return recordedEvent;
55
56
  }
56
57
 
58
+ const hasRoutineFinishReason = STEP_END_ROUTINE_FINISH_REASONS.has(event?.finishReason);
57
59
  if (
58
60
  event?.type !== 'step.end' ||
59
61
  (
60
62
  !hasOwn(event, 'turnId') &&
61
63
  !hasOwn(event, 'step') &&
64
+ !hasRoutineFinishReason &&
62
65
  !STEP_END_LIVE_ONLY_FIELDS.some((field) => hasOwn(event, field))
63
66
  )
64
67
  ) {
@@ -77,7 +80,9 @@ function projectLoopEventForRecord(event) {
77
80
  messageId: _messageId,
78
81
  ...recordedEvent
79
82
  } = event;
80
- return recordedEvent;
83
+ if (!hasRoutineFinishReason) return recordedEvent;
84
+ const { finishReason: _finishReason, ...withoutRoutineFinishReason } = recordedEvent;
85
+ return withoutRoutineFinishReason;
81
86
  }
82
87
 
83
88
  module.exports = { projectLoopEventForRecord };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.242",
3
+ "version": "9.1.243",
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": {