@flamingo-stack/openframe-frontend-core 0.0.206 → 0.0.207

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.
@@ -5,7 +5,13 @@
5
5
 
6
6
  import type { ChunkData, NatsMessageType, FetchChunksFunction } from './network.types'
7
7
  import type { ChatType, ChatApprovalStatus } from './chat.types'
8
- import type { MessageSegment, PendingToolCallData, TokenUsageData, ExecutingToolState } from './message.types'
8
+ import type {
9
+ MessageSegment,
10
+ PendingToolCallData,
11
+ TokenUsageData,
12
+ ExecutingToolState,
13
+ ToolExecutionSegment,
14
+ } from './message.types'
9
15
 
10
16
  // ========== Hook Options ==========
11
17
 
@@ -169,6 +175,22 @@ export interface RealtimeChunkCallbacks {
169
175
  onEscalatedApproval?: (requestId: string, data: { command: string; explanation?: string; approvalType: string }) => void
170
176
  /** Called when an escalated approval result is received */
171
177
  onEscalatedApprovalResult?: (requestId: string, approved: boolean, data: { command: string; explanation?: string; approvalType: string }) => void
178
+ /**
179
+ * Called whenever an `APPROVAL_RESULT` chunk is processed. Fires in addition
180
+ * to the accumulator's in-message status flip so consumers can find the
181
+ * matching `approval_request` / `approval_batch` segment in an *earlier*
182
+ * message bubble (e.g. when a user-interrupted approval is resolved while
183
+ * a new assistant message is streaming). Idempotent — safe to no-op if no
184
+ * matching segment is found dialog-wide.
185
+ */
186
+ onApprovalResolved?: (requestId: string, status: ChatApprovalStatus, approvalType: string) => void
187
+ /**
188
+ * Called whenever an `EXECUTED_TOOL` chunk is processed. Lets consumers
189
+ * merge the result into the originating `EXECUTING_TOOL` (or batch
190
+ * `executions[execId]`) segment in an earlier message bubble when the tool
191
+ * outlived its message scope. Idempotent.
192
+ */
193
+ onToolExecuted?: (segment: ToolExecutionSegment) => void
172
194
  /** Called when a DIALOG_CLOSED chunk is received */
173
195
  onDialogClosed?: () => void
174
196
  }