@meshagent/meshagent-tailwind 0.42.0 → 0.43.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/chat/chat-bot-view.d.ts +6 -3
  3. package/dist/cjs/chat/chat-bot-view.js +159 -32
  4. package/dist/cjs/chat/chat-hooks.d.ts +2 -2
  5. package/dist/cjs/chat/chat-hooks.js +1 -1
  6. package/dist/cjs/chat/chat-input.d.ts +2 -2
  7. package/dist/cjs/chat/chat-input.js +6 -6
  8. package/dist/cjs/chat/chat-thread.js +7 -7
  9. package/dist/cjs/chat/chat-typing-indicator.js +2 -2
  10. package/dist/cjs/chat/conversation-descriptor.js +6 -0
  11. package/dist/cjs/chat/dataset-chat-thread.js +8 -8
  12. package/dist/cjs/chat/file-uploader.js +1 -1
  13. package/dist/cjs/chat/multi-thread-view.js +1 -1
  14. package/dist/cjs/chat/new-chat-thread.js +3 -3
  15. package/dist/cjs/chat/upload-pill.d.ts +1 -1
  16. package/dist/cjs/chat/upload-pill.js +3 -3
  17. package/dist/cjs/components/pane-example.js +3 -3
  18. package/dist/cjs/components/ui/avatar.js +1 -1
  19. package/dist/cjs/components/ui/button.d.ts +1 -1
  20. package/dist/cjs/components/ui/button.js +1 -1
  21. package/dist/cjs/components/ui/card.js +1 -1
  22. package/dist/cjs/components/ui/dialog.js +1 -1
  23. package/dist/cjs/components/ui/form.js +2 -2
  24. package/dist/cjs/components/ui/input.js +1 -1
  25. package/dist/cjs/components/ui/label.js +1 -1
  26. package/dist/cjs/components/ui/progress.js +1 -1
  27. package/dist/cjs/components/ui/radio-group.js +1 -1
  28. package/dist/cjs/components/ui/select.js +1 -1
  29. package/dist/cjs/components/ui/sheet.js +1 -1
  30. package/dist/cjs/components/ui/skeleton.js +1 -1
  31. package/dist/cjs/components/ui/spinner.js +1 -1
  32. package/dist/cjs/components/ui/textarea.js +1 -1
  33. package/dist/cjs/file-preview/file-preview.js +5 -5
  34. package/dist/cjs/forms/form.js +6 -6
  35. package/dist/cjs/forms/multi-select-autocomplete.js +1 -1
  36. package/dist/cjs/forms/select-users-dialog.js +3 -3
  37. package/dist/cjs/forms/select-users.d.ts +1 -1
  38. package/dist/cjs/forms/select-users.js +2 -2
  39. package/dist/cjs/index.d.ts +19 -19
  40. package/dist/cjs/index.js +19 -19
  41. package/dist/cjs/meetings/controls.d.ts +1 -1
  42. package/dist/cjs/meetings/controls.js +7 -7
  43. package/dist/cjs/meetings/lobby.d.ts +1 -1
  44. package/dist/cjs/meetings/lobby.js +7 -7
  45. package/dist/cjs/meetings/meeting-scope.js +1 -1
  46. package/dist/cjs/meetings/meeting-view.d.ts +1 -1
  47. package/dist/cjs/meetings/meeting-view.js +66 -9
  48. package/dist/cjs/meetings/meetings.d.ts +8 -8
  49. package/dist/cjs/meetings/meetings.js +8 -8
  50. package/dist/cjs/meetings/participants.d.ts +1 -1
  51. package/dist/cjs/meetings/participants.js +3 -3
  52. package/dist/cjs/package.json +1 -0
  53. package/dist/cjs/tools/ask-user-for-file.js +1 -1
  54. package/dist/cjs/tools/ask-user.js +1 -1
  55. package/dist/cjs/tools/file-dialog.js +2 -2
  56. package/dist/cjs/tools/form-dialog.d.ts +1 -1
  57. package/dist/cjs/tools/form-dialog.js +3 -3
  58. package/dist/cjs/tools/form.d.ts +1 -1
  59. package/dist/cjs/tools/form.js +1 -1
  60. package/dist/cjs/tools/ui-toolkit.js +4 -4
  61. package/dist/esm/chat/chat-bot-view.d.ts +6 -3
  62. package/dist/esm/chat/chat-bot-view.js +163 -32
  63. package/dist/esm/chat/chat-hooks.d.ts +2 -2
  64. package/dist/esm/chat/chat-hooks.js +1 -1
  65. package/dist/esm/chat/chat-input.d.ts +2 -2
  66. package/dist/esm/chat/chat-input.js +6 -6
  67. package/dist/esm/chat/chat-thread.js +7 -7
  68. package/dist/esm/chat/chat-typing-indicator.js +2 -2
  69. package/dist/esm/chat/conversation-descriptor.js +6 -0
  70. package/dist/esm/chat/dataset-chat-thread.js +8 -8
  71. package/dist/esm/chat/file-uploader.js +1 -1
  72. package/dist/esm/chat/multi-thread-view.js +1 -1
  73. package/dist/esm/chat/new-chat-thread.js +3 -3
  74. package/dist/esm/chat/upload-pill.d.ts +1 -1
  75. package/dist/esm/chat/upload-pill.js +3 -3
  76. package/dist/esm/components/pane-example.js +3 -3
  77. package/dist/esm/components/ui/avatar.js +1 -1
  78. package/dist/esm/components/ui/button.js +1 -1
  79. package/dist/esm/components/ui/card.js +1 -1
  80. package/dist/esm/components/ui/dialog.js +1 -1
  81. package/dist/esm/components/ui/form.js +2 -2
  82. package/dist/esm/components/ui/input.js +1 -1
  83. package/dist/esm/components/ui/label.js +1 -1
  84. package/dist/esm/components/ui/progress.js +1 -1
  85. package/dist/esm/components/ui/radio-group.js +1 -1
  86. package/dist/esm/components/ui/select.js +1 -1
  87. package/dist/esm/components/ui/sheet.js +1 -1
  88. package/dist/esm/components/ui/skeleton.js +1 -1
  89. package/dist/esm/components/ui/spinner.js +1 -1
  90. package/dist/esm/components/ui/textarea.js +1 -1
  91. package/dist/esm/file-preview/file-preview.js +5 -5
  92. package/dist/esm/forms/form.js +6 -6
  93. package/dist/esm/forms/multi-select-autocomplete.js +1 -1
  94. package/dist/esm/forms/select-users-dialog.js +3 -3
  95. package/dist/esm/forms/select-users.d.ts +1 -1
  96. package/dist/esm/forms/select-users.js +2 -2
  97. package/dist/esm/index.d.ts +19 -19
  98. package/dist/esm/index.js +19 -19
  99. package/dist/esm/meetings/controls.d.ts +1 -1
  100. package/dist/esm/meetings/controls.js +8 -8
  101. package/dist/esm/meetings/lobby.d.ts +1 -1
  102. package/dist/esm/meetings/lobby.js +7 -7
  103. package/dist/esm/meetings/meeting-scope.js +1 -1
  104. package/dist/esm/meetings/meeting-view.d.ts +1 -1
  105. package/dist/esm/meetings/meeting-view.js +66 -9
  106. package/dist/esm/meetings/meetings.d.ts +8 -8
  107. package/dist/esm/meetings/meetings.js +8 -8
  108. package/dist/esm/meetings/participants.d.ts +1 -1
  109. package/dist/esm/meetings/participants.js +3 -3
  110. package/dist/esm/tools/ask-user-for-file.js +1 -1
  111. package/dist/esm/tools/ask-user.js +1 -1
  112. package/dist/esm/tools/file-dialog.js +2 -2
  113. package/dist/esm/tools/form-dialog.d.ts +1 -1
  114. package/dist/esm/tools/form-dialog.js +3 -3
  115. package/dist/esm/tools/form.d.ts +1 -1
  116. package/dist/esm/tools/form.js +1 -1
  117. package/dist/esm/tools/ui-toolkit.js +4 -4
  118. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [0.43.0]
2
+ - Split LiveKit helpers into `@meshagent/meshagent-livekit-ts` and added `@meshagent/meshagent-node-ts` for room websocket proxying and room-connect helpers.
3
+ - Updated `meshagent-ts` exports for ESM-aware resolution, moved LiveKit out of the core package, and added `RoomClient.withIAP()` and `WebSocketClientProtocol.withIAP()` for the new room-connect flow.
4
+ - Room websocket auth now uses bearer headers on Node and `meshagent-room.` subprotocol tokens in the browser, and the agents/thread APIs now carry backend metadata and attachment-aware prompts.
5
+ - React/auth/dev/tailwind packages now publish CJS main entries alongside ESM builds, and the new LiveKit package depends on `livekit-client@^2.15.5`.
6
+
7
+ ## [0.42.2]
8
+ - Added `ContainerExitStatus`, `RoomContainerStats`, and published build image metadata to the TypeScript container client models.
9
+ - Added `waitForExitStatus` while keeping `waitForExit` as the exit-code convenience wrapper.
10
+ - Container list parsing now preserves image IDs, runtime stats, and exit-status metadata from API responses.
11
+
12
+ ## [0.42.1]
13
+ - Stability
14
+
1
15
  ## [0.42.0]
2
16
  - Added project lookup by key.
3
17
  - Container and room APIs now return structured `containerPort`/`hostPort` entries instead of integer port lists, which is a breaking response-shape change.
@@ -1,9 +1,12 @@
1
1
  import type { ReactElement } from "react";
2
2
  import { Participant, RoomClient } from "@meshagent/meshagent";
3
- import { ChatThreadDisplayMode } from "./conversation-descriptor";
4
- export { ChatThreadDisplayMode, chatDocumentPath, resolvedThreadListPath, } from "./conversation-descriptor";
3
+ import type { BaseChatClient } from "@meshagent/meshagent-agents";
4
+ import { ChatThreadDisplayMode } from "./conversation-descriptor.js";
5
+ export { ChatThreadDisplayMode, chatDocumentPath, resolvedThreadListPath, } from "./conversation-descriptor.js";
5
6
  export interface ChatBotViewProps {
6
7
  room: RoomClient;
8
+ chatClient?: BaseChatClient;
9
+ disposeChatClient?: boolean;
7
10
  path?: string;
8
11
  documentPath?: string;
9
12
  participants?: Participant[];
@@ -28,4 +31,4 @@ export interface ChatBotViewProps {
28
31
  threadListWidth?: number;
29
32
  threadListCollapsedHeight?: number;
30
33
  }
31
- export declare function ChatBotView({ room, path, documentPath, participants, agentName, threadDisplayMode, threadDir, threadListPath, toolkit, tool, centerComposer, emptyStateTitle, emptyStateDescription, startNewThreadTitle, startNewThreadDescription, selectedThreadPath, onSelectedThreadPathChanged, onSelectedThreadResolved, onThreadResolved, newThreadResetVersion, showThreadList, threadListWidth, threadListCollapsedHeight, }: ChatBotViewProps): ReactElement;
34
+ export declare function ChatBotView({ room, chatClient, disposeChatClient, path, documentPath, participants, agentName, threadDisplayMode, threadDir, threadListPath, toolkit, tool, centerComposer, emptyStateTitle, emptyStateDescription, startNewThreadTitle, startNewThreadDescription, selectedThreadPath, onSelectedThreadPathChanged, onSelectedThreadResolved, onThreadResolved, newThreadResetVersion, showThreadList, threadListWidth, threadListCollapsedHeight, }: ChatBotViewProps): ReactElement;
@@ -27,19 +27,20 @@ module.exports = __toCommonJS(chat_bot_view_exports);
27
27
  var import_jsx_runtime = require("react/jsx-runtime");
28
28
  var import_react = require("react");
29
29
  var import_meshagent_react = require("@meshagent/meshagent-react");
30
+ var import_meshagent_agents = require("@meshagent/meshagent-agents");
30
31
  var import_lucide_react = require("lucide-react");
31
- var import_chat_hooks = require("./chat-hooks");
32
- var import_chat_thread = require("./chat-thread");
33
- var import_dataset_chat_thread = require("./dataset-chat-thread");
34
- var import_button = require("../components/ui/button");
35
- var import_dialog = require("../components/ui/dialog");
36
- var import_input = require("../components/ui/input");
37
- var import_label = require("../components/ui/label");
38
- var import_spinner = require("../components/ui/spinner");
39
- var import_conversation_descriptor = require("./conversation-descriptor");
40
- var import_utils = require("../lib/utils");
41
- var import_multi_thread_view = require("./multi-thread-view");
42
- var import_conversation_descriptor2 = require("./conversation-descriptor");
32
+ var import_chat_hooks = require("./chat-hooks.js");
33
+ var import_chat_thread = require("./chat-thread.js");
34
+ var import_dataset_chat_thread = require("./dataset-chat-thread.js");
35
+ var import_button = require("../components/ui/button.js");
36
+ var import_dialog = require("../components/ui/dialog.js");
37
+ var import_input = require("../components/ui/input.js");
38
+ var import_label = require("../components/ui/label.js");
39
+ var import_spinner = require("../components/ui/spinner.js");
40
+ var import_conversation_descriptor = require("./conversation-descriptor.js");
41
+ var import_utils = require("../lib/utils.js");
42
+ var import_multi_thread_view = require("./multi-thread-view.js");
43
+ var import_conversation_descriptor2 = require("./conversation-descriptor.js");
43
44
  const multiThreadLayoutBreakpointPx = 920;
44
45
  function normalizePath(path) {
45
46
  const normalized = path?.trim();
@@ -110,6 +111,72 @@ async function closeDocument(room, path) {
110
111
  } catch {
111
112
  }
112
113
  }
114
+ function threadListEntryFromAgentEntry(entry) {
115
+ return {
116
+ path: entry.path,
117
+ name: entry.name,
118
+ createdAt: entry.createdAt,
119
+ modifiedAt: entry.modifiedAt
120
+ };
121
+ }
122
+ class MeshDocumentChatThreadListStore {
123
+ constructor(room, path) {
124
+ this.room = room;
125
+ this.path = path;
126
+ }
127
+ room;
128
+ path;
129
+ document = null;
130
+ async open() {
131
+ this.document = await this.room.sync.open(this.path);
132
+ }
133
+ async close() {
134
+ this.document = null;
135
+ await closeDocument(this.room, this.path);
136
+ }
137
+ entries() {
138
+ return this.document === null ? [] : parseThreadListEntries(this.document);
139
+ }
140
+ async renameThread(entry, name) {
141
+ if (entry.element == null) {
142
+ throw new Error("Thread list entry is not backed by a mesh document element.");
143
+ }
144
+ entry.element.setAttribute("name", name);
145
+ }
146
+ async deleteThread(entry) {
147
+ if (entry.element == null) {
148
+ throw new Error("Thread list entry is not backed by a mesh document element.");
149
+ }
150
+ await this.room.storage.delete(entry.path);
151
+ entry.element.delete();
152
+ }
153
+ }
154
+ class RepositoryChatThreadListStore {
155
+ constructor(repository, onChanged) {
156
+ this.repository = repository;
157
+ this.onChanged = onChanged;
158
+ }
159
+ repository;
160
+ onChanged;
161
+ document = null;
162
+ async open() {
163
+ this.repository.addListener(this.onChanged);
164
+ await this.repository.open();
165
+ }
166
+ async close() {
167
+ this.repository.removeListener(this.onChanged);
168
+ await this.repository.close();
169
+ }
170
+ entries() {
171
+ return this.repository.entries().map(threadListEntryFromAgentEntry);
172
+ }
173
+ async renameThread(entry, name) {
174
+ await this.repository.renameThread(entry.path, name);
175
+ }
176
+ async deleteThread(entry) {
177
+ await this.repository.deleteThread(entry.path);
178
+ }
179
+ }
113
180
  function useIsWideLayout(minWidth) {
114
181
  const [matches, setMatches] = (0, import_react.useState)(false);
115
182
  (0, import_react.useEffect)(() => {
@@ -128,19 +195,44 @@ function useIsWideLayout(minWidth) {
128
195
  }, [minWidth]);
129
196
  return matches;
130
197
  }
131
- function useThreadListDocument({ room, path }) {
198
+ function useThreadListDocument({ room, chatClient, path }) {
132
199
  const [document, setDocument] = (0, import_react.useState)(null);
133
200
  const [entries, setEntries] = (0, import_react.useState)([]);
134
201
  const [loading, setLoading] = (0, import_react.useState)(path !== null);
135
202
  const [error, setError] = (0, import_react.useState)(null);
136
- const syncDocumentState = (0, import_react.useCallback)((nextDocument) => {
137
- const nextEntries = parseThreadListEntries(nextDocument);
203
+ const storeRef = (0, import_react.useRef)(null);
204
+ const syncEntries = (0, import_react.useCallback)((store = storeRef.current) => {
205
+ if (store === null) {
206
+ setEntries([]);
207
+ return;
208
+ }
209
+ const nextEntries = [...store.entries()].sort(compareThreadEntries);
138
210
  setEntries((currentEntries) => threadEntriesEqual(currentEntries, nextEntries) ? currentEntries : nextEntries);
139
211
  }, []);
212
+ const createStore = (0, import_react.useCallback)((nextPath) => {
213
+ if (nextPath.startsWith("agent://")) {
214
+ if (chatClient === null) {
215
+ throw new Error("Agent thread lists require a chat client.");
216
+ }
217
+ return new RepositoryChatThreadListStore(
218
+ new import_meshagent_agents.AgentThreadStorageRepository({ chatClient }),
219
+ () => syncEntries()
220
+ );
221
+ }
222
+ if (nextPath.startsWith("dataset://")) {
223
+ return new RepositoryChatThreadListStore(
224
+ new import_meshagent_agents.DatasetThreadStorage({ room, path: nextPath }),
225
+ () => syncEntries()
226
+ );
227
+ }
228
+ return new MeshDocumentChatThreadListStore(room, nextPath);
229
+ }, [chatClient, room, syncEntries]);
140
230
  (0, import_react.useEffect)(() => {
141
231
  let cancelled = false;
142
- let opened = false;
143
232
  if (path === null) {
233
+ const previousStore = storeRef.current;
234
+ storeRef.current = null;
235
+ void previousStore?.close();
144
236
  setDocument(null);
145
237
  setEntries([]);
146
238
  setLoading(false);
@@ -151,14 +243,15 @@ function useThreadListDocument({ room, path }) {
151
243
  setEntries([]);
152
244
  setLoading(true);
153
245
  setError(null);
154
- void room.sync.open(path).then((nextDocument) => {
246
+ const store = createStore(path);
247
+ storeRef.current = store;
248
+ void store.open().then(() => {
155
249
  if (cancelled) {
156
- void closeDocument(room, path);
250
+ void store.close();
157
251
  return;
158
252
  }
159
- opened = true;
160
- setDocument(nextDocument);
161
- syncDocumentState(nextDocument);
253
+ setDocument(store.document);
254
+ syncEntries(store);
162
255
  setLoading(false);
163
256
  setError(null);
164
257
  }).catch((nextError) => {
@@ -172,20 +265,29 @@ function useThreadListDocument({ room, path }) {
172
265
  });
173
266
  return () => {
174
267
  cancelled = true;
175
- if (opened) {
176
- void closeDocument(room, path);
268
+ if (storeRef.current === store) {
269
+ storeRef.current = null;
177
270
  }
271
+ void store.close();
178
272
  };
179
- }, [path, room, syncDocumentState]);
273
+ }, [createStore, path, syncEntries]);
180
274
  (0, import_meshagent_react.useDocumentChanged)({
181
275
  document,
182
- onChanged: syncDocumentState
276
+ onChanged: () => syncEntries()
183
277
  });
184
278
  return {
185
279
  document,
186
280
  entries,
187
281
  loading,
188
- error
282
+ error,
283
+ renameThread: async (entry, name) => {
284
+ await storeRef.current?.renameThread(entry, name);
285
+ syncEntries();
286
+ },
287
+ deleteThread: async (entry) => {
288
+ await storeRef.current?.deleteThread(entry);
289
+ syncEntries();
290
+ }
189
291
  };
190
292
  }
191
293
  function ThreadListRow({
@@ -355,6 +457,8 @@ function MultiThreadUnavailable() {
355
457
  }
356
458
  function ChatBotView({
357
459
  room,
460
+ chatClient,
461
+ disposeChatClient = false,
358
462
  path,
359
463
  documentPath,
360
464
  participants,
@@ -387,6 +491,12 @@ function ChatBotView({
387
491
  () => resolvedDocumentPath ?? (0, import_conversation_descriptor.chatDocumentPath)(agentName, { threadDir }),
388
492
  [agentName, resolvedDocumentPath, threadDir]
389
493
  );
494
+ const needsChatClient = chatClient != null || threadDisplayMode === import_conversation_descriptor.ChatThreadDisplayMode.MultiThreadComposer || isDatasetBackedThreadPath(resolvedSingleThreadPath);
495
+ const ownsChatClient = chatClient == null && needsChatClient;
496
+ const activeChatClient = (0, import_react.useMemo)(
497
+ () => needsChatClient ? chatClient ?? new import_meshagent_agents.MessagingChatClient({ room, agentName }) : null,
498
+ [agentName, chatClient, needsChatClient, room]
499
+ );
390
500
  const explicitSelectedThreadPath = selectedThreadPath !== void 0 ? normalizePath(selectedThreadPath) : void 0;
391
501
  const legacySelectedThreadPath = threadDisplayMode === import_conversation_descriptor.ChatThreadDisplayMode.MultiThreadComposer ? resolvedDocumentPath : null;
392
502
  const [internalSelectedThreadPath, setInternalSelectedThreadPath] = (0, import_react.useState)(() => explicitSelectedThreadPath ?? legacySelectedThreadPath ?? null);
@@ -400,8 +510,16 @@ function ChatBotView({
400
510
  );
401
511
  const threadList = useThreadListDocument({
402
512
  room,
513
+ chatClient: activeChatClient,
403
514
  path: threadDisplayMode === import_conversation_descriptor.ChatThreadDisplayMode.MultiThreadComposer && showThreadList && resolvedThreadListDocumentPath !== null ? resolvedThreadListDocumentPath : null
404
515
  });
516
+ (0, import_react.useEffect)(() => {
517
+ return () => {
518
+ if (activeChatClient !== null && (ownsChatClient || disposeChatClient)) {
519
+ void activeChatClient.stop();
520
+ }
521
+ };
522
+ }, [activeChatClient, disposeChatClient, ownsChatClient]);
405
523
  (0, import_react.useEffect)(() => {
406
524
  if (explicitSelectedThreadPath === void 0) {
407
525
  return;
@@ -479,18 +597,24 @@ function ChatBotView({
479
597
  if (trimmedName === "" || trimmedName === renameThreadDialog.entry.name) {
480
598
  return;
481
599
  }
482
- renameThreadDialog.entry.element.setAttribute("name", trimmedName);
483
- if (renameThreadDialog.entry.path === activeSelectedThreadPath) {
484
- emitResolvedThread(renameThreadDialog.entry.path, trimmedName);
485
- }
486
- closeRenameThreadDialog();
487
- }, [activeSelectedThreadPath, closeRenameThreadDialog, emitResolvedThread, renameThreadDialog]);
600
+ void threadList.renameThread(renameThreadDialog.entry, trimmedName).then(() => {
601
+ if (renameThreadDialog.entry.path === activeSelectedThreadPath) {
602
+ emitResolvedThread(renameThreadDialog.entry.path, trimmedName);
603
+ }
604
+ closeRenameThreadDialog();
605
+ }).catch((renameError) => {
606
+ setTimeout(() => {
607
+ throw renameError;
608
+ }, 0);
609
+ });
610
+ }, [activeSelectedThreadPath, closeRenameThreadDialog, emitResolvedThread, renameThreadDialog, threadList]);
488
611
  if (threadDisplayMode !== import_conversation_descriptor.ChatThreadDisplayMode.MultiThreadComposer) {
489
612
  return isDatasetBackedThreadPath(resolvedSingleThreadPath) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
490
613
  import_dataset_chat_thread.DatasetChatThread,
491
614
  {
492
615
  room,
493
616
  path: resolvedSingleThreadPath,
617
+ chatClient: activeChatClient ?? void 0,
494
618
  agentName,
495
619
  emptyStateTitle,
496
620
  emptyStateDescription
@@ -514,6 +638,8 @@ function ChatBotView({
514
638
  import_multi_thread_view.MultiThreadView,
515
639
  {
516
640
  room,
641
+ chatClient: activeChatClient ?? void 0,
642
+ disposeChatClient: false,
517
643
  agentName,
518
644
  toolkit,
519
645
  tool,
@@ -527,6 +653,7 @@ function ChatBotView({
527
653
  {
528
654
  room,
529
655
  path: threadPath,
656
+ chatClient: activeChatClient ?? void 0,
530
657
  agentName,
531
658
  emptyStateTitle: startNewThreadTitle,
532
659
  emptyStateDescription: startNewThreadDescription
@@ -1,6 +1,6 @@
1
1
  import { Element, MeshDocument, Participant, RemoteParticipant, RoomClient } from "@meshagent/meshagent";
2
- import { ChatMessage } from "./chat-message";
3
- import { type FileUpload } from "./file-attachment";
2
+ import { ChatMessage } from "./chat-message.js";
3
+ import { type FileUpload } from "./file-attachment.js";
4
4
  export interface UseChatThreadProps {
5
5
  room: RoomClient;
6
6
  path: string;
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(chat_hooks_exports);
28
28
  var import_react = require("react");
29
29
  var import_meshagent = require("@meshagent/meshagent");
30
30
  var import_meshagent_react = require("@meshagent/meshagent-react");
31
- var import_file_attachment = require("./file-attachment");
31
+ var import_file_attachment = require("./file-attachment.js");
32
32
  const agentRoomMessageType = "agent-message";
33
33
  const agentTurnStartType = "meshagent.agent.turn.start";
34
34
  const agentTurnSteerType = "meshagent.agent.turn.steer";
@@ -1,6 +1,6 @@
1
1
  import type { ReactElement } from "react";
2
- import { ChatMessage } from "./chat-message";
3
- import { type FileUpload } from "./file-attachment";
2
+ import { ChatMessage } from "./chat-message.js";
3
+ import { type FileUpload } from "./file-attachment.js";
4
4
  interface ChatInputProps {
5
5
  onSubmit: (message: ChatMessage) => void | Promise<void>;
6
6
  onFilesSelected: (files: File[]) => void;
@@ -25,12 +25,12 @@ var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_react = require("react");
26
26
  var import_lucide_react = require("lucide-react");
27
27
  var import_uuid = require("uuid");
28
- var import_chat_message = require("./chat-message");
29
- var import_button = require("../components/ui/button");
30
- var import_file_uploader = require("./file-uploader");
31
- var import_upload_pill = require("./upload-pill");
32
- var import_file_attachment = require("./file-attachment");
33
- var import_utils = require("../lib/utils");
28
+ var import_chat_message = require("./chat-message.js");
29
+ var import_button = require("../components/ui/button.js");
30
+ var import_file_uploader = require("./file-uploader.js");
31
+ var import_upload_pill = require("./upload-pill.js");
32
+ var import_file_attachment = require("./file-attachment.js");
33
+ var import_utils = require("../lib/utils.js");
34
34
  const MIN_TEXTAREA_HEIGHT = 20;
35
35
  const MAX_TEXTAREA_HEIGHT = 160;
36
36
  function useAttachmentStatusVersion(attachments) {
@@ -39,13 +39,13 @@ var import_react_markdown = __toESM(require("react-markdown"));
39
39
  var import_rehype_highlight = __toESM(require("rehype-highlight"));
40
40
  var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
41
41
  var import_remark_gfm = __toESM(require("remark-gfm"));
42
- var import_button = require("../components/ui/button");
43
- var import_spinner = require("../components/ui/spinner");
44
- var import_chat_typing_indicator = require("./chat-typing-indicator");
45
- var import_chat_input = require("./chat-input");
46
- var import_chat_hooks = require("./chat-hooks");
47
- var import_file_preview = require("../file-preview/file-preview");
48
- var import_utils = require("../lib/utils");
42
+ var import_button = require("../components/ui/button.js");
43
+ var import_spinner = require("../components/ui/spinner.js");
44
+ var import_chat_typing_indicator = require("./chat-typing-indicator.js");
45
+ var import_chat_input = require("./chat-input.js");
46
+ var import_chat_hooks = require("./chat-hooks.js");
47
+ var import_file_preview = require("../file-preview/file-preview.js");
48
+ var import_utils = require("../lib/utils.js");
49
49
  const supportedEventKinds = /* @__PURE__ */ new Set([
50
50
  "exec",
51
51
  "tool",
@@ -35,8 +35,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var React = __toESM(require("react"));
36
36
  var import_meshagent_react = require("@meshagent/meshagent-react");
37
37
  var import_lucide_react = require("lucide-react");
38
- var import_chat_hooks = require("./chat-hooks");
39
- var import_utils = require("../lib/utils");
38
+ var import_chat_hooks = require("./chat-hooks.js");
39
+ var import_utils = require("../lib/utils.js");
40
40
  function useStatusLabel(text, startedAt) {
41
41
  const normalizedText = text?.trim() ?? "";
42
42
  const [tick, setTick] = React.useState(0);
@@ -128,6 +128,9 @@ function threadListPathFromThreadDir(threadDir) {
128
128
  if (normalized === null) {
129
129
  return null;
130
130
  }
131
+ if (normalized.startsWith("dataset://")) {
132
+ return `${normalized}/index`;
133
+ }
131
134
  return `${normalized}/index.threadl`;
132
135
  }
133
136
  function basename(path) {
@@ -297,6 +300,9 @@ function resolvedThreadListPath(threadListPath, {
297
300
  }
298
301
  const normalizedDir = normalizedThreadDir(threadDir);
299
302
  if (normalizedDir !== null) {
303
+ if (normalizedDir.startsWith("dataset://")) {
304
+ return `${normalizedDir}/index`;
305
+ }
300
306
  return `${normalizedDir}/index.threadl`;
301
307
  }
302
308
  const defaultThreadDir = defaultThreadDocumentDir(agentName);
@@ -40,14 +40,14 @@ var import_react_markdown = __toESM(require("react-markdown"));
40
40
  var import_rehype_highlight = __toESM(require("rehype-highlight"));
41
41
  var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
42
42
  var import_remark_gfm = __toESM(require("remark-gfm"));
43
- var import_chat_input = require("./chat-input");
44
- var import_chat_typing_indicator = require("./chat-typing-indicator");
45
- var import_button = require("../components/ui/button");
46
- var import_spinner = require("../components/ui/spinner");
47
- var import_file_attachment = require("./file-attachment");
48
- var import_chat_hooks = require("./chat-hooks");
49
- var import_utils = require("../lib/utils");
50
- var import_chat_thread = require("./chat-thread");
43
+ var import_chat_input = require("./chat-input.js");
44
+ var import_chat_typing_indicator = require("./chat-typing-indicator.js");
45
+ var import_button = require("../components/ui/button.js");
46
+ var import_spinner = require("../components/ui/spinner.js");
47
+ var import_file_attachment = require("./file-attachment.js");
48
+ var import_chat_hooks = require("./chat-hooks.js");
49
+ var import_utils = require("../lib/utils.js");
50
+ var import_chat_thread = require("./chat-thread.js");
51
51
  const stickyBottomThresholdPx = 24;
52
52
  const maxPreviewEdgePx = 312.5;
53
53
  function createDatasetThreadModel() {
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(file_uploader_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var React = __toESM(require("react"));
36
36
  var import_lucide_react = require("lucide-react");
37
- var import_button = require("../components/ui/button");
37
+ var import_button = require("../components/ui/button.js");
38
38
  function FileUploader({
39
39
  onFilesSelected,
40
40
  accept = "",
@@ -23,7 +23,7 @@ __export(multi_thread_view_exports, {
23
23
  module.exports = __toCommonJS(multi_thread_view_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_react = require("react");
26
- var import_new_chat_thread = require("./new-chat-thread");
26
+ var import_new_chat_thread = require("./new-chat-thread.js");
27
27
  function normalizeSelectedThreadPath(path) {
28
28
  const normalized = path?.trim();
29
29
  return normalized ? normalized : null;
@@ -24,9 +24,9 @@ module.exports = __toCommonJS(new_chat_thread_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_react = require("react");
26
26
  var import_meshagent_agents = require("@meshagent/meshagent-agents");
27
- var import_chat_input = require("./chat-input");
28
- var import_file_attachment = require("./file-attachment");
29
- var import_sonner = require("../components/ui/sonner");
27
+ var import_chat_input = require("./chat-input.js");
28
+ var import_file_attachment = require("./file-attachment.js");
29
+ var import_sonner = require("../components/ui/sonner.js");
30
30
  class NewThreadCancelledError extends Error {
31
31
  constructor() {
32
32
  super("new thread creation cancelled");
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { type FileUpload } from "./file-attachment";
2
+ import { type FileUpload } from "./file-attachment.js";
3
3
  export interface UploadPillProps {
4
4
  attachment: FileUpload;
5
5
  onCancel: (attachment: FileUpload) => void;
@@ -34,9 +34,9 @@ module.exports = __toCommonJS(upload_pill_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var React = __toESM(require("react"));
36
36
  var import_lucide_react = require("lucide-react");
37
- var import_progress = require("../components/ui/progress");
38
- var import_file_attachment = require("./file-attachment");
39
- var import_utils = require("../lib/utils");
37
+ var import_progress = require("../components/ui/progress.js");
38
+ var import_file_attachment = require("./file-attachment.js");
39
+ var import_utils = require("../lib/utils.js");
40
40
  function measureUploadProgress(attachment) {
41
41
  if (attachment.size <= 0) {
42
42
  return attachment.status === import_file_attachment.UploadStatus.Completed ? 100 : 0;
@@ -24,9 +24,9 @@ __export(pane_example_exports, {
24
24
  module.exports = __toCommonJS(pane_example_exports);
25
25
  var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_react = require("react");
27
- var import_button = require("./ui/button");
28
- var import_sheet = require("./ui/sheet");
29
- var import_pane_service = require("../lib/pane-service");
27
+ var import_button = require("./ui/button.js");
28
+ var import_sheet = require("./ui/sheet.js");
29
+ var import_pane_service = require("../lib/pane-service.js");
30
30
  function PaneExample() {
31
31
  const [open, setOpen] = (0, import_react.useState)(false);
32
32
  (0, import_react.useEffect)(() => {
@@ -35,7 +35,7 @@ __export(avatar_exports, {
35
35
  module.exports = __toCommonJS(avatar_exports);
36
36
  var import_jsx_runtime = require("react/jsx-runtime");
37
37
  var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
38
- var import_utils = require("../../lib/utils");
38
+ var import_utils = require("../../lib/utils.js");
39
39
  function Avatar({
40
40
  className,
41
41
  ...props
@@ -3,7 +3,7 @@ import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
5
5
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
+ } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
7
7
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
8
  asChild?: boolean;
9
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -25,7 +25,7 @@ module.exports = __toCommonJS(button_exports);
25
25
  var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_react_slot = require("@radix-ui/react-slot");
27
27
  var import_class_variance_authority = require("class-variance-authority");
28
- var import_utils = require("../../lib/utils");
28
+ var import_utils = require("../../lib/utils.js");
29
29
  const buttonVariants = (0, import_class_variance_authority.cva)(
30
30
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
31
31
  {
@@ -28,7 +28,7 @@ __export(card_exports, {
28
28
  });
29
29
  module.exports = __toCommonJS(card_exports);
30
30
  var import_jsx_runtime = require("react/jsx-runtime");
31
- var import_utils = require("../../lib/utils");
31
+ var import_utils = require("../../lib/utils.js");
32
32
  function Card({ className, ...props }) {
33
33
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
34
34
  "div",
@@ -43,7 +43,7 @@ module.exports = __toCommonJS(dialog_exports);
43
43
  var import_jsx_runtime = require("react/jsx-runtime");
44
44
  var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
45
45
  var import_lucide_react = require("lucide-react");
46
- var import_utils = require("../../lib/utils");
46
+ var import_utils = require("../../lib/utils.js");
47
47
  function Dialog({
48
48
  ...props
49
49
  }) {
@@ -42,8 +42,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
42
42
  var React = __toESM(require("react"));
43
43
  var import_react_slot = require("@radix-ui/react-slot");
44
44
  var import_react_hook_form = require("react-hook-form");
45
- var import_utils = require("../../lib/utils");
46
- var import_label = require("../../components/ui/label");
45
+ var import_utils = require("../../lib/utils.js");
46
+ var import_label = require("../../components/ui/label.js");
47
47
  const Form = import_react_hook_form.FormProvider;
48
48
  const FormFieldContext = React.createContext(
49
49
  {}
@@ -22,7 +22,7 @@ __export(input_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(input_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
- var import_utils = require("../../lib/utils");
25
+ var import_utils = require("../../lib/utils.js");
26
26
  function Input({ className, type, ...props }) {
27
27
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
28
28
  "input",
@@ -34,7 +34,7 @@ __export(label_exports, {
34
34
  module.exports = __toCommonJS(label_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
37
- var import_utils = require("../../lib/utils");
37
+ var import_utils = require("../../lib/utils.js");
38
38
  function Label({
39
39
  className,
40
40
  ...props
@@ -33,7 +33,7 @@ __export(progress_exports, {
33
33
  module.exports = __toCommonJS(progress_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
36
- var import_utils = require("../../lib/utils");
36
+ var import_utils = require("../../lib/utils.js");
37
37
  function Progress({ className, value, ...props }) {
38
38
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
39
39
  ProgressPrimitive.Root,
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(radio_group_exports);
36
36
  var import_jsx_runtime = require("react/jsx-runtime");
37
37
  var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"));
38
38
  var import_lucide_react = require("lucide-react");
39
- var import_utils = require("../../lib/utils");
39
+ var import_utils = require("../../lib/utils.js");
40
40
  function RadioGroup({
41
41
  className,
42
42
  ...props