@springbrand/chat-client 0.1.3-alpha.23 → 0.1.3-alpha.25
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.25",
|
|
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.31"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"typecheck": "tsc --noEmit"
|
|
@@ -178,6 +178,8 @@ type SharedChatConnectionOptions = {
|
|
|
178
178
|
onMessage?: (message: MessageEvent) => void;
|
|
179
179
|
inboxAgent?: string;
|
|
180
180
|
sessionAgent?: string;
|
|
181
|
+
/** Skip history loading when the caller has just created this Chat. */
|
|
182
|
+
skipInitialMessages?: boolean;
|
|
181
183
|
/** Host projection used only until the selected Session sends its first state. */
|
|
182
184
|
initialTurnActive?: boolean;
|
|
183
185
|
};
|
|
@@ -402,8 +404,9 @@ export function useUniversalAgentChat(): ChatRuntime {
|
|
|
402
404
|
connectionError: sdkConnectionError,
|
|
403
405
|
} = useAgentChat<RuntimeState, ChatMessage>({
|
|
404
406
|
agent: chatAgent,
|
|
405
|
-
getInitialMessages:
|
|
406
|
-
|
|
407
|
+
getInitialMessages: connection.skipInitialMessages
|
|
408
|
+
? null
|
|
409
|
+
: ({ url }) => loadInitialMessages(url, connection.credentials),
|
|
407
410
|
...(connection.credentials === undefined
|
|
408
411
|
? {}
|
|
409
412
|
: { credentials: connection.credentials }),
|
|
@@ -791,16 +794,15 @@ export function useUniversalAgentChat(): ChatRuntime {
|
|
|
791
794
|
}));
|
|
792
795
|
return;
|
|
793
796
|
}
|
|
794
|
-
|
|
795
|
-
?
|
|
797
|
+
await (submissionId
|
|
798
|
+
? agentRef.current.call<{ ok: boolean }>(
|
|
796
799
|
"cancelSubmissionById",
|
|
797
800
|
[submissionId, USER_STOP_REASON],
|
|
798
801
|
)
|
|
799
|
-
:
|
|
802
|
+
: agentRef.current.call<{ ok: boolean }>(
|
|
800
803
|
"stopTurn",
|
|
801
804
|
[undefined, USER_STOP_REASON],
|
|
802
|
-
);
|
|
803
|
-
if (!result.ok) setDispatchError("The active Turn could not be stopped");
|
|
805
|
+
));
|
|
804
806
|
} catch (cause) {
|
|
805
807
|
setDispatchError(
|
|
806
808
|
cause instanceof Error ? cause.message : String(cause),
|