@meshagent/meshagent-tailwind 0.43.1 → 0.43.3
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 +8 -0
- package/dist/cjs/chat/agent-thread.d.ts +15 -0
- package/dist/cjs/chat/agent-thread.js +613 -0
- package/dist/cjs/chat/chat-bot-view.d.ts +3 -2
- package/dist/cjs/chat/chat-bot-view.js +34 -34
- package/dist/cjs/chat/chat-bot-view.test.js +325 -0
- package/dist/cjs/chat/live-chat-widgets.test.js +256 -0
- package/dist/cjs/chat/multi-thread-view.d.ts +3 -2
- package/dist/cjs/chat/multi-thread-view.js +4 -2
- package/dist/cjs/chat/new-chat-thread.d.ts +3 -2
- package/dist/cjs/chat/new-chat-thread.js +5 -2
- package/dist/cjs/file-preview/file-preview.js +2 -2
- package/dist/cjs/index.d.ts +1 -2
- package/dist/cjs/index.js +1 -2
- package/dist/esm/chat/agent-thread.d.ts +15 -0
- package/dist/esm/chat/agent-thread.js +606 -0
- package/dist/esm/chat/chat-bot-view.d.ts +3 -2
- package/dist/esm/chat/chat-bot-view.js +34 -34
- package/dist/esm/chat/chat-bot-view.test.js +336 -0
- package/dist/esm/chat/live-chat-widgets.test.js +262 -0
- package/dist/esm/chat/multi-thread-view.d.ts +3 -2
- package/dist/esm/chat/multi-thread-view.js +4 -2
- package/dist/esm/chat/new-chat-thread.d.ts +3 -2
- package/dist/esm/chat/new-chat-thread.js +5 -2
- package/dist/esm/file-preview/file-preview.js +2 -2
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +1 -2
- package/dist/index.css +1 -1
- package/package.json +10 -5
- package/dist/cjs/chat/chat-thread.d.ts +0 -12
- package/dist/cjs/chat/chat-thread.js +0 -815
- package/dist/cjs/chat/dataset-chat-thread.d.ts +0 -16
- package/dist/cjs/chat/dataset-chat-thread.js +0 -1813
- package/dist/esm/chat/chat-thread.d.ts +0 -12
- package/dist/esm/chat/chat-thread.js +0 -785
- package/dist/esm/chat/dataset-chat-thread.d.ts +0 -16
- package/dist/esm/chat/dataset-chat-thread.js +0 -1811
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
3
|
+
import { StrictMode } from "react";
|
|
4
|
+
import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
5
|
+
import { RoomClient } from "@meshagent/meshagent";
|
|
6
|
+
import {
|
|
7
|
+
ClientToolkitDescription,
|
|
8
|
+
MessagingChatClient,
|
|
9
|
+
agentClientToolCallRequestedType,
|
|
10
|
+
agentTextContentDeltaType,
|
|
11
|
+
agentTurnStartAcceptedType,
|
|
12
|
+
agentTurnStartedType
|
|
13
|
+
} from "@meshagent/meshagent-agents";
|
|
14
|
+
import { AgentThread } from "./agent-thread.js";
|
|
15
|
+
import { ChatBotView, ChatThreadDisplayMode } from "./chat-bot-view.js";
|
|
16
|
+
const REQUIRED_ENV = [
|
|
17
|
+
"MESHAGENT_TOKEN",
|
|
18
|
+
"MESHAGENT_ROOM",
|
|
19
|
+
"RUN_LIVE_WIDGET_TESTS",
|
|
20
|
+
"TEST_AGENT_NAME"
|
|
21
|
+
];
|
|
22
|
+
const missingEnv = REQUIRED_ENV.filter((name) => process.env[name] == null || process.env[name]?.trim() === "");
|
|
23
|
+
const liveDescribe = missingEnv.length === 0 ? describe : describe.skip;
|
|
24
|
+
liveDescribe("Live chat widgets", () => {
|
|
25
|
+
let room;
|
|
26
|
+
let chatClient;
|
|
27
|
+
const observedMessages = [];
|
|
28
|
+
let previousActEnvironment;
|
|
29
|
+
beforeAll(async () => {
|
|
30
|
+
previousActEnvironment = globalThis.IS_REACT_ACT_ENVIRONMENT;
|
|
31
|
+
setReactActEnvironment(false);
|
|
32
|
+
room = new RoomClient();
|
|
33
|
+
await room.start({
|
|
34
|
+
onError: (error) => {
|
|
35
|
+
console.error("live widget room client error", error);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
chatClient = new MessagingChatClient({
|
|
39
|
+
room,
|
|
40
|
+
agentName: process.env.TEST_AGENT_NAME
|
|
41
|
+
});
|
|
42
|
+
void (async () => {
|
|
43
|
+
for await (const event of chatClient.events) {
|
|
44
|
+
observedMessages.push(event.message);
|
|
45
|
+
}
|
|
46
|
+
})();
|
|
47
|
+
await chatClient.start();
|
|
48
|
+
await withTimeout(
|
|
49
|
+
chatClient.waitForAgentParticipant({ waitKey: "live-chat-widget-agent" }),
|
|
50
|
+
3e4,
|
|
51
|
+
`agent participant '${process.env.TEST_AGENT_NAME}' did not appear`
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
afterEach(() => {
|
|
55
|
+
cleanup();
|
|
56
|
+
});
|
|
57
|
+
afterAll(async () => {
|
|
58
|
+
await chatClient?.stop().catch(() => void 0);
|
|
59
|
+
room?.dispose();
|
|
60
|
+
setReactActEnvironment(previousActEnvironment);
|
|
61
|
+
});
|
|
62
|
+
it("renders a live AgentThread pending message and assistant response", async () => {
|
|
63
|
+
const start = await chatClient.startThread({
|
|
64
|
+
message: "Reply with only LIVE_WIDGET_INITIAL_OK.",
|
|
65
|
+
attachments: [],
|
|
66
|
+
senderName: "live-widget-test"
|
|
67
|
+
});
|
|
68
|
+
render(
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
AgentThread,
|
|
71
|
+
{
|
|
72
|
+
room,
|
|
73
|
+
path: start.threadPath,
|
|
74
|
+
chatClient,
|
|
75
|
+
agentName: process.env.TEST_AGENT_NAME
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
await waitForDocumentText("LIVE_WIDGET_INITIAL_OK", "initial assistant response");
|
|
80
|
+
const pendingMessage = `live widget turn ${liveId()}: reply with only LIVE_WIDGET_TURN_OK.`;
|
|
81
|
+
const beforeObservedCount = observedMessages.length;
|
|
82
|
+
fireEvent.change(screen.getByPlaceholderText("Type a message"), {
|
|
83
|
+
target: { value: pendingMessage }
|
|
84
|
+
});
|
|
85
|
+
fireEvent.click(screen.getByTitle("Send"));
|
|
86
|
+
expect(await screen.findByText(pendingMessage)).toBeTruthy();
|
|
87
|
+
await waitForObservedMessage(
|
|
88
|
+
beforeObservedCount,
|
|
89
|
+
(message) => message.type === agentTurnStartAcceptedType && stringValue(message, "threadId") === start.threadPath,
|
|
90
|
+
"widget turn acceptance"
|
|
91
|
+
);
|
|
92
|
+
await waitForObservedMessage(
|
|
93
|
+
beforeObservedCount,
|
|
94
|
+
(message) => message.type === agentTurnStartedType && stringValue(message, "threadId") === start.threadPath,
|
|
95
|
+
"widget turn start"
|
|
96
|
+
);
|
|
97
|
+
await waitForObservedMessage(
|
|
98
|
+
beforeObservedCount,
|
|
99
|
+
(message) => message.type === agentTextContentDeltaType && stringValue(message, "threadId") === start.threadPath,
|
|
100
|
+
"widget turn assistant delta"
|
|
101
|
+
);
|
|
102
|
+
await waitForDocumentText("LIVE_WIDGET_TURN_OK", "turn assistant response");
|
|
103
|
+
}, 18e4);
|
|
104
|
+
it("creates two live threads through ChatBotView and keeps the second selected", async () => {
|
|
105
|
+
const selectedPaths = [];
|
|
106
|
+
render(
|
|
107
|
+
/* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(
|
|
108
|
+
ChatBotView,
|
|
109
|
+
{
|
|
110
|
+
room,
|
|
111
|
+
chatClient,
|
|
112
|
+
agentName: process.env.TEST_AGENT_NAME,
|
|
113
|
+
threadDisplayMode: ChatThreadDisplayMode.MultiThreadComposer,
|
|
114
|
+
threadListPath: `agent://${process.env.TEST_AGENT_NAME}/threads`,
|
|
115
|
+
onSelectedThreadPathChanged: (path) => {
|
|
116
|
+
selectedPaths.push(path);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
) })
|
|
120
|
+
);
|
|
121
|
+
const firstPending = `live widget first thread ${liveId()}: reply with only LIVE_WIDGET_THREAD_ONE_OK.`;
|
|
122
|
+
fireEvent.change(await screen.findByPlaceholderText(`Type a message or @${process.env.TEST_AGENT_NAME}`), {
|
|
123
|
+
target: { value: firstPending }
|
|
124
|
+
});
|
|
125
|
+
fireEvent.click(screen.getByTitle("Send"));
|
|
126
|
+
await waitFor(() => expect(selectedPaths.at(-1)).to.be.a("string").and.not.equal(""), { timeout: 9e4 });
|
|
127
|
+
const firstPath = selectedPaths.at(-1);
|
|
128
|
+
expect(firstPath).to.be.a("string").and.not.equal("");
|
|
129
|
+
expect(await screen.findByText(firstPending)).toBeTruthy();
|
|
130
|
+
await waitForDocumentText("LIVE_WIDGET_THREAD_ONE_OK", "first ChatBotView assistant response");
|
|
131
|
+
fireEvent.click(screen.getByText("New thread"));
|
|
132
|
+
await waitFor(() => expect(selectedPaths.at(-1)).to.equal(null), { timeout: 1e4 });
|
|
133
|
+
const secondPending = `live widget second thread ${liveId()}: reply with only LIVE_WIDGET_THREAD_TWO_OK.`;
|
|
134
|
+
fireEvent.change(await screen.findByPlaceholderText(`Type a message or @${process.env.TEST_AGENT_NAME}`), {
|
|
135
|
+
target: { value: secondPending }
|
|
136
|
+
});
|
|
137
|
+
fireEvent.click(screen.getByTitle("Send"));
|
|
138
|
+
await waitFor(() => {
|
|
139
|
+
expect(selectedPaths.at(-1)).to.be.a("string").and.not.equal("");
|
|
140
|
+
expect(selectedPaths.at(-1)).to.not.equal(firstPath);
|
|
141
|
+
}, { timeout: 9e4 });
|
|
142
|
+
expect(await screen.findByText(secondPending)).toBeTruthy();
|
|
143
|
+
expect(screen.queryByText(firstPending)).to.equal(null);
|
|
144
|
+
await waitForDocumentText("LIVE_WIDGET_THREAD_TWO_OK", "second ChatBotView assistant response");
|
|
145
|
+
}, 24e4);
|
|
146
|
+
it("passes client toolkits from widgets into live turn starts", async () => {
|
|
147
|
+
const start = await chatClient.startThread({
|
|
148
|
+
message: "Reply with only LIVE_WIDGET_TOOL_THREAD_OK.",
|
|
149
|
+
attachments: [],
|
|
150
|
+
senderName: "live-widget-test"
|
|
151
|
+
});
|
|
152
|
+
const clientToolkits = [new ClientToolkitDescription({
|
|
153
|
+
name: "ask_user",
|
|
154
|
+
title: "Ask User",
|
|
155
|
+
description: "Ask the user a short question.",
|
|
156
|
+
inputSchema: {
|
|
157
|
+
type: "object",
|
|
158
|
+
additionalProperties: false,
|
|
159
|
+
required: ["prompt"],
|
|
160
|
+
properties: {
|
|
161
|
+
prompt: { type: "string" }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
})];
|
|
165
|
+
render(
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
AgentThread,
|
|
168
|
+
{
|
|
169
|
+
room,
|
|
170
|
+
path: start.threadPath,
|
|
171
|
+
chatClient,
|
|
172
|
+
agentName: process.env.TEST_AGENT_NAME,
|
|
173
|
+
clientToolkits
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
);
|
|
177
|
+
await waitForDocumentText("LIVE_WIDGET_TOOL_THREAD_OK", "tool setup assistant response");
|
|
178
|
+
const beforeObservedCount = observedMessages.length;
|
|
179
|
+
fireEvent.change(screen.getByPlaceholderText("Type a message"), {
|
|
180
|
+
target: {
|
|
181
|
+
value: "Use the ask_user client tool to ask whether the live widget client toolkit is connected."
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
fireEvent.click(screen.getByTitle("Send"));
|
|
185
|
+
await waitForObservedMessage(
|
|
186
|
+
beforeObservedCount,
|
|
187
|
+
(message) => stringValue(message, "threadId") === start.threadPath && (message.type === agentClientToolCallRequestedType || message.type === agentTextContentDeltaType),
|
|
188
|
+
"widget client toolkit-capable response"
|
|
189
|
+
);
|
|
190
|
+
}, 18e4);
|
|
191
|
+
async function waitForObservedMessage(afterCount, predicate, label, timeoutMs = 9e4) {
|
|
192
|
+
const deadline = Date.now() + timeoutMs;
|
|
193
|
+
while (Date.now() < deadline) {
|
|
194
|
+
const message = observedMessages.slice(afterCount).find(predicate);
|
|
195
|
+
if (message != null) {
|
|
196
|
+
return message;
|
|
197
|
+
}
|
|
198
|
+
await delay(50);
|
|
199
|
+
}
|
|
200
|
+
throw new Error(`${label} was not observed within ${timeoutMs}ms. Observed: ${summarizeMessages(observedMessages)}`);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
if (missingEnv.length > 0) {
|
|
204
|
+
describe("Live chat widgets", () => {
|
|
205
|
+
it(`is skipped unless ${REQUIRED_ENV.join(", ")} are set`, () => {
|
|
206
|
+
expect(missingEnv.length).to.be.greaterThan(0);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
async function waitForDocumentText(text, label, timeoutMs = 9e4) {
|
|
211
|
+
await waitFor(() => {
|
|
212
|
+
expect(document.body.textContent ?? "", label).to.contain(text);
|
|
213
|
+
}, { timeout: timeoutMs });
|
|
214
|
+
}
|
|
215
|
+
async function withTimeout(promise, timeoutMs, label) {
|
|
216
|
+
let timeout;
|
|
217
|
+
try {
|
|
218
|
+
return await Promise.race([
|
|
219
|
+
promise,
|
|
220
|
+
new Promise((_, reject) => {
|
|
221
|
+
timeout = setTimeout(() => reject(new Error(`${label} within ${timeoutMs}ms`)), timeoutMs);
|
|
222
|
+
})
|
|
223
|
+
]);
|
|
224
|
+
} finally {
|
|
225
|
+
if (timeout != null) {
|
|
226
|
+
clearTimeout(timeout);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function stringValue(value, property) {
|
|
231
|
+
if (value == null || typeof value !== "object" || !Object.prototype.hasOwnProperty.call(value, property)) {
|
|
232
|
+
return void 0;
|
|
233
|
+
}
|
|
234
|
+
const item = value[property];
|
|
235
|
+
return typeof item === "string" && item.trim() !== "" ? item : void 0;
|
|
236
|
+
}
|
|
237
|
+
function summarizeMessages(messages) {
|
|
238
|
+
return messages.map((message) => {
|
|
239
|
+
const threadId = stringValue(message, "threadId");
|
|
240
|
+
const source = stringValue(message, "sourceMessageId");
|
|
241
|
+
const turn = stringValue(message, "turnId");
|
|
242
|
+
return [message.type, threadId == null ? void 0 : `thread=${threadId}`, source == null ? void 0 : `source=${source}`, turn == null ? void 0 : `turn=${turn}`].filter((part) => part != null).join(" ");
|
|
243
|
+
}).join(", ");
|
|
244
|
+
}
|
|
245
|
+
function setReactActEnvironment(value) {
|
|
246
|
+
Object.defineProperty(globalThis, "IS_REACT_ACT_ENVIRONMENT", {
|
|
247
|
+
configurable: true,
|
|
248
|
+
writable: true,
|
|
249
|
+
value
|
|
250
|
+
});
|
|
251
|
+
Object.defineProperty(window, "IS_REACT_ACT_ENVIRONMENT", {
|
|
252
|
+
configurable: true,
|
|
253
|
+
writable: true,
|
|
254
|
+
value
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
function liveId() {
|
|
258
|
+
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
259
|
+
}
|
|
260
|
+
function delay(ms) {
|
|
261
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
262
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
2
|
import { RoomClient } from "@meshagent/meshagent";
|
|
3
|
-
import type { BaseChatClient } from "@meshagent/meshagent-agents";
|
|
3
|
+
import type { BaseChatClient, ClientToolkitDescription } from "@meshagent/meshagent-agents";
|
|
4
4
|
export type MultiThreadContentBuilder = (threadPath: string) => ReactElement;
|
|
5
5
|
export interface MultiThreadViewProps {
|
|
6
6
|
room: RoomClient;
|
|
@@ -17,5 +17,6 @@ export interface MultiThreadViewProps {
|
|
|
17
17
|
centerComposer?: boolean;
|
|
18
18
|
emptyStateTitle?: string;
|
|
19
19
|
emptyStateDescription?: string;
|
|
20
|
+
clientToolkits?: ClientToolkitDescription[];
|
|
20
21
|
}
|
|
21
|
-
export declare function MultiThreadView({ room, chatClient, disposeChatClient, agentName, builder, toolkit, tool, selectedThreadPath, onSelectedThreadPathChanged, onSelectedThreadResolved, newThreadResetVersion, centerComposer, emptyStateTitle, emptyStateDescription, }: MultiThreadViewProps): ReactElement;
|
|
22
|
+
export declare function MultiThreadView({ room, chatClient, disposeChatClient, agentName, builder, toolkit, tool, selectedThreadPath, onSelectedThreadPathChanged, onSelectedThreadResolved, newThreadResetVersion, centerComposer, emptyStateTitle, emptyStateDescription, clientToolkits, }: MultiThreadViewProps): ReactElement;
|
|
@@ -19,7 +19,8 @@ function MultiThreadView({
|
|
|
19
19
|
newThreadResetVersion = 0,
|
|
20
20
|
centerComposer = true,
|
|
21
21
|
emptyStateTitle = "Start a new thread",
|
|
22
|
-
emptyStateDescription = "Connect with this agent and your team"
|
|
22
|
+
emptyStateDescription = "Connect with this agent and your team",
|
|
23
|
+
clientToolkits
|
|
23
24
|
}) {
|
|
24
25
|
const controlledSelectedThreadPath = selectedThreadPath !== void 0 ? normalizeSelectedThreadPath(selectedThreadPath) : void 0;
|
|
25
26
|
const [internalSelectedThreadPath, setInternalSelectedThreadPath] = useState(() => controlledSelectedThreadPath ?? null);
|
|
@@ -67,7 +68,8 @@ function MultiThreadView({
|
|
|
67
68
|
onSelectedThreadResolved?.(normalizedPath, displayName);
|
|
68
69
|
},
|
|
69
70
|
emptyStateTitle,
|
|
70
|
-
emptyStateDescription
|
|
71
|
+
emptyStateDescription,
|
|
72
|
+
clientToolkits
|
|
71
73
|
},
|
|
72
74
|
composerKey
|
|
73
75
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
2
|
import { RoomClient } from "@meshagent/meshagent";
|
|
3
|
-
import type { BaseChatClient } from "@meshagent/meshagent-agents";
|
|
3
|
+
import type { BaseChatClient, ClientToolkitDescription } from "@meshagent/meshagent-agents";
|
|
4
4
|
export type NewChatThreadBuilder = (threadPath: string) => ReactElement;
|
|
5
5
|
export interface NewChatThreadProps {
|
|
6
6
|
room: RoomClient;
|
|
@@ -16,5 +16,6 @@ export interface NewChatThreadProps {
|
|
|
16
16
|
centerComposer?: boolean;
|
|
17
17
|
emptyStateTitle?: string;
|
|
18
18
|
emptyStateDescription?: string;
|
|
19
|
+
clientToolkits?: ClientToolkitDescription[];
|
|
19
20
|
}
|
|
20
|
-
export declare function NewChatThread({ room, chatClient, disposeChatClient, agentName, builder, selectedThreadPath, onThreadPathChanged, onThreadResolved, centerComposer, emptyStateTitle, emptyStateDescription, }: NewChatThreadProps): ReactElement;
|
|
21
|
+
export declare function NewChatThread({ room, chatClient, disposeChatClient, agentName, builder, selectedThreadPath, onThreadPathChanged, onThreadResolved, centerComposer, emptyStateTitle, emptyStateDescription, clientToolkits, }: NewChatThreadProps): ReactElement;
|
|
@@ -75,7 +75,8 @@ function NewChatThread({
|
|
|
75
75
|
onThreadResolved,
|
|
76
76
|
centerComposer = true,
|
|
77
77
|
emptyStateTitle,
|
|
78
|
-
emptyStateDescription
|
|
78
|
+
emptyStateDescription,
|
|
79
|
+
clientToolkits
|
|
79
80
|
}) {
|
|
80
81
|
const [internalThreadPath, setInternalThreadPath] = useState(null);
|
|
81
82
|
const [newThreadDraft, setNewThreadDraft] = useState("");
|
|
@@ -170,7 +171,8 @@ function NewChatThread({
|
|
|
170
171
|
const result = await activeChatClient.startThread({
|
|
171
172
|
message: text,
|
|
172
173
|
attachments: newThreadAttachments.map((attachment) => attachment.path),
|
|
173
|
-
senderName: getParticipantName(room.localParticipant) || void 0
|
|
174
|
+
senderName: getParticipantName(room.localParticipant) || void 0,
|
|
175
|
+
clientToolkits
|
|
174
176
|
});
|
|
175
177
|
ensureOperationActive(operationId, activeOperationRef);
|
|
176
178
|
const threadPath = result.threadPath;
|
|
@@ -202,6 +204,7 @@ function NewChatThread({
|
|
|
202
204
|
creatingNewThread,
|
|
203
205
|
newThreadAttachments,
|
|
204
206
|
newThreadDraft,
|
|
207
|
+
clientToolkits,
|
|
205
208
|
onThreadPathChanged,
|
|
206
209
|
onThreadResolved,
|
|
207
210
|
room,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { Button } from "../components/ui/button.js";
|
|
16
16
|
import { Spinner } from "../components/ui/spinner.js";
|
|
17
17
|
import { cn } from "../lib/utils.js";
|
|
18
|
-
import {
|
|
18
|
+
import { AgentThread } from "../chat/agent-thread.js";
|
|
19
19
|
pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
|
|
20
20
|
var FileKind = /* @__PURE__ */ ((FileKind2) => {
|
|
21
21
|
FileKind2["Image"] = "image";
|
|
@@ -490,7 +490,7 @@ function FilePreview({ room, path }) {
|
|
|
490
490
|
case "source" /* Source */:
|
|
491
491
|
return /* @__PURE__ */ jsx(SourcePreview, { room, path });
|
|
492
492
|
case "thread" /* Thread */:
|
|
493
|
-
return /* @__PURE__ */ jsx(
|
|
493
|
+
return /* @__PURE__ */ jsx(AgentThread, { room, path });
|
|
494
494
|
case "unknown" /* Unknown */:
|
|
495
495
|
return /* @__PURE__ */ jsx(UnsupportedPreview, { room, path });
|
|
496
496
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,13 +2,12 @@ export * from './chat/chat-bot-view.js';
|
|
|
2
2
|
export * from './chat/chat-hooks.js';
|
|
3
3
|
export * from './chat/chat-input.js';
|
|
4
4
|
export * from './chat/chat-message.js';
|
|
5
|
-
export * from './chat/chat-thread.js';
|
|
6
5
|
export * from './chat/chat-typing-indicator.js';
|
|
7
6
|
export * from './chat/conversation-descriptor.js';
|
|
8
|
-
export * from './chat/dataset-chat-thread.js';
|
|
9
7
|
export * from './chat/file-attachment.js';
|
|
10
8
|
export * from './chat/file-uploader.js';
|
|
11
9
|
export * from './chat/multi-thread-view.js';
|
|
10
|
+
export * from './chat/agent-thread.js';
|
|
12
11
|
export * from './chat/new-chat-thread.js';
|
|
13
12
|
export * from './file-preview/file-preview.js';
|
|
14
13
|
export * from './forms/email-address.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -2,13 +2,12 @@ export * from "./chat/chat-bot-view.js";
|
|
|
2
2
|
export * from "./chat/chat-hooks.js";
|
|
3
3
|
export * from "./chat/chat-input.js";
|
|
4
4
|
export * from "./chat/chat-message.js";
|
|
5
|
-
export * from "./chat/chat-thread.js";
|
|
6
5
|
export * from "./chat/chat-typing-indicator.js";
|
|
7
6
|
export * from "./chat/conversation-descriptor.js";
|
|
8
|
-
export * from "./chat/dataset-chat-thread.js";
|
|
9
7
|
export * from "./chat/file-attachment.js";
|
|
10
8
|
export * from "./chat/file-uploader.js";
|
|
11
9
|
export * from "./chat/multi-thread-view.js";
|
|
10
|
+
export * from "./chat/agent-thread.js";
|
|
12
11
|
export * from "./chat/new-chat-thread.js";
|
|
13
12
|
export * from "./file-preview/file-preview.js";
|
|
14
13
|
export * from "./forms/email-address.js";
|