ai 6.0.8 → 6.0.9
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.d.mts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +43 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -898,7 +898,7 @@ import {
|
|
|
898
898
|
} from "@ai-sdk/provider-utils";
|
|
899
899
|
|
|
900
900
|
// src/version.ts
|
|
901
|
-
var VERSION = true ? "6.0.
|
|
901
|
+
var VERSION = true ? "6.0.9" : "0.0.0-test";
|
|
902
902
|
|
|
903
903
|
// src/util/download/download.ts
|
|
904
904
|
var download = async ({ url }) => {
|
|
@@ -11747,6 +11747,46 @@ var AbstractChat = class {
|
|
|
11747
11747
|
}
|
|
11748
11748
|
};
|
|
11749
11749
|
|
|
11750
|
+
// src/ui/direct-chat-transport.ts
|
|
11751
|
+
var DirectChatTransport = class {
|
|
11752
|
+
constructor({
|
|
11753
|
+
agent,
|
|
11754
|
+
options,
|
|
11755
|
+
...uiMessageStreamOptions
|
|
11756
|
+
}) {
|
|
11757
|
+
this.agent = agent;
|
|
11758
|
+
this.agentOptions = options;
|
|
11759
|
+
this.uiMessageStreamOptions = uiMessageStreamOptions;
|
|
11760
|
+
}
|
|
11761
|
+
async sendMessages({
|
|
11762
|
+
messages,
|
|
11763
|
+
abortSignal
|
|
11764
|
+
}) {
|
|
11765
|
+
const validatedMessages = await validateUIMessages({
|
|
11766
|
+
messages,
|
|
11767
|
+
tools: this.agent.tools
|
|
11768
|
+
});
|
|
11769
|
+
const modelMessages = await convertToModelMessages(validatedMessages, {
|
|
11770
|
+
tools: this.agent.tools
|
|
11771
|
+
});
|
|
11772
|
+
const result = await this.agent.stream({
|
|
11773
|
+
prompt: modelMessages,
|
|
11774
|
+
abortSignal,
|
|
11775
|
+
...this.agentOptions !== void 0 ? { options: this.agentOptions } : {}
|
|
11776
|
+
});
|
|
11777
|
+
return result.toUIMessageStream(this.uiMessageStreamOptions);
|
|
11778
|
+
}
|
|
11779
|
+
/**
|
|
11780
|
+
* Direct transport does not support reconnection since there is no
|
|
11781
|
+
* persistent server-side stream to reconnect to.
|
|
11782
|
+
*
|
|
11783
|
+
* @returns Always returns `null`
|
|
11784
|
+
*/
|
|
11785
|
+
async reconnectToStream(_options) {
|
|
11786
|
+
return null;
|
|
11787
|
+
}
|
|
11788
|
+
};
|
|
11789
|
+
|
|
11750
11790
|
// src/ui/last-assistant-message-is-complete-with-approval-responses.ts
|
|
11751
11791
|
function lastAssistantMessageIsCompleteWithApprovalResponses({
|
|
11752
11792
|
messages
|
|
@@ -11830,6 +11870,7 @@ export {
|
|
|
11830
11870
|
APICallError,
|
|
11831
11871
|
AbstractChat,
|
|
11832
11872
|
DefaultChatTransport,
|
|
11873
|
+
DirectChatTransport,
|
|
11833
11874
|
DownloadError,
|
|
11834
11875
|
EmptyResponseBodyError,
|
|
11835
11876
|
ToolLoopAgent as Experimental_Agent,
|