@meshagent/meshagent-tailwind 0.49.1 → 0.51.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.
- package/CHANGELOG.md +14 -0
- package/README.md +30 -0
- package/dist/cjs/chat/agent-thread.d.ts +17 -12
- package/dist/cjs/chat/agent-thread.js +166 -284
- package/dist/cjs/chat/chat-bot-view.d.ts +5 -4
- package/dist/cjs/chat/chat-bot-view.js +2 -0
- package/dist/cjs/chat/chat-feed-widget.d.ts +3 -4
- package/dist/cjs/chat/chat-feed-widget.js +10 -10
- package/dist/cjs/chat/chat-hooks.d.ts +1 -1
- package/dist/cjs/chat/chat-hooks.js +1 -4
- package/dist/cjs/chat/chat-input.js +2 -2
- package/dist/cjs/chat/chat-typing-indicator.d.ts +2 -4
- package/dist/cjs/chat/chat-typing-indicator.js +4 -7
- package/dist/cjs/chat/dataset-agent-thread.d.ts +10 -8
- package/dist/cjs/chat/dataset-agent-thread.js +13 -5
- package/dist/cjs/chat/multi-thread-view.d.ts +7 -7
- package/dist/cjs/chat/multi-thread-view.js +2 -2
- package/dist/cjs/chat/new-chat-thread.d.ts +7 -6
- package/dist/cjs/chat/new-chat-thread.js +29 -52
- package/dist/cjs/chat/thread-view.d.ts +7 -7
- package/dist/cjs/chat/thread-view.js +21 -6
- package/dist/cjs/components/ui/form.d.ts +1 -1
- package/dist/esm/chat/agent-thread.d.ts +17 -12
- package/dist/esm/chat/agent-thread.js +168 -286
- package/dist/esm/chat/chat-bot-view.d.ts +5 -4
- package/dist/esm/chat/chat-bot-view.js +2 -0
- package/dist/esm/chat/chat-feed-widget.d.ts +3 -4
- package/dist/esm/chat/chat-feed-widget.js +10 -10
- package/dist/esm/chat/chat-hooks.d.ts +1 -1
- package/dist/esm/chat/chat-hooks.js +1 -4
- package/dist/esm/chat/chat-input.js +2 -2
- package/dist/esm/chat/chat-typing-indicator.d.ts +2 -4
- package/dist/esm/chat/chat-typing-indicator.js +4 -7
- package/dist/esm/chat/dataset-agent-thread.d.ts +10 -8
- package/dist/esm/chat/dataset-agent-thread.js +13 -5
- package/dist/esm/chat/multi-thread-view.d.ts +7 -7
- package/dist/esm/chat/multi-thread-view.js +2 -2
- package/dist/esm/chat/new-chat-thread.d.ts +7 -6
- package/dist/esm/chat/new-chat-thread.js +29 -52
- package/dist/esm/chat/thread-view.d.ts +7 -7
- package/dist/esm/chat/thread-view.js +21 -6
- package/dist/esm/components/ui/form.d.ts +1 -1
- package/dist/index.css +1 -1
- package/package.json +6 -6
|
@@ -40,6 +40,15 @@ function MultiThreadUnavailable() {
|
|
|
40
40
|
] })
|
|
41
41
|
] }) }) });
|
|
42
42
|
}
|
|
43
|
+
function RoomUnavailable({ message }) {
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex min-h-0 flex-1 items-center justify-center px-4 py-8", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full max-w-[912px] rounded-3xl border border-destructive/30 bg-destructive/5 p-6 text-destructive", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertTriangle, { className: "mt-0.5 h-5 w-5 shrink-0" }),
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-lg font-semibold", children: "Unable to open chat" }),
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1 text-sm text-destructive/80", children: message })
|
|
49
|
+
] })
|
|
50
|
+
] }) }) });
|
|
51
|
+
}
|
|
43
52
|
function ThreadView({
|
|
44
53
|
room,
|
|
45
54
|
chatClient = null,
|
|
@@ -60,10 +69,10 @@ function ThreadView({
|
|
|
60
69
|
onSelectedThreadResolved,
|
|
61
70
|
newThreadResetVersion = 0,
|
|
62
71
|
clientToolkits,
|
|
72
|
+
clientTools,
|
|
63
73
|
chatFeedWidgets,
|
|
64
74
|
toolChoice,
|
|
65
75
|
collapseMessages = true,
|
|
66
|
-
suggestions,
|
|
67
76
|
enableFileUpload = false,
|
|
68
77
|
threadSource = "session",
|
|
69
78
|
rowsLoader,
|
|
@@ -80,6 +89,12 @@ function ThreadView({
|
|
|
80
89
|
const resolvedDocumentPath = normalizePath(documentPath ?? path);
|
|
81
90
|
const resolvedSingleThreadPath = resolvedDocumentPath ?? (0, import_conversation_descriptor.chatDocumentPath)(agentName, { threadDir });
|
|
82
91
|
const activeChatClient = chatClient ?? void 0;
|
|
92
|
+
if (room == null && activeChatClient == null) {
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RoomUnavailable, { message: "ThreadView requires either a room or a chat client." });
|
|
94
|
+
}
|
|
95
|
+
if (threadSource === "dataset" && room == null && rowsLoader == null) {
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RoomUnavailable, { message: "Dataset-backed threads require a room connection or rows loader." });
|
|
97
|
+
}
|
|
83
98
|
if (threadDisplayMode !== import_conversation_descriptor.ChatThreadDisplayMode.MultiThreadComposer) {
|
|
84
99
|
if (threadSource === "dataset") {
|
|
85
100
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -94,10 +109,10 @@ function ThreadView({
|
|
|
94
109
|
emptyStateTitle,
|
|
95
110
|
emptyStateDescription,
|
|
96
111
|
clientToolkits,
|
|
112
|
+
clientTools,
|
|
97
113
|
chatFeedWidgets,
|
|
98
114
|
toolChoice,
|
|
99
115
|
collapseMessages,
|
|
100
|
-
suggestions,
|
|
101
116
|
enableFileUpload,
|
|
102
117
|
loadThread,
|
|
103
118
|
injectPersistedEvents,
|
|
@@ -120,10 +135,10 @@ function ThreadView({
|
|
|
120
135
|
emptyStateTitle,
|
|
121
136
|
emptyStateDescription,
|
|
122
137
|
clientToolkits,
|
|
138
|
+
clientTools,
|
|
123
139
|
chatFeedWidgets,
|
|
124
140
|
toolChoice,
|
|
125
141
|
collapseMessages,
|
|
126
|
-
suggestions,
|
|
127
142
|
enableFileUpload,
|
|
128
143
|
persistedEvents,
|
|
129
144
|
loadThread,
|
|
@@ -154,9 +169,9 @@ function ThreadView({
|
|
|
154
169
|
newThreadResetVersion,
|
|
155
170
|
centerComposer,
|
|
156
171
|
clientToolkits,
|
|
172
|
+
clientTools,
|
|
157
173
|
chatFeedWidgets,
|
|
158
174
|
toolChoice,
|
|
159
|
-
suggestions,
|
|
160
175
|
enableFileUpload,
|
|
161
176
|
onThreadStarted,
|
|
162
177
|
builder: (threadPath) => threadSource === "dataset" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -171,10 +186,10 @@ function ThreadView({
|
|
|
171
186
|
emptyStateTitle: startNewThreadTitle,
|
|
172
187
|
emptyStateDescription: startNewThreadDescription,
|
|
173
188
|
clientToolkits,
|
|
189
|
+
clientTools,
|
|
174
190
|
chatFeedWidgets,
|
|
175
191
|
toolChoice,
|
|
176
192
|
collapseMessages,
|
|
177
|
-
suggestions,
|
|
178
193
|
enableFileUpload,
|
|
179
194
|
loadThread,
|
|
180
195
|
injectPersistedEvents,
|
|
@@ -195,10 +210,10 @@ function ThreadView({
|
|
|
195
210
|
emptyStateTitle: startNewThreadTitle,
|
|
196
211
|
emptyStateDescription: startNewThreadDescription,
|
|
197
212
|
clientToolkits,
|
|
213
|
+
clientTools,
|
|
198
214
|
chatFeedWidgets,
|
|
199
215
|
toolChoice,
|
|
200
216
|
collapseMessages,
|
|
201
|
-
suggestions,
|
|
202
217
|
enableFileUpload,
|
|
203
218
|
persistedEvents,
|
|
204
219
|
loadThread,
|
|
@@ -2,7 +2,7 @@ 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>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
5
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getErrors, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
6
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactElement } from "react";
|
|
2
|
-
import type { RoomClient } from "@meshagent/meshagent";
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { RoomClient, Tool } from "@meshagent/meshagent";
|
|
3
3
|
import type { AgentMessage, AgentMessageEvent, BaseChatClient, ClientToolkitDescription } from "@meshagent/meshagent-agents";
|
|
4
4
|
import type { AgentUsageSnapshot } from "./chat-thread-timeline.js";
|
|
5
5
|
export { AgentUsageSnapshot, shouldReplaceAgentUsageSnapshot } from "./chat-thread-timeline.js";
|
|
@@ -13,23 +13,22 @@ export declare class AgentToolChoice {
|
|
|
13
13
|
});
|
|
14
14
|
toJson(): Record<string, string>;
|
|
15
15
|
}
|
|
16
|
-
export interface AgentThreadSuggestion {
|
|
17
|
-
label: string;
|
|
18
|
-
prompt?: string;
|
|
19
|
-
}
|
|
20
16
|
export interface AgentThreadProps {
|
|
21
|
-
room
|
|
17
|
+
room?: RoomClient;
|
|
22
18
|
path: string;
|
|
23
19
|
chatClient?: BaseChatClient;
|
|
24
20
|
disposeChatClient?: boolean;
|
|
25
21
|
agentName?: string;
|
|
26
22
|
emptyStateTitle?: string;
|
|
27
23
|
emptyStateDescription?: string;
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
/** Description-only client tools whose execution is owned outside this component. */
|
|
25
|
+
clientToolkits?: readonly ClientToolkitDescription[];
|
|
26
|
+
/** Client tools executed locally without rendering conversation-feed rows. */
|
|
27
|
+
clientTools?: readonly Tool[];
|
|
28
|
+
/** Client tools executed locally with custom feed rendering or feed behavior. */
|
|
29
|
+
chatFeedWidgets?: readonly ChatFeedWidget[];
|
|
30
30
|
toolChoice?: AgentToolChoice;
|
|
31
31
|
collapseMessages?: boolean;
|
|
32
|
-
suggestions?: readonly AgentThreadSuggestion[];
|
|
33
32
|
enableFileUpload?: boolean;
|
|
34
33
|
persistedEvents?: readonly AgentMessageEvent[];
|
|
35
34
|
deferLiveEvents?: boolean;
|
|
@@ -45,6 +44,9 @@ export interface AgentThreadProps {
|
|
|
45
44
|
onPersistedEventsInjected?: (error: unknown | null) => void;
|
|
46
45
|
onEventsChanged?: (threadId: string, events: readonly AgentMessageEvent[], latestMessage: AgentMessage | null) => void;
|
|
47
46
|
}
|
|
47
|
+
export interface AgentThreadProviderProps extends AgentThreadProps {
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
}
|
|
48
50
|
export declare function formatAgentUsageTokenCount(value: number): string;
|
|
49
51
|
export declare function formatAgentUsageFooter(usage: AgentUsageSnapshot): string;
|
|
50
52
|
export declare function formatAgentUsageTooltip(usage: AgentUsageSnapshot): string;
|
|
@@ -79,9 +81,12 @@ export interface EventLineProps {
|
|
|
79
81
|
}
|
|
80
82
|
export declare function EventLine({ headline, details, state, failed, className }: EventLineProps): ReactElement | null;
|
|
81
83
|
export interface ChatThreadPreviewProps {
|
|
82
|
-
room
|
|
84
|
+
room?: RoomClient;
|
|
83
85
|
path: string;
|
|
84
86
|
className?: string;
|
|
85
87
|
}
|
|
86
88
|
export declare function ChatThreadPreview({ room, path, className }: ChatThreadPreviewProps): ReactElement;
|
|
87
|
-
export declare function
|
|
89
|
+
export declare function AgentThreadProvider({ children, room, path, chatClient, disposeChatClient, agentName, emptyStateTitle, emptyStateDescription, clientToolkits, clientTools, chatFeedWidgets, collapseMessages, enableFileUpload, persistedEvents, deferLiveEvents, loadThread, injectPersistedEvents, composerDisabled: composerDisabledProp, closeThreadOnUnmount, onPersistedEventsInjectionStarted, onPersistedEventsInjected, onEventsChanged, }: AgentThreadProviderProps): ReactElement;
|
|
90
|
+
export declare function AgentThreadFeed(): ReactElement;
|
|
91
|
+
export declare function AgentThreadInput(): ReactElement;
|
|
92
|
+
export declare function AgentThread(props: AgentThreadProps): ReactElement;
|