@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.
- package/dist/{chunk-YGOJIDL5.cjs → chunk-APM6KBPU.cjs} +114 -97
- package/dist/chunk-APM6KBPU.cjs.map +1 -0
- package/dist/{chunk-OLTGB32E.js → chunk-Z3GQGR5E.js} +23 -6
- package/dist/{chunk-OLTGB32E.js.map → chunk-Z3GQGR5E.js.map} +1 -1
- package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/types/api.types.d.ts +17 -1
- package/dist/components/chat/types/api.types.d.ts.map +1 -1
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/chat/hooks/use-realtime-chunk-processor.ts +53 -6
- package/src/components/chat/types/api.types.ts +23 -1
- package/dist/chunk-YGOJIDL5.cjs.map +0 -1
|
@@ -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 {
|
|
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
|
}
|