@meshagent/meshagent-tailwind 0.43.3 → 0.44.1

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 (95) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/chat/agent-thread-message-status-store.d.ts +105 -0
  3. package/dist/cjs/chat/agent-thread-message-status-store.js +617 -0
  4. package/dist/cjs/chat/agent-thread.d.ts +76 -4
  5. package/dist/cjs/chat/agent-thread.js +1114 -54
  6. package/dist/cjs/chat/chat-bot-view.d.ts +7 -4
  7. package/dist/cjs/chat/chat-bot-view.js +33 -525
  8. package/dist/cjs/chat/chat-hooks.d.ts +6 -5
  9. package/dist/cjs/chat/chat-hooks.js +21 -466
  10. package/dist/cjs/chat/chat-typing-indicator.d.ts +15 -1
  11. package/dist/cjs/chat/chat-typing-indicator.js +35 -5
  12. package/dist/cjs/chat/file-attachment.d.ts +7 -3
  13. package/dist/cjs/chat/file-attachment.js +30 -6
  14. package/dist/cjs/chat/multi-thread-view.d.ts +3 -1
  15. package/dist/cjs/chat/multi-thread-view.js +4 -2
  16. package/dist/cjs/chat/new-chat-thread.d.ts +3 -1
  17. package/dist/cjs/chat/new-chat-thread.js +7 -3
  18. package/dist/cjs/chat/thread-list-view.d.ts +22 -0
  19. package/dist/cjs/chat/thread-list-view.js +518 -0
  20. package/dist/cjs/chat/tool-call-status-accumulator.d.ts +69 -0
  21. package/dist/cjs/chat/tool-call-status-accumulator.js +268 -0
  22. package/dist/cjs/components/pane-example.d.ts +1 -1
  23. package/dist/cjs/components/ui/avatar.d.ts +3 -3
  24. package/dist/cjs/components/ui/button.d.ts +3 -3
  25. package/dist/cjs/components/ui/card.d.ts +7 -7
  26. package/dist/cjs/components/ui/dialog.d.ts +10 -10
  27. package/dist/cjs/components/ui/form.d.ts +7 -7
  28. package/dist/cjs/components/ui/input.d.ts +1 -1
  29. package/dist/cjs/components/ui/label.d.ts +1 -1
  30. package/dist/cjs/components/ui/progress.d.ts +1 -1
  31. package/dist/cjs/components/ui/radio-group.d.ts +2 -2
  32. package/dist/cjs/components/ui/select.d.ts +10 -10
  33. package/dist/cjs/components/ui/sheet.d.ts +8 -8
  34. package/dist/cjs/components/ui/skeleton.d.ts +1 -1
  35. package/dist/cjs/components/ui/sonner.d.ts +1 -1
  36. package/dist/cjs/components/ui/spinner.d.ts +2 -2
  37. package/dist/cjs/components/ui/textarea.d.ts +1 -1
  38. package/dist/cjs/file-preview/file-preview.d.ts +1 -0
  39. package/dist/cjs/file-preview/file-preview.js +41 -5
  40. package/dist/cjs/index.d.ts +3 -0
  41. package/dist/cjs/index.js +13 -0
  42. package/dist/cjs/meetings/camera-grid.d.ts +2 -2
  43. package/dist/cjs/tools/ask-user-for-file.js +2 -2
  44. package/dist/cjs/tools/file-dialog.d.ts +2 -1
  45. package/dist/cjs/tools/form-dialog.d.ts +2 -1
  46. package/dist/esm/chat/agent-thread-message-status-store.d.ts +105 -0
  47. package/dist/esm/chat/agent-thread-message-status-store.js +614 -0
  48. package/dist/esm/chat/agent-thread.d.ts +76 -4
  49. package/dist/esm/chat/agent-thread.js +1132 -56
  50. package/dist/esm/chat/chat-bot-view.d.ts +7 -4
  51. package/dist/esm/chat/chat-bot-view.js +40 -555
  52. package/dist/esm/chat/chat-hooks.d.ts +6 -5
  53. package/dist/esm/chat/chat-hooks.js +23 -468
  54. package/dist/esm/chat/chat-typing-indicator.d.ts +15 -1
  55. package/dist/esm/chat/chat-typing-indicator.js +35 -5
  56. package/dist/esm/chat/file-attachment.d.ts +7 -3
  57. package/dist/esm/chat/file-attachment.js +30 -6
  58. package/dist/esm/chat/multi-thread-view.d.ts +3 -1
  59. package/dist/esm/chat/multi-thread-view.js +4 -2
  60. package/dist/esm/chat/new-chat-thread.d.ts +3 -1
  61. package/dist/esm/chat/new-chat-thread.js +8 -4
  62. package/dist/esm/chat/thread-list-view.d.ts +22 -0
  63. package/dist/esm/chat/thread-list-view.js +514 -0
  64. package/dist/esm/chat/tool-call-status-accumulator.d.ts +69 -0
  65. package/dist/esm/chat/tool-call-status-accumulator.js +248 -0
  66. package/dist/esm/components/pane-example.d.ts +1 -1
  67. package/dist/esm/components/ui/avatar.d.ts +3 -3
  68. package/dist/esm/components/ui/button.d.ts +3 -3
  69. package/dist/esm/components/ui/card.d.ts +7 -7
  70. package/dist/esm/components/ui/dialog.d.ts +10 -10
  71. package/dist/esm/components/ui/form.d.ts +7 -7
  72. package/dist/esm/components/ui/input.d.ts +1 -1
  73. package/dist/esm/components/ui/label.d.ts +1 -1
  74. package/dist/esm/components/ui/progress.d.ts +1 -1
  75. package/dist/esm/components/ui/radio-group.d.ts +2 -2
  76. package/dist/esm/components/ui/select.d.ts +10 -10
  77. package/dist/esm/components/ui/sheet.d.ts +8 -8
  78. package/dist/esm/components/ui/skeleton.d.ts +1 -1
  79. package/dist/esm/components/ui/sonner.d.ts +1 -1
  80. package/dist/esm/components/ui/spinner.d.ts +2 -2
  81. package/dist/esm/components/ui/textarea.d.ts +1 -1
  82. package/dist/esm/file-preview/file-preview.d.ts +1 -0
  83. package/dist/esm/file-preview/file-preview.js +29 -3
  84. package/dist/esm/index.d.ts +3 -0
  85. package/dist/esm/index.js +9 -0
  86. package/dist/esm/meetings/camera-grid.d.ts +2 -2
  87. package/dist/esm/tools/ask-user-for-file.js +2 -2
  88. package/dist/esm/tools/file-dialog.d.ts +2 -1
  89. package/dist/esm/tools/form-dialog.d.ts +2 -1
  90. package/dist/index.css +1 -1
  91. package/package.json +4 -4
  92. package/dist/cjs/chat/chat-bot-view.test.js +0 -325
  93. package/dist/cjs/chat/live-chat-widgets.test.js +0 -256
  94. package/dist/esm/chat/chat-bot-view.test.js +0 -336
  95. package/dist/esm/chat/live-chat-widgets.test.js +0 -262
@@ -0,0 +1,268 @@
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 tool_call_status_accumulator_exports = {};
20
+ __export(tool_call_status_accumulator_exports, {
21
+ AccumulatedLiveToolCall: () => AccumulatedLiveToolCall,
22
+ LiveToolCallAccumulator: () => LiveToolCallAccumulator,
23
+ ToolCallStatusSnapshot: () => ToolCallStatusSnapshot,
24
+ applyPatchLineCountsFromText: () => applyPatchLineCountsFromText,
25
+ applyPatchPathFromArguments: () => applyPatchPathFromArguments,
26
+ applyPatchPathFromText: () => applyPatchPathFromText,
27
+ applyPatchStatusInfo: () => applyPatchStatusInfo,
28
+ applyPatchTextFromArguments: () => applyPatchTextFromArguments,
29
+ diffLineCountsFromText: () => diffLineCountsFromText
30
+ });
31
+ module.exports = __toCommonJS(tool_call_status_accumulator_exports);
32
+ class ToolCallStatusSnapshot {
33
+ itemId;
34
+ status;
35
+ text;
36
+ totalBytes;
37
+ linesAdded;
38
+ linesRemoved;
39
+ constructor(params) {
40
+ this.itemId = params.itemId;
41
+ this.status = params.status ?? "in_progress";
42
+ this.text = params.text;
43
+ this.totalBytes = params.totalBytes;
44
+ this.linesAdded = params.linesAdded;
45
+ this.linesRemoved = params.linesRemoved;
46
+ }
47
+ }
48
+ class AccumulatedLiveToolCall {
49
+ tool;
50
+ arguments;
51
+ status = "in_progress";
52
+ argumentBytes = 0;
53
+ argumentText = "";
54
+ }
55
+ class LiveToolCallAccumulator {
56
+ callsByItemId = /* @__PURE__ */ new Map();
57
+ textEncoder = new TextEncoder();
58
+ get isEmpty() {
59
+ return this.callsByItemId.size === 0;
60
+ }
61
+ hasSingleItem(itemId) {
62
+ return this.callsByItemId.size === 1 && this.callsByItemId.has(itemId);
63
+ }
64
+ get(itemId) {
65
+ return this.callsByItemId.get(itemId);
66
+ }
67
+ totalBytes(itemId) {
68
+ const normalizedItemId = itemId?.trim();
69
+ if (!normalizedItemId) {
70
+ return void 0;
71
+ }
72
+ const bytes = this.callsByItemId.get(normalizedItemId)?.argumentBytes;
73
+ return bytes != null && bytes > 0 ? bytes : void 0;
74
+ }
75
+ appendDelta(params) {
76
+ const normalizedItemId = params.itemId.trim();
77
+ const call = this.callFor(normalizedItemId);
78
+ call.status = "in_progress";
79
+ call.argumentBytes += this.textEncoder.encode(params.delta).length;
80
+ call.argumentText = `${call.argumentText}${params.delta}`;
81
+ return this.snapshotFor(normalizedItemId, call, params.fallbackText);
82
+ }
83
+ upsert(params) {
84
+ const normalizedItemId = params.itemId.trim();
85
+ const call = this.callFor(normalizedItemId);
86
+ call.status = "in_progress";
87
+ const normalizedTool = params.tool.trim();
88
+ if (normalizedTool !== "") {
89
+ call.tool = normalizedTool;
90
+ }
91
+ if (params.arguments != null) {
92
+ call.arguments = params.arguments;
93
+ }
94
+ return this.snapshotFor(normalizedItemId, call, params.fallbackText);
95
+ }
96
+ complete(params) {
97
+ const normalizedItemId = params.itemId.trim();
98
+ const call = this.callsByItemId.get(normalizedItemId);
99
+ if (call == null) {
100
+ return void 0;
101
+ }
102
+ call.status = params.status ?? "completed";
103
+ return this.snapshotFor(normalizedItemId, call, params.fallbackText);
104
+ }
105
+ remove(itemId) {
106
+ return this.callsByItemId.delete(itemId);
107
+ }
108
+ callFor(itemId) {
109
+ let call = this.callsByItemId.get(itemId);
110
+ if (call == null) {
111
+ call = new AccumulatedLiveToolCall();
112
+ this.callsByItemId.set(itemId, call);
113
+ }
114
+ return call;
115
+ }
116
+ snapshotFor(itemId, call, fallbackText) {
117
+ const normalizedTool = call.tool?.trim().toLowerCase();
118
+ const isApplyPatch = normalizedTool === "apply_patch";
119
+ const isCodexDiff = normalizedTool?.startsWith("diff") === true && applyPatchTextFromArguments(call.arguments?.diff) != null;
120
+ const patchInfo = this.patchStatusInfo(call);
121
+ const path = patchInfo?.path;
122
+ const patchText = patchInfo == null && !isApplyPatch && !isCodexDiff ? void 0 : path == null ? statusTextForPatch(call.status) : statusTextForPatchPath(call.status, path);
123
+ return new ToolCallStatusSnapshot({
124
+ itemId,
125
+ status: call.status,
126
+ text: patchText ?? fallbackText,
127
+ totalBytes: call.argumentBytes > 0 ? call.argumentBytes : void 0,
128
+ linesAdded: patchInfo?.counts?.added,
129
+ linesRemoved: patchInfo?.counts?.removed
130
+ });
131
+ }
132
+ patchStatusInfo(call) {
133
+ const tool = call.tool?.trim().toLowerCase();
134
+ const deltaText = call.argumentText.trim() === "" ? void 0 : call.argumentText;
135
+ const looksLikePatch = tool === "apply_patch" || tool?.startsWith("diff") === true || deltaText != null && (deltaText.includes("*** Begin Patch") || deltaText.includes("@@"));
136
+ if (!looksLikePatch) {
137
+ return void 0;
138
+ }
139
+ return applyPatchStatusInfo({ arguments: call.arguments, deltaText });
140
+ }
141
+ }
142
+ function applyPatchTextFromArguments(value) {
143
+ if (typeof value === "string") {
144
+ return value.trim() === "" ? void 0 : value;
145
+ }
146
+ if (Array.isArray(value)) {
147
+ for (const nested of value) {
148
+ const text = applyPatchTextFromArguments(nested);
149
+ if (text != null) {
150
+ return text;
151
+ }
152
+ }
153
+ return void 0;
154
+ }
155
+ if (isRecord(value)) {
156
+ for (const key of ["patch", "input", "diff"]) {
157
+ const text = applyPatchTextFromArguments(value[key]);
158
+ if (text != null) {
159
+ return text;
160
+ }
161
+ }
162
+ for (const nested of Object.values(value)) {
163
+ const text = applyPatchTextFromArguments(nested);
164
+ if (text != null) {
165
+ return text;
166
+ }
167
+ }
168
+ }
169
+ return void 0;
170
+ }
171
+ function applyPatchPathFromArguments(value) {
172
+ if (Array.isArray(value)) {
173
+ for (const nested of value) {
174
+ const nestedPath = applyPatchPathFromArguments(nested);
175
+ if (nestedPath != null) {
176
+ return nestedPath;
177
+ }
178
+ }
179
+ return void 0;
180
+ }
181
+ if (isRecord(value)) {
182
+ const path = value.path;
183
+ if (typeof path === "string" && path.trim() !== "") {
184
+ return path.trim();
185
+ }
186
+ const operationPath = applyPatchPathFromArguments(value.operation);
187
+ if (operationPath != null) {
188
+ return operationPath;
189
+ }
190
+ for (const nested of Object.values(value)) {
191
+ const nestedPath = applyPatchPathFromArguments(nested);
192
+ if (nestedPath != null) {
193
+ return nestedPath;
194
+ }
195
+ }
196
+ }
197
+ return void 0;
198
+ }
199
+ function applyPatchPathFromText(patch) {
200
+ const filePattern = /^\*\*\* (?:Update|Add|Delete) File: (.+)$/;
201
+ const diffPattern = /^(?:\+\+\+ b\/|--- a\/)(.+)$/;
202
+ for (const line of patch.replace(/\r\n/g, "\n").split("\n")) {
203
+ const path = filePattern.exec(line)?.[1]?.trim() ?? diffPattern.exec(line)?.[1]?.trim();
204
+ if (path != null && path !== "") {
205
+ return path;
206
+ }
207
+ }
208
+ return void 0;
209
+ }
210
+ function diffLineCountsFromText(diff) {
211
+ let added = 0;
212
+ let removed = 0;
213
+ for (const line of diff.replace(/\r\n/g, "\n").split("\n")) {
214
+ if (line.startsWith("+") && !line.startsWith("+++")) {
215
+ added += 1;
216
+ } else if (line.startsWith("-") && !line.startsWith("---")) {
217
+ removed += 1;
218
+ }
219
+ }
220
+ return added === 0 && removed === 0 ? void 0 : { added, removed };
221
+ }
222
+ function applyPatchLineCountsFromText(patch) {
223
+ const normalized = patch.replace(/\r\n/g, "\n");
224
+ const looksLikePatch = normalized.includes("*** Begin Patch") || normalized.includes("*** Update File:") || normalized.includes("*** Add File:") || normalized.includes("*** Delete File:");
225
+ if (!looksLikePatch && !normalized.includes("@@")) {
226
+ return void 0;
227
+ }
228
+ return diffLineCountsFromText(normalized);
229
+ }
230
+ function applyPatchStatusInfo(params) {
231
+ const path = applyPatchPathFromArguments(params.arguments);
232
+ const argumentText = applyPatchTextFromArguments(params.arguments);
233
+ const text = params.deltaText != null && params.deltaText.trim() !== "" ? params.deltaText : argumentText;
234
+ const counts = text == null ? void 0 : applyPatchLineCountsFromText(text);
235
+ const patchPath = text == null ? void 0 : applyPatchPathFromText(text);
236
+ const resolvedPath = path ?? patchPath;
237
+ if (resolvedPath == null && counts == null) {
238
+ return void 0;
239
+ }
240
+ return { path: resolvedPath, counts };
241
+ }
242
+ function isRecord(value) {
243
+ return typeof value === "object" && value !== null && !Array.isArray(value);
244
+ }
245
+ function statusTextForPatch(status) {
246
+ switch (status) {
247
+ case "completed":
248
+ return "Applied patch";
249
+ case "failed":
250
+ return "Attempted to patch";
251
+ case "cancelled":
252
+ return "Patch cancelled";
253
+ default:
254
+ return "Applying patch";
255
+ }
256
+ }
257
+ function statusTextForPatchPath(status, path) {
258
+ switch (status) {
259
+ case "completed":
260
+ return `Edited ${path}`;
261
+ case "failed":
262
+ return `Attempted to patch ${path}`;
263
+ case "cancelled":
264
+ return `Patch cancelled: ${path}`;
265
+ default:
266
+ return `Editing ${path}`;
267
+ }
268
+ }
@@ -1 +1 @@
1
- export default function PaneExample(): import("react/jsx-runtime").JSX.Element;
1
+ export default function PaneExample(): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
3
- declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
5
- declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): React.JSX.Element;
4
+ declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): React.JSX.Element;
5
+ declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): React.JSX.Element;
6
6
  export { Avatar, AvatarImage, AvatarFallback };
@@ -1,10 +1,10 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
5
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
+ size?: "sm" | "lg" | "default" | "icon" | null | undefined;
6
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
- }): import("react/jsx-runtime").JSX.Element;
9
+ }): React.JSX.Element;
10
10
  export { Button, buttonVariants };
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
- declare function Card({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
- declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
4
- declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
5
- declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
6
- declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
- declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
- declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
2
+ declare function Card({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
3
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
4
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
5
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
6
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
7
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
8
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
9
9
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -1,15 +1,15 @@
1
1
  import * as React from "react";
2
2
  import * as DialogPrimitive from "@radix-ui/react-dialog";
3
- declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
- declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
- declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
- declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
5
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
6
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
8
8
  declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
9
  showCloseButton?: boolean;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
- declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
13
- declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
14
- declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
10
+ }): React.JSX.Element;
11
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
14
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
15
15
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -2,8 +2,8 @@ import * as React from "react";
2
2
  import * as LabelPrimitive from "@radix-ui/react-label";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
4
  import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
5
- declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
- declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
5
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, handleSubmit, unregister, control, register, setFocus, subscribe, }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
7
7
  declare const useFormField: () => {
8
8
  invalid: boolean;
9
9
  isDirty: boolean;
@@ -16,9 +16,9 @@ declare const useFormField: () => {
16
16
  formDescriptionId: string;
17
17
  formMessageId: string;
18
18
  };
19
- declare function FormItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
20
- declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
21
- declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
22
- declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
23
- declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element | null;
19
+ declare function FormItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
20
+ declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
21
+ declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): React.JSX.Element;
22
+ declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
23
+ declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element | null;
24
24
  export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
@@ -1,3 +1,3 @@
1
1
  import * as React from "react";
2
- declare function Input({ className, type, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
3
3
  export { Input };
@@ -1,4 +1,4 @@
1
1
  import * as React from "react";
2
2
  import * as LabelPrimitive from "@radix-ui/react-label";
3
- declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
4
4
  export { Label };
@@ -1,3 +1,3 @@
1
1
  import * as React from "react";
2
2
  import * as ProgressPrimitive from "@radix-ui/react-progress";
3
- export declare function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
2
  import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3
- declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
3
+ declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
4
+ declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element;
5
5
  export { RadioGroup, RadioGroupItem };
@@ -1,15 +1,15 @@
1
1
  import * as React from "react";
2
2
  import * as SelectPrimitive from "@radix-ui/react-select";
3
- declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
5
- declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
4
+ declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
5
+ declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
6
6
  declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
7
  size?: "sm" | "default";
8
- }): import("react/jsx-runtime").JSX.Element;
9
- declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
10
- declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
11
- declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
12
- declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
13
- declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
14
- declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
8
+ }): React.JSX.Element;
9
+ declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
10
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
11
+ declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
12
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
13
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
14
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
15
15
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -1,13 +1,13 @@
1
1
  import * as React from "react";
2
2
  import * as SheetPrimitive from "@radix-ui/react-dialog";
3
- declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
- declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
4
+ declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
5
+ declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
6
6
  declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
7
7
  side?: "top" | "right" | "bottom" | "left";
8
- }): import("react/jsx-runtime").JSX.Element;
9
- declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
10
- declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
11
- declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
12
- declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
8
+ }): React.JSX.Element;
9
+ declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
12
+ declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
13
13
  export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -1,2 +1,2 @@
1
- declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
1
+ declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
2
2
  export { Skeleton };
@@ -1,3 +1,3 @@
1
1
  import type { ToasterProps } from "sonner";
2
- declare const Toaster: ({ ...props }: ToasterProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Toaster: ({ ...props }: ToasterProps) => import("react").JSX.Element;
3
3
  export { Toaster };
@@ -9,7 +9,7 @@ export interface SpinnerProps extends React.SVGProps<SVGSVGElement> {
9
9
  /**
10
10
  * A simple rotating spinner component using Lucide's Loader2 icon and Tailwind CSS
11
11
  */
12
- export declare function Spinner({ size, className, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function Spinner({ size, className, ...props }: SpinnerProps): React.JSX.Element;
13
13
  export interface LoadingOverlayProps {
14
14
  /**
15
15
  * When true, shows the overlay spinner; otherwise renders children normally
@@ -21,4 +21,4 @@ export interface LoadingOverlayProps {
21
21
  /**
22
22
  * Wraps content and displays a centered spinner overlay when loading
23
23
  */
24
- export declare function LoadingOverlay({ isLoading, className, children }: LoadingOverlayProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function LoadingOverlay({ isLoading, className, children }: LoadingOverlayProps): React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import * as React from "react";
2
- declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
3
3
  export { Textarea };
@@ -11,6 +11,7 @@ export declare enum FileKind {
11
11
  export declare function filePreviewName(path: string): string;
12
12
  export declare function classifyFile(path: string): FileKind;
13
13
  export declare function isImagePath(path: string): boolean;
14
+ export declare function filePreviewLoadsFromRoomStorage(path: string): boolean;
14
15
  export declare function ImagePreview({ room, path, alt, }: {
15
16
  room: RoomClient;
16
17
  path: string;
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
  var file_preview_exports = {};
20
30
  __export(file_preview_exports, {
@@ -26,6 +36,7 @@ __export(file_preview_exports, {
26
36
  SourcePreview: () => SourcePreview,
27
37
  VideoPreview: () => VideoPreview,
28
38
  classifyFile: () => classifyFile,
39
+ filePreviewLoadsFromRoomStorage: () => filePreviewLoadsFromRoomStorage,
29
40
  filePreviewName: () => filePreviewName,
30
41
  isImagePath: () => isImagePath
31
42
  });
@@ -33,7 +44,6 @@ module.exports = __toCommonJS(file_preview_exports);
33
44
  var import_jsx_runtime = require("react/jsx-runtime");
34
45
  var import_react = require("react");
35
46
  var import_lucide_react = require("lucide-react");
36
- var import_react_pdf = require("react-pdf");
37
47
  var import_react_syntax_highlighter = require("react-syntax-highlighter");
38
48
  var import_prism = require("react-syntax-highlighter/dist/esm/styles/prism");
39
49
  var import_dialog = require("../components/ui/dialog.js");
@@ -41,7 +51,6 @@ var import_button = require("../components/ui/button.js");
41
51
  var import_spinner = require("../components/ui/spinner.js");
42
52
  var import_utils = require("../lib/utils.js");
43
53
  var import_agent_thread = require("../chat/agent-thread.js");
44
- import_react_pdf.pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${import_react_pdf.pdfjs.version}/build/pdf.worker.min.mjs`;
45
54
  var FileKind = /* @__PURE__ */ ((FileKind2) => {
46
55
  FileKind2["Image"] = "image";
47
56
  FileKind2["Video"] = "video";
@@ -228,6 +237,10 @@ function classifyFile(path) {
228
237
  function isImagePath(path) {
229
238
  return classifyFile(path) === "image" /* Image */;
230
239
  }
240
+ function filePreviewLoadsFromRoomStorage(path) {
241
+ const kind = classifyFile(path);
242
+ return kind === "source" /* Source */ || kind === "pdf" /* Pdf */;
243
+ }
231
244
  function useDownloadUrl(room, path) {
232
245
  const [url, setUrl] = (0, import_react.useState)(null);
233
246
  const [error, setError] = (0, import_react.useState)(null);
@@ -425,13 +438,36 @@ function useElementWidth() {
425
438
  function PdfPreview({ room, path }) {
426
439
  const { url, error } = usePdfUrl(room, path);
427
440
  const [numPages, setNumPages] = (0, import_react.useState)(0);
441
+ const [reactPdf, setReactPdf] = (0, import_react.useState)(null);
442
+ const [reactPdfError, setReactPdfError] = (0, import_react.useState)(null);
428
443
  const [containerRef, containerWidth] = useElementWidth();
429
444
  const pageWidth = Math.max(Math.min(containerWidth, 960), 320);
445
+ (0, import_react.useEffect)(() => {
446
+ let stopped = false;
447
+ import("react-pdf").then((nextReactPdf) => {
448
+ nextReactPdf.pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${nextReactPdf.pdfjs.version}/build/pdf.worker.min.mjs`;
449
+ if (!stopped) {
450
+ setReactPdf(nextReactPdf);
451
+ }
452
+ }).catch((nextError) => {
453
+ if (!stopped) {
454
+ setReactPdfError(nextError);
455
+ }
456
+ });
457
+ return () => {
458
+ stopped = true;
459
+ };
460
+ }, []);
430
461
  if (error != null) {
431
462
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorPreview, { message: `Unable to load PDF: ${String(error)}` });
432
463
  }
433
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: containerRef, className: "h-full overflow-auto bg-muted/30 p-4", children: url == null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingPreview, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
434
- import_react_pdf.Document,
464
+ if (reactPdfError != null) {
465
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorPreview, { message: `Unable to load PDF renderer: ${String(reactPdfError)}` });
466
+ }
467
+ const Document = reactPdf?.Document;
468
+ const Page = reactPdf?.Page;
469
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: containerRef, className: "h-full overflow-auto bg-muted/30 p-4", children: url == null || Document == null || Page == null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingPreview, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
470
+ Document,
435
471
  {
436
472
  file: url,
437
473
  loading: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingPreview, {}),
@@ -440,7 +476,7 @@ function PdfPreview({ room, path }) {
440
476
  setNumPages(nextNumPages);
441
477
  },
442
478
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-col items-center gap-4", children: Array.from({ length: numPages }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
443
- import_react_pdf.Page,
479
+ Page,
444
480
  {
445
481
  pageNumber: index + 1,
446
482
  width: pageWidth,
@@ -7,8 +7,11 @@ export * from './chat/conversation-descriptor.js';
7
7
  export * from './chat/file-attachment.js';
8
8
  export * from './chat/file-uploader.js';
9
9
  export * from './chat/multi-thread-view.js';
10
+ export * from './chat/thread-list-view.js';
10
11
  export * from './chat/agent-thread.js';
11
12
  export * from './chat/new-chat-thread.js';
13
+ export * from './chat/tool-call-status-accumulator.js';
14
+ export { AgentThreadMessageStatusStore, resolveChatThreadStatusFromStore, shouldShowChatThreadStatus, trackAgentThreadStatusMessageInStore } from './chat/agent-thread-message-status-store.js';
12
15
  export * from './file-preview/file-preview.js';
13
16
  export * from './forms/email-address.js';
14
17
  export * from './forms/form.js';