@springbrand/chat-client 0.1.3-alpha.12 → 0.1.3-alpha.13
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@springbrand/chat-client",
|
|
3
|
-
"version": "0.1.3-alpha.
|
|
3
|
+
"version": "0.1.3-alpha.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@types/react-dom": "^19.2.3",
|
|
26
26
|
"react-dom": "^19.2.7",
|
|
27
27
|
"typescript": "^7.0.2",
|
|
28
|
-
"@springbrand/agent-runtime": "0.2.0-alpha.
|
|
28
|
+
"@springbrand/agent-runtime": "0.2.0-alpha.22"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"typecheck": "tsc --noEmit"
|
|
@@ -148,6 +148,8 @@ type SharedChatConnectionOptions = {
|
|
|
148
148
|
protocols?: string | string[];
|
|
149
149
|
inboxAgent?: string;
|
|
150
150
|
sessionAgent?: string;
|
|
151
|
+
/** Host projection used only until the selected Session sends its first state. */
|
|
152
|
+
initialTurnActive?: boolean;
|
|
151
153
|
};
|
|
152
154
|
|
|
153
155
|
export type ChatConnectionOptions = SharedChatConnectionOptions & (
|
|
@@ -384,9 +386,12 @@ export function useUniversalAgentChat(
|
|
|
384
386
|
? "streaming"
|
|
385
387
|
: "submitted"
|
|
386
388
|
: normalizedSdkStatus;
|
|
389
|
+
const hydratingTurnActive = facetState === undefined &&
|
|
390
|
+
connection.initialTurnActive === true;
|
|
387
391
|
const status = dispatchError
|
|
388
392
|
? "error"
|
|
389
|
-
: optimisticMessages.length > 0
|
|
393
|
+
: (optimisticMessages.length > 0 || hydratingTurnActive) &&
|
|
394
|
+
authoritativeStatus === "ready"
|
|
390
395
|
? "submitted"
|
|
391
396
|
: authoritativeStatus;
|
|
392
397
|
const messagesRef = useRef(messages);
|
|
@@ -478,7 +483,8 @@ export function useUniversalAgentChat(
|
|
|
478
483
|
isToolContinuation;
|
|
479
484
|
const pendingLocalTurn = optimisticMessages.length > 0 &&
|
|
480
485
|
(status === "submitted" || status === "streaming");
|
|
481
|
-
const turnActive =
|
|
486
|
+
const turnActive = hydratingTurnActive ||
|
|
487
|
+
Boolean(turn?.activeSubmissionId) ||
|
|
482
488
|
pendingLocalTurn ||
|
|
483
489
|
(authoritativeTurn === undefined && sdkTurnActive);
|
|
484
490
|
const canSteer = turnActive &&
|