@poolse/react 3.2.0-dev.0 → 3.2.0-dev.1
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -334,6 +334,8 @@ interface MessageStream {
|
|
|
334
334
|
/** The text so far; empty until the first delta. */
|
|
335
335
|
text: string;
|
|
336
336
|
status: 'streaming' | 'failed';
|
|
337
|
+
/** The tool the agent is running right now, if any (cleared by the next text). */
|
|
338
|
+
tool?: string;
|
|
337
339
|
error?: string;
|
|
338
340
|
}
|
|
339
341
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -334,6 +334,8 @@ interface MessageStream {
|
|
|
334
334
|
/** The text so far; empty until the first delta. */
|
|
335
335
|
text: string;
|
|
336
336
|
status: 'streaming' | 'failed';
|
|
337
|
+
/** The tool the agent is running right now, if any (cleared by the next text). */
|
|
338
|
+
tool?: string;
|
|
337
339
|
error?: string;
|
|
338
340
|
}
|
|
339
341
|
/**
|
package/dist/index.js
CHANGED
|
@@ -890,7 +890,11 @@ function useMessageStreams(conversationId) {
|
|
|
890
890
|
status: "streaming"
|
|
891
891
|
};
|
|
892
892
|
let next;
|
|
893
|
-
if (evt.status === "delta")
|
|
893
|
+
if (evt.status === "delta") {
|
|
894
|
+
const { tool: _done, ...rest } = base;
|
|
895
|
+
next = { ...rest, text: base.text + (evt.delta ?? "") };
|
|
896
|
+
} else if (evt.status === "tool")
|
|
897
|
+
next = { ...base, ...evt.tool ? { tool: evt.tool } : {} };
|
|
894
898
|
else if (evt.status === "failed")
|
|
895
899
|
next = { ...base, status: "failed", ...evt.error ? { error: evt.error } : {} };
|
|
896
900
|
else
|