@tanstack/ai-client 0.23.2 → 0.23.3
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/esm/chat-client.d.ts +3 -6
- package/dist/esm/chat-client.js +7 -9
- package/dist/esm/chat-client.js.map +1 -1
- package/dist/esm/connection-adapters.js +9 -7
- package/dist/esm/connection-adapters.js.map +1 -1
- package/dist/esm/devtools.js +7 -4
- package/dist/esm/devtools.js.map +1 -1
- package/dist/esm/generation-client.js +0 -1
- package/dist/esm/generation-client.js.map +1 -1
- package/dist/esm/generation-types.js.map +1 -1
- package/dist/esm/video-generation-client.js +0 -1
- package/dist/esm/video-generation-client.js.map +1 -1
- package/package.json +4 -4
- package/src/chat-client.ts +12 -21
|
@@ -352,12 +352,9 @@ export declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = an
|
|
|
352
352
|
* ```
|
|
353
353
|
*/
|
|
354
354
|
sendMessage(content: string | MultimodalContent, body?: Record<string, any>, sendOptions?: SendMessageOptions): Promise<void>;
|
|
355
|
-
/**
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
* continued do not block a later turn once the resume stream has cleared
|
|
359
|
-
* resume state.
|
|
360
|
-
*/
|
|
355
|
+
/** True while interrupt descriptors still own continuation. */
|
|
356
|
+
private hasPendingInterrupts;
|
|
357
|
+
/** True while an interrupt batch owns the next user turn. */
|
|
361
358
|
private hasBlockingInterrupts;
|
|
362
359
|
/** True while a stream is active, a send is claiming the client, or the queue is draining. */
|
|
363
360
|
private isSendBusy;
|
package/dist/esm/chat-client.js
CHANGED
|
@@ -1038,16 +1038,13 @@ var ChatClient = class {
|
|
|
1038
1038
|
this.sendInFlight = false;
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
|
-
/**
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
*/
|
|
1041
|
+
/** True while interrupt descriptors still own continuation. */
|
|
1042
|
+
hasPendingInterrupts() {
|
|
1043
|
+
return this.interruptManager.getDescriptors().length > 0;
|
|
1044
|
+
}
|
|
1045
|
+
/** True while an interrupt batch owns the next user turn. */
|
|
1047
1046
|
hasBlockingInterrupts() {
|
|
1048
|
-
|
|
1049
|
-
if (this.activeInterruptSubmission) return true;
|
|
1050
|
-
return this.interruptManager.getInterrupts().some((item) => item.status === "pending" || item.status === "validating" || item.status === "error" || item.status === "staged");
|
|
1047
|
+
return this.activeInterruptSubmission !== void 0 || this.hasPendingInterrupts();
|
|
1051
1048
|
}
|
|
1052
1049
|
/** True while a stream is active, a send is claiming the client, or the queue is draining. */
|
|
1053
1050
|
isSendBusy() {
|
|
@@ -1445,6 +1442,7 @@ var ChatClient = class {
|
|
|
1445
1442
|
* Check if we should continue the flow and do so if needed
|
|
1446
1443
|
*/
|
|
1447
1444
|
async checkForContinuation() {
|
|
1445
|
+
if (this.hasPendingInterrupts()) return;
|
|
1448
1446
|
if (this.continuationPending || this.isLoading) {
|
|
1449
1447
|
this.continuationSkipped = true;
|
|
1450
1448
|
return;
|