@meshagent/meshagent-tailwind 0.38.2 → 0.38.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/Chat.d.ts +11 -3
  3. package/dist/cjs/Chat.js +376 -29
  4. package/dist/cjs/ChatBotView.d.ts +29 -0
  5. package/dist/cjs/ChatBotView.js +491 -0
  6. package/dist/cjs/ChatInput.d.ts +12 -3
  7. package/dist/cjs/ChatInput.js +143 -44
  8. package/dist/cjs/ChatThread.d.ts +17 -3
  9. package/dist/cjs/ChatThread.js +646 -90
  10. package/dist/cjs/ChatTypingIndicator.d.ts +12 -5
  11. package/dist/cjs/ChatTypingIndicator.js +104 -13
  12. package/dist/cjs/FileUploader.d.ts +3 -2
  13. package/dist/cjs/FileUploader.js +35 -11
  14. package/dist/cjs/UploadPill.d.ts +2 -2
  15. package/dist/cjs/UploadPill.js +70 -32
  16. package/dist/cjs/chat-hooks.d.ts +38 -0
  17. package/dist/cjs/chat-hooks.js +390 -0
  18. package/dist/cjs/chat-message.d.ts +11 -0
  19. package/dist/cjs/chat-message.js +33 -0
  20. package/dist/cjs/components/ui/button.d.ts +1 -1
  21. package/dist/cjs/conversation-descriptor.d.ts +59 -0
  22. package/dist/cjs/conversation-descriptor.js +300 -0
  23. package/dist/cjs/file-attachment.d.ts +45 -0
  24. package/dist/cjs/file-attachment.js +171 -0
  25. package/dist/cjs/index.d.ts +5 -0
  26. package/dist/cjs/index.js +5 -0
  27. package/dist/cjs/multi-thread-view.d.ts +18 -0
  28. package/dist/cjs/multi-thread-view.js +88 -0
  29. package/dist/cjs/tools/ui-toolkit.d.ts +1 -1
  30. package/dist/cjs/tools/ui-toolkit.js +2 -1
  31. package/dist/esm/Chat.d.ts +11 -3
  32. package/dist/esm/Chat.js +378 -31
  33. package/dist/esm/ChatBotView.d.ts +29 -0
  34. package/dist/esm/ChatBotView.js +486 -0
  35. package/dist/esm/ChatInput.d.ts +12 -3
  36. package/dist/esm/ChatInput.js +143 -34
  37. package/dist/esm/ChatThread.d.ts +17 -3
  38. package/dist/esm/ChatThread.js +648 -92
  39. package/dist/esm/ChatTypingIndicator.d.ts +12 -5
  40. package/dist/esm/ChatTypingIndicator.js +94 -13
  41. package/dist/esm/FileUploader.d.ts +3 -2
  42. package/dist/esm/FileUploader.js +26 -12
  43. package/dist/esm/UploadPill.d.ts +2 -2
  44. package/dist/esm/UploadPill.js +60 -32
  45. package/dist/esm/chat-hooks.d.ts +38 -0
  46. package/dist/esm/chat-hooks.js +372 -0
  47. package/dist/esm/chat-message.d.ts +11 -0
  48. package/dist/esm/chat-message.js +13 -0
  49. package/dist/esm/components/ui/button.d.ts +1 -1
  50. package/dist/esm/conversation-descriptor.d.ts +59 -0
  51. package/dist/esm/conversation-descriptor.js +280 -0
  52. package/dist/esm/file-attachment.d.ts +45 -0
  53. package/dist/esm/file-attachment.js +151 -0
  54. package/dist/esm/index.d.ts +5 -0
  55. package/dist/esm/index.js +5 -0
  56. package/dist/esm/multi-thread-view.d.ts +18 -0
  57. package/dist/esm/multi-thread-view.js +68 -0
  58. package/dist/esm/tools/ui-toolkit.d.ts +1 -1
  59. package/dist/esm/tools/ui-toolkit.js +2 -1
  60. package/dist/index.css +1 -1
  61. package/package.json +3 -3
@@ -0,0 +1,390 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chat_hooks_exports = {};
20
+ __export(chat_hooks_exports, {
21
+ formatThreadStatusText: () => formatThreadStatusText,
22
+ useChatThread: () => useChatThread,
23
+ useThreadStatus: () => useThreadStatus
24
+ });
25
+ module.exports = __toCommonJS(chat_hooks_exports);
26
+ var import_react = require("react");
27
+ var import_meshagent = require("@meshagent/meshagent");
28
+ var import_meshagent_react = require("@meshagent/meshagent-react");
29
+ var import_file_attachment = require("./file-attachment");
30
+ function getParticipantName(participant) {
31
+ const name = participant.getAttribute("name");
32
+ return typeof name === "string" ? name.trim() : "";
33
+ }
34
+ function matchesParticipantName(participant, participantName) {
35
+ const normalizedParticipantName = participantName?.trim();
36
+ if (!normalizedParticipantName) {
37
+ return true;
38
+ }
39
+ return getParticipantName(participant) === normalizedParticipantName;
40
+ }
41
+ function ensureParticipants(document, localParticipant, includeLocalParticipant, participants, participantNames) {
42
+ const nextParticipants = [
43
+ ...participants,
44
+ ...includeLocalParticipant ? [localParticipant] : []
45
+ ];
46
+ const existing = /* @__PURE__ */ new Set();
47
+ const children = document.root.getChildren();
48
+ for (const child of children) {
49
+ if (child.tagName !== "members") {
50
+ continue;
51
+ }
52
+ const members = child.getChildren();
53
+ for (const member of members) {
54
+ const name = getParticipantName(member);
55
+ if (name !== "") {
56
+ existing.add(name);
57
+ }
58
+ }
59
+ for (const participant of nextParticipants) {
60
+ const name = getParticipantName(participant);
61
+ if (name !== "" && !existing.has(name)) {
62
+ child.createChildElement("member", { name });
63
+ existing.add(name);
64
+ }
65
+ }
66
+ for (const name of participantNames) {
67
+ const trimmed = name.trim();
68
+ if (trimmed !== "" && !existing.has(trimmed)) {
69
+ child.createChildElement("member", { name: trimmed });
70
+ existing.add(trimmed);
71
+ }
72
+ }
73
+ }
74
+ }
75
+ function mapThreadElements(document) {
76
+ const children = document.root.getChildren();
77
+ const thread = children.find((child) => child.tagName === "messages");
78
+ return [...thread?.getChildren() ?? []];
79
+ }
80
+ function getDocumentParticipantNames(document) {
81
+ const children = document.root.getChildren();
82
+ const membersElement = children.find((child) => child.tagName === "members");
83
+ const members = membersElement?.getChildren() ?? [];
84
+ const participantNames = [];
85
+ for (const member of members) {
86
+ const name = getParticipantName(member);
87
+ if (name !== "") {
88
+ participantNames.push(name);
89
+ }
90
+ }
91
+ return participantNames;
92
+ }
93
+ function stringArraysEqual(left, right) {
94
+ return left.length === right.length && left.every((value, index) => value === right[index]);
95
+ }
96
+ function getOnlineParticipants(roomParticipants, participantNames) {
97
+ const participantSet = new Set(participantNames);
98
+ return Array.from(roomParticipants).filter((participant) => {
99
+ const name = getParticipantName(participant);
100
+ return name !== "" && participantSet.has(name);
101
+ });
102
+ }
103
+ function supportsAgentMessages(participant) {
104
+ return participant.getAttribute("supports_agent_messages") === true;
105
+ }
106
+ function threadStatusAttributeCandidates(path, prefix) {
107
+ if (path.startsWith("/")) {
108
+ return [`${prefix}.${path}`, `${prefix}.${path.slice(1)}`];
109
+ }
110
+ return [`${prefix}.${path}`, `${prefix}./${path}`];
111
+ }
112
+ function resolveThreadStatus({ room, path, agentName }) {
113
+ const normalizedAgentName = agentName?.trim();
114
+ const remoteParticipants = room.messaging.remoteParticipants;
115
+ const candidates = normalizedAgentName && normalizedAgentName !== "" ? remoteParticipants.filter((participant) => getParticipantName(participant) === normalizedAgentName) : remoteParticipants.filter((participant) => participant.role === "agent" || supportsAgentMessages(participant));
116
+ const textKeys = threadStatusAttributeCandidates(path, "thread.status.text");
117
+ const legacyKeys = threadStatusAttributeCandidates(path, "thread.status");
118
+ const modeKeys = threadStatusAttributeCandidates(path, "thread.status.mode");
119
+ const startedAtKeys = threadStatusAttributeCandidates(path, "thread.status.started_at");
120
+ let text = null;
121
+ let mode = null;
122
+ let startedAt = null;
123
+ let hasAgentMessageSupport = false;
124
+ for (const participant of candidates) {
125
+ hasAgentMessageSupport = hasAgentMessageSupport || supportsAgentMessages(participant);
126
+ if (text === null) {
127
+ for (const key of [...textKeys, ...legacyKeys]) {
128
+ const value = participant.getAttribute(key);
129
+ if (typeof value === "string" && value.trim() !== "") {
130
+ text = value.trim();
131
+ break;
132
+ }
133
+ }
134
+ }
135
+ if (mode === null) {
136
+ for (const key of modeKeys) {
137
+ const value = participant.getAttribute(key);
138
+ if (typeof value !== "string") {
139
+ continue;
140
+ }
141
+ const normalized = value.trim().toLowerCase();
142
+ if (normalized === "busy" || normalized === "steerable") {
143
+ mode = normalized;
144
+ break;
145
+ }
146
+ }
147
+ }
148
+ if (startedAt === null) {
149
+ for (const key of startedAtKeys) {
150
+ const value = participant.getAttribute(key);
151
+ if (typeof value !== "string" || value.trim() === "") {
152
+ continue;
153
+ }
154
+ const parsed = new Date(value);
155
+ if (!Number.isNaN(parsed.getTime())) {
156
+ startedAt = parsed;
157
+ break;
158
+ }
159
+ }
160
+ }
161
+ }
162
+ if (text === null) {
163
+ return {
164
+ text: null,
165
+ mode: null,
166
+ startedAt: null,
167
+ supportsAgentMessages: hasAgentMessageSupport
168
+ };
169
+ }
170
+ return {
171
+ text,
172
+ mode: mode ?? "busy",
173
+ startedAt,
174
+ supportsAgentMessages: hasAgentMessageSupport
175
+ };
176
+ }
177
+ function threadStatusEquals(left, right) {
178
+ return left.text === right.text && left.mode === right.mode && left.startedAt?.getTime() === right.startedAt?.getTime() && left.supportsAgentMessages === right.supportsAgentMessages;
179
+ }
180
+ function formatThreadStatusText(text, startedAt) {
181
+ if (!(startedAt instanceof Date) || Number.isNaN(startedAt.getTime())) {
182
+ return text;
183
+ }
184
+ const elapsedSeconds = Math.max(0, Math.floor((Date.now() - startedAt.getTime()) / 1e3));
185
+ return elapsedSeconds === 0 ? text : `${text} (${elapsedSeconds}s)`;
186
+ }
187
+ function getRetryDelayMs(retryCount) {
188
+ return Math.min(6e4, 500 * 2 ** retryCount);
189
+ }
190
+ async function closeDocument(room, path) {
191
+ try {
192
+ await room.sync.close(path);
193
+ } catch {
194
+ }
195
+ }
196
+ function useChatThread({
197
+ room,
198
+ path,
199
+ participants,
200
+ participantNames,
201
+ initialMessage,
202
+ includeLocalParticipant,
203
+ agentName
204
+ }) {
205
+ const [document, setDocument] = (0, import_react.useState)(null);
206
+ const [messages, setMessages] = (0, import_react.useState)(() => document ? mapThreadElements(document) : []);
207
+ const [attachments, setAttachments] = (0, import_react.useState)([]);
208
+ const [documentParticipantNames, setDocumentParticipantNames] = (0, import_react.useState)(() => document ? getDocumentParticipantNames(document) : []);
209
+ const initialMessageSentRef = (0, import_react.useRef)(false);
210
+ const syncDocumentState = (0, import_react.useCallback)((nextDocument) => {
211
+ const nextMessages = mapThreadElements(nextDocument);
212
+ const nextParticipantNames = getDocumentParticipantNames(nextDocument);
213
+ setMessages(nextMessages);
214
+ setDocumentParticipantNames((current) => stringArraysEqual(current, nextParticipantNames) ? current : nextParticipantNames);
215
+ }, []);
216
+ (0, import_react.useEffect)(() => {
217
+ let cancelled = false;
218
+ let opened = false;
219
+ let retryCount = 0;
220
+ setDocument(null);
221
+ setMessages([]);
222
+ setDocumentParticipantNames([]);
223
+ initialMessageSentRef.current = false;
224
+ void (async () => {
225
+ while (!cancelled) {
226
+ try {
227
+ const nextDocument = await room.sync.open(path);
228
+ if (cancelled) {
229
+ await closeDocument(room, path);
230
+ return;
231
+ }
232
+ opened = true;
233
+ setDocument(nextDocument);
234
+ syncDocumentState(nextDocument);
235
+ return;
236
+ } catch (error) {
237
+ if (cancelled) {
238
+ return;
239
+ }
240
+ setDocument(null);
241
+ setMessages([]);
242
+ setDocumentParticipantNames([]);
243
+ console.error("Failed to open document:", error);
244
+ await new Promise((resolve) => {
245
+ window.setTimeout(resolve, getRetryDelayMs(retryCount));
246
+ });
247
+ retryCount += 1;
248
+ }
249
+ }
250
+ })();
251
+ return () => {
252
+ cancelled = true;
253
+ if (opened) {
254
+ void closeDocument(room, path);
255
+ }
256
+ };
257
+ }, [path, room, syncDocumentState]);
258
+ (0, import_react.useEffect)(() => {
259
+ if (!document || !room.localParticipant) {
260
+ return;
261
+ }
262
+ ensureParticipants(
263
+ document,
264
+ room.localParticipant,
265
+ includeLocalParticipant ?? true,
266
+ participants ?? [],
267
+ participantNames ?? []
268
+ );
269
+ setDocumentParticipantNames((current) => {
270
+ const nextParticipantNames = getDocumentParticipantNames(document);
271
+ return stringArraysEqual(current, nextParticipantNames) ? current : nextParticipantNames;
272
+ });
273
+ }, [document, includeLocalParticipant, participantNames, participants, room.localParticipant]);
274
+ (0, import_meshagent_react.useDocumentChanged)({
275
+ document,
276
+ onChanged: syncDocumentState
277
+ });
278
+ const selectAttachments = (0, import_react.useCallback)((files) => {
279
+ const nextAttachments = files.map((file) => new import_file_attachment.MeshagentFileUpload(
280
+ room,
281
+ `uploaded-files/${file.name}`,
282
+ (0, import_file_attachment.fileToAsyncIterable)(file),
283
+ file.size
284
+ ));
285
+ setAttachments((current) => [...current, ...nextAttachments]);
286
+ }, [room]);
287
+ const roomParticipants = (0, import_meshagent_react.useRoomParticipants)(room);
288
+ const onlineParticipants = (0, import_react.useMemo)(
289
+ () => getOnlineParticipants(roomParticipants, documentParticipantNames),
290
+ [roomParticipants, documentParticipantNames]
291
+ );
292
+ const sendMessage = (0, import_react.useCallback)((message) => {
293
+ const children = document?.root.getChildren() ?? [];
294
+ const thread = children.find((child) => child.tagName === "messages");
295
+ if (!thread) {
296
+ return;
297
+ }
298
+ const authorName = getParticipantName(room.localParticipant);
299
+ const messageElement = thread.createChildElement("message", {
300
+ id: message.id,
301
+ text: message.text,
302
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
303
+ author_name: authorName,
304
+ author_ref: null
305
+ });
306
+ for (const attachmentPath of message.attachments) {
307
+ messageElement.createChildElement("file", { path: attachmentPath });
308
+ }
309
+ for (const participant of onlineParticipants) {
310
+ if (!matchesParticipantName(participant, agentName)) {
311
+ continue;
312
+ }
313
+ room.messaging.sendMessage({
314
+ to: participant,
315
+ type: "chat",
316
+ message: {
317
+ path,
318
+ text: message.text,
319
+ attachments: message.attachments.map((attachmentPath) => ({ path: attachmentPath }))
320
+ }
321
+ });
322
+ }
323
+ }, [agentName, document, onlineParticipants, path, room]);
324
+ (0, import_react.useEffect)(() => {
325
+ if (!document || !initialMessage || initialMessageSentRef.current) {
326
+ return;
327
+ }
328
+ initialMessageSentRef.current = true;
329
+ sendMessage(initialMessage);
330
+ }, [document, initialMessage, sendMessage]);
331
+ const cancelRequest = (0, import_react.useCallback)(() => {
332
+ for (const participant of onlineParticipants) {
333
+ if (!matchesParticipantName(participant, agentName)) {
334
+ continue;
335
+ }
336
+ if (participant.role !== "agent") {
337
+ continue;
338
+ }
339
+ room.messaging.sendMessage({
340
+ to: participant,
341
+ type: "cancel",
342
+ message: { path }
343
+ });
344
+ }
345
+ }, [agentName, onlineParticipants, path, room]);
346
+ return {
347
+ document,
348
+ messages,
349
+ sendMessage,
350
+ selectAttachments,
351
+ attachments,
352
+ setAttachments,
353
+ schemaFileExists: true,
354
+ onlineParticipants,
355
+ localParticipantName: room.localParticipant ? getParticipantName(room.localParticipant) : "",
356
+ cancelRequest
357
+ };
358
+ }
359
+ function useThreadStatus({ room, path, agentName }) {
360
+ const [status, setStatus] = (0, import_react.useState)(() => resolveThreadStatus({ room, path, agentName }));
361
+ (0, import_react.useEffect)(() => {
362
+ const updateStatus = () => {
363
+ const nextStatus = resolveThreadStatus({ room, path, agentName });
364
+ setStatus((currentStatus) => threadStatusEquals(currentStatus, nextStatus) ? currentStatus : nextStatus);
365
+ };
366
+ const roomSubscription = (0, import_meshagent_react.subscribe)(room.listen(), {
367
+ next: (event) => {
368
+ if (event instanceof import_meshagent.RoomMessageEvent) {
369
+ updateStatus();
370
+ return;
371
+ }
372
+ updateStatus();
373
+ }
374
+ });
375
+ const handleParticipantsChanged = () => {
376
+ updateStatus();
377
+ };
378
+ room.messaging.on("participant_added", handleParticipantsChanged);
379
+ room.messaging.on("participant_removed", handleParticipantsChanged);
380
+ room.messaging.on("messaging_enabled", handleParticipantsChanged);
381
+ updateStatus();
382
+ return () => {
383
+ roomSubscription.unsubscribe();
384
+ room.messaging.off("participant_added", handleParticipantsChanged);
385
+ room.messaging.off("participant_removed", handleParticipantsChanged);
386
+ room.messaging.off("messaging_enabled", handleParticipantsChanged);
387
+ };
388
+ }, [agentName, path, room]);
389
+ return status;
390
+ }
@@ -0,0 +1,11 @@
1
+ export interface ChatMessageArgs {
2
+ id: string;
3
+ text: string;
4
+ attachments?: string[];
5
+ }
6
+ export declare class ChatMessage {
7
+ id: string;
8
+ text: string;
9
+ attachments: string[];
10
+ constructor({ id, text, attachments }: ChatMessageArgs);
11
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chat_message_exports = {};
20
+ __export(chat_message_exports, {
21
+ ChatMessage: () => ChatMessage
22
+ });
23
+ module.exports = __toCommonJS(chat_message_exports);
24
+ class ChatMessage {
25
+ id;
26
+ text;
27
+ attachments;
28
+ constructor({ id, text, attachments }) {
29
+ this.id = id;
30
+ this.text = text;
31
+ this.attachments = attachments ?? [];
32
+ }
33
+ }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
5
5
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
6
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
7
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
@@ -0,0 +1,59 @@
1
+ import type { Participant, RemoteParticipant, ServiceSpec } from "@meshagent/meshagent";
2
+ export declare const defaultUntitledThreadName = "New Chat";
3
+ export declare enum ChatAgentConversationKind {
4
+ Chat = 0,
5
+ VoiceOnly = 1,
6
+ Meeting = 2
7
+ }
8
+ export declare enum ChatThreadDisplayMode {
9
+ SingleThread = 0,
10
+ MultiThreadComposer = 1
11
+ }
12
+ export declare class ChatAgentConversationDescriptor {
13
+ private constructor();
14
+ static chat({ chatThreadDisplayMode, threadDir, threadListPath, }?: {
15
+ chatThreadDisplayMode?: ChatThreadDisplayMode;
16
+ threadDir?: string | null;
17
+ threadListPath?: string | null;
18
+ }): ChatAgentConversationDescriptor;
19
+ static voiceOnly(): ChatAgentConversationDescriptor;
20
+ static meeting(): ChatAgentConversationDescriptor;
21
+ readonly kind: ChatAgentConversationKind;
22
+ readonly chatThreadDisplayMode: ChatThreadDisplayMode;
23
+ readonly threadDir: string | null;
24
+ readonly threadListPath: string | null;
25
+ get isChat(): boolean;
26
+ get isVoiceOnly(): boolean;
27
+ get isMeeting(): boolean;
28
+ get isMultiThreadChat(): boolean;
29
+ }
30
+ export declare function participantDisplayName(participant: RemoteParticipant): string | null;
31
+ export declare function participantSupportsVoice(participant: RemoteParticipant): boolean;
32
+ export declare function participantSupportsChatOverride(participant: RemoteParticipant): boolean | null;
33
+ export declare function participantSupportsChat(participant: RemoteParticipant): boolean;
34
+ export declare function normalizedAnnotationString(value: unknown): string | null;
35
+ export declare function chatThreadDisplayModeFromAnnotation(value: unknown): ChatThreadDisplayMode;
36
+ export declare function normalizedThreadDir(threadDir?: string | null): string | null;
37
+ export declare function participantThreadDir(participant: RemoteParticipant): string | null;
38
+ export declare function participantThreadListPath(participant: RemoteParticipant): string | null;
39
+ export declare function participantConversationDescriptor(participant: RemoteParticipant): ChatAgentConversationDescriptor | null;
40
+ export declare function serviceThreadDir(service: ServiceSpec): string | null;
41
+ export declare function serviceThreadListPath(service: ServiceSpec, { remoteParticipants }?: {
42
+ remoteParticipants?: Iterable<RemoteParticipant>;
43
+ }): string | null;
44
+ export declare function serviceConversationDescriptor(service: ServiceSpec, { remoteParticipants }?: {
45
+ remoteParticipants?: Iterable<RemoteParticipant>;
46
+ }): ChatAgentConversationDescriptor | null;
47
+ export declare function conversationDescriptorForParticipant(participant: Participant, { services, remoteParticipants, }: {
48
+ services: Iterable<ServiceSpec>;
49
+ remoteParticipants: Iterable<RemoteParticipant>;
50
+ }): ChatAgentConversationDescriptor | null;
51
+ export declare function resolvedThreadListPath(threadListPath?: string | null, { threadDir, agentName, }?: {
52
+ threadDir?: string | null;
53
+ agentName?: string | null;
54
+ }): string | null;
55
+ export declare function chatDocumentPath(agentName?: string | null, { threadDir, fallbackPath, }?: {
56
+ threadDir?: string | null;
57
+ fallbackPath?: string;
58
+ }): string;
59
+ export declare function defaultThreadDisplayNameFromPath(path: string): string;