chat 4.20.2 → 4.21.0
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/index.d.ts +331 -319
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/{jsx-runtime-C2ATKxHQ.d.ts → jsx-runtime-DraWieqP.d.ts} +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/docs/api/chat.mdx +2 -0
- package/docs/api/index.mdx +1 -1
- package/docs/api/message.mdx +1 -1
- package/docs/api/postable-message.mdx +1 -1
- package/docs/api/to-ai-messages.mdx +190 -0
- package/docs/contributing/building.mdx +15 -1
- package/docs/guides/code-review-hono.mdx +4 -5
- package/docs/handling-events.mdx +2 -0
- package/docs/posting-messages.mdx +2 -0
- package/docs/streaming.mdx +3 -50
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -236,7 +236,7 @@ async function* fromFullStream(stream) {
|
|
|
236
236
|
needsSeparator = false;
|
|
237
237
|
hasEmittedText = true;
|
|
238
238
|
yield textContent;
|
|
239
|
-
} else if (typed.type === "step
|
|
239
|
+
} else if (typed.type === "finish-step") {
|
|
240
240
|
needsSeparator = true;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
@@ -1907,6 +1907,22 @@ var Chat = class {
|
|
|
1907
1907
|
*/
|
|
1908
1908
|
async shutdown() {
|
|
1909
1909
|
this.logger.info("Shutting down chat instance...");
|
|
1910
|
+
const shutdownPromises = Array.from(this.adapters.values()).map(
|
|
1911
|
+
async (adapter) => {
|
|
1912
|
+
if (!adapter.disconnect) {
|
|
1913
|
+
return;
|
|
1914
|
+
}
|
|
1915
|
+
this.logger.debug("Disconnecting adapter", adapter.name);
|
|
1916
|
+
await adapter.disconnect();
|
|
1917
|
+
this.logger.debug("Adapter disconnected", adapter.name);
|
|
1918
|
+
}
|
|
1919
|
+
);
|
|
1920
|
+
const results = await Promise.allSettled(shutdownPromises);
|
|
1921
|
+
for (const result of results) {
|
|
1922
|
+
if (result.status === "rejected") {
|
|
1923
|
+
this.logger.error("Adapter disconnect failed", result.reason);
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1910
1926
|
await this._stateAdapter.disconnect();
|
|
1911
1927
|
this.initialized = false;
|
|
1912
1928
|
this.initPromise = null;
|