@springbrand/chat-client 0.1.3-alpha.10 → 0.1.3-alpha.11
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.11",
|
|
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.19"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"typecheck": "tsc --noEmit"
|
|
@@ -18,6 +18,7 @@ import { createSafeUIMessageAgentConnection } from "./ui-message-stream-guard";
|
|
|
18
18
|
import { CURRENT_INBOX_AGENT_PATH } from "./chat-sessions";
|
|
19
19
|
|
|
20
20
|
type ChatMessageMetadata = Record<string, unknown> & {
|
|
21
|
+
error?: string;
|
|
21
22
|
requestedCapabilities?: readonly RequestedCapability[];
|
|
22
23
|
turnStatus?: string;
|
|
23
24
|
};
|
|
@@ -364,6 +365,14 @@ export function useUniversalAgentChat(
|
|
|
364
365
|
? "ready"
|
|
365
366
|
: sdkStatus;
|
|
366
367
|
const sdkError = stoppedByUser || hasTerminalMessage ? undefined : error;
|
|
368
|
+
const runtimeError = dispatchError ?? sdkError ?? connectionError ?? undefined;
|
|
369
|
+
const runtimeErrorMessage = runtimeError instanceof Error
|
|
370
|
+
? runtimeError.message
|
|
371
|
+
: runtimeError;
|
|
372
|
+
const presentationError = latestTurnStatus === "error" &&
|
|
373
|
+
latestMessage?.metadata?.error === runtimeErrorMessage
|
|
374
|
+
? undefined
|
|
375
|
+
: runtimeError;
|
|
367
376
|
// RPC admissions bypass useChat's request lifecycle. Project the durable
|
|
368
377
|
// Turn here so presentation stays correct without a second send path.
|
|
369
378
|
const authoritativeStatus =
|
|
@@ -771,8 +780,7 @@ export function useUniversalAgentChat(
|
|
|
771
780
|
status,
|
|
772
781
|
runtimeLoad: facetState?.runtimeLoad,
|
|
773
782
|
isStreaming,
|
|
774
|
-
error:
|
|
775
|
-
connectionError ?? undefined,
|
|
783
|
+
error: presentationError,
|
|
776
784
|
sendText,
|
|
777
785
|
steerText,
|
|
778
786
|
enqueueText,
|