@meshagent/meshagent-tailwind 0.55.1 → 0.56.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 (38) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +34 -3
  3. package/dist/cjs/chat/agent-thread.d.ts +42 -7
  4. package/dist/cjs/chat/agent-thread.js +422 -183
  5. package/dist/cjs/chat/chat-input-state.d.ts +2 -0
  6. package/dist/cjs/chat/chat-input-state.js +41 -0
  7. package/dist/cjs/chat/chat-input.d.ts +14 -2
  8. package/dist/cjs/chat/chat-input.js +41 -76
  9. package/dist/cjs/chat/chat-scroller.js +45 -43
  10. package/dist/cjs/chat/chat-thread-timeline.d.ts +2 -0
  11. package/dist/cjs/chat/chat-thread-timeline.js +83 -10
  12. package/dist/cjs/chat/composer-action-button.d.ts +11 -0
  13. package/dist/cjs/chat/composer-action-button.js +68 -0
  14. package/dist/cjs/chat/use-chat-virtualizer.d.ts +14 -17
  15. package/dist/cjs/chat/use-chat-virtualizer.js +288 -222
  16. package/dist/cjs/chat/virtualization.d.ts +0 -5
  17. package/dist/cjs/chat/virtualization.js +4 -6
  18. package/dist/cjs/index.d.ts +1 -0
  19. package/dist/cjs/index.js +1 -0
  20. package/dist/esm/chat/agent-thread.d.ts +42 -7
  21. package/dist/esm/chat/agent-thread.js +424 -186
  22. package/dist/esm/chat/chat-input-state.d.ts +2 -0
  23. package/dist/esm/chat/chat-input-state.js +21 -0
  24. package/dist/esm/chat/chat-input.d.ts +14 -2
  25. package/dist/esm/chat/chat-input.js +41 -76
  26. package/dist/esm/chat/chat-scroller.js +46 -44
  27. package/dist/esm/chat/chat-thread-timeline.d.ts +2 -0
  28. package/dist/esm/chat/chat-thread-timeline.js +83 -10
  29. package/dist/esm/chat/composer-action-button.d.ts +11 -0
  30. package/dist/esm/chat/composer-action-button.js +48 -0
  31. package/dist/esm/chat/use-chat-virtualizer.d.ts +14 -17
  32. package/dist/esm/chat/use-chat-virtualizer.js +290 -226
  33. package/dist/esm/chat/virtualization.d.ts +0 -5
  34. package/dist/esm/chat/virtualization.js +4 -6
  35. package/dist/esm/index.d.ts +1 -0
  36. package/dist/esm/index.js +1 -0
  37. package/dist/index.css +1 -1
  38. package/package.json +6 -5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [0.56.0]
2
+ - Stability
3
+
4
+ ## [0.55.2]
5
+ - Added independently placeable agent-thread submit buttons and customizable composer action buttons, including custom icons, labels, ARIA text, styles, and layout slots while retaining existing defaults.
6
+ - Added agent-feed composition APIs for rendering application-owned content after feed items or before the oldest item, and for accessing visible feed state in chronological order.
7
+ - Added optional status-indicator suppression, external active-turn interruption controls, and submission-started/submission-failed callbacks.
8
+ - Stabilized virtualized chat scrolling across dynamic resizing, history loading, user scrolling, and bottom-following behavior.
9
+ - Improved client-tool request correlation so duplicate and replayed requests retain the correct lifecycle and execution status.
10
+ - Updated bundled synchronization redo handling to accept valid remote map changes.
11
+
1
12
  ## [0.55.1]
2
13
  - Added SQLite replication modes and settings, create-time replication options, database-settings retrieval and updates, and explicit database flushing.
3
14
 
@@ -25,6 +36,7 @@
25
36
  - Stability
26
37
 
27
38
  ## [0.53.2]
39
+ - Exposed `useAgentThreadFeedState` and `AgentThreadFeed.renderUnanchored` for application-owned feed content and SDK compatibility.
28
40
  - Added project profile views, inheritance updates, typed profile models, and sysadmin global user search and profile administration.
29
41
  - Project updates now use project-local overrides and require `user_profile_editor`; global profile access is self-only and global annotations require sysadmin APIs.
30
42
 
@@ -54,6 +66,7 @@
54
66
 
55
67
  ## [0.51.5]
56
68
  - Stability
69
+ - Added an optional `AgentThreadFeed.renderAfterItem` presentation hook for rendering application-owned content after visible chat items.
57
70
 
58
71
  ## [0.51.4]
59
72
  - Stability
@@ -73,6 +86,8 @@
73
86
 
74
87
  ## [0.50.1]
75
88
  - Stability
89
+ - Added a separately placeable `AgentThreadSubmitButton` while preserving the combined `AgentThreadInput` API.
90
+ - Added presentation overrides for the separate submit button while preserving its default icon and styling.
76
91
 
77
92
  ## [0.50.0]
78
93
  - Chat clients now support per-turn LLM authorization providers, and websocket chat tokens are optional for `auth=none` deployments.
@@ -755,3 +770,8 @@ START SUMMARY OF PYTHON API CHANGES END SUMMARY OF PYTHON API CHANGES
755
770
 
756
771
  ## [0.7.1]
757
772
  - Stability
773
+
774
+ ### Thread status customization
775
+
776
+ - Added optional progress-overlay suppression, external interrupt controls, and
777
+ submission lifecycle callbacks. Existing status display remains the default.
package/README.md CHANGED
@@ -92,7 +92,9 @@ import {
92
92
  AgentThreadFeed,
93
93
  AgentThreadInput,
94
94
  AgentThreadProvider,
95
+ AgentThreadSubmitButton,
95
96
  } from "@meshagent/meshagent-tailwind";
97
+ import { MoveRight } from "lucide-react";
96
98
 
97
99
  export function SeparatedAgentThread({ roomClient, chatClient, threadPath }) {
98
100
  return (
@@ -105,15 +107,23 @@ export function SeparatedAgentThread({ roomClient, chatClient, threadPath }) {
105
107
  <main className="min-h-0 flex-1">
106
108
  <AgentThreadFeed />
107
109
  </main>
108
- <footer>
109
- <AgentThreadInput />
110
+ <footer className="flex items-end gap-2">
111
+ <div className="min-w-0 flex-1">
112
+ <AgentThreadInput showSubmitButton={false} />
113
+ </div>
114
+ <AgentThreadSubmitButton
115
+ className="mb-1 mr-4 size-10 rounded-sm"
116
+ icon={<MoveRight />}
117
+ />
110
118
  </footer>
111
119
  </AgentThreadProvider>
112
120
  );
113
121
  }
114
122
  ```
115
123
 
116
- Keep both connected components beneath the same provider. Use `AgentThread` when the standard combined feed-and-composer layout is sufficient.
124
+ Keep all connected components beneath the same provider. By default, `AgentThreadInput` includes its Send button; set `showSubmitButton={false}` and place `AgentThreadSubmitButton` elsewhere when the layout needs to separate them. The separate button accepts `className`, `icon`, `title`, and `ariaLabel` overrides while retaining the standard SDK presentation by default. Use `AgentThread` when the standard combined feed-and-composer layout is sufficient.
125
+
126
+ `useAgentThreadFeedState()` exposes `{ items }` in chronological order using the same visible, grouped items as `AgentThreadFeed`. Call it beneath `AgentThreadProvider` to anchor application-owned content to the current feed. `AgentThreadFeed.renderAfterItem(item)` renders content after an item; `renderUnanchored()` renders content before the oldest item, or replaces the empty state when it returns content. Both render inside the feed's scroll area without sending messages to the agent.
117
127
 
118
128
  ## Meetings
119
129
 
@@ -151,3 +161,24 @@ Pass a non-empty `breakoutRoom` to `MeetingScope` or `roomClient.livekit.getConn
151
161
  ## Next Steps and Examples
152
162
 
153
163
  To see examples of agents in action and to start building your own agents check out the MeshAgent docs at [docs.meshagent.com](https://docs.meshagent.com/)
164
+
165
+ ### Custom thread status presentation
166
+
167
+ `AgentThreadFeed` accepts `showStatusIndicator={false}` to remove its progress
168
+ overlay and reserved spacing. The default remains `true`.
169
+ `useAgentThreadStatus()` exposes `{ canInterrupt, interrupt }` for a separate Stop
170
+ control. `AgentThreadProvider.onSubmissionStarted(message, steeringTurnId?)` runs
171
+ synchronously before sending; `onSubmissionFailed(message, error)` reports send
172
+ failure. These callbacks cover the composer and feed-widget submissions.
173
+
174
+ ## Chat scrolling tests
175
+
176
+ Run `npm test -- test/chat/chat-scroller.test.tsx` for deterministic resize and
177
+ scroll-anchor tests. Run `npx playwright install chromium` once, then
178
+ `npm run test:browser` for regressions with real browser layout and resize
179
+ observers. The browser command builds the component stylesheet first.
180
+ Set `PLAYWRIGHT_CHROMIUM_EXECUTABLE` to use an existing Chromium installation.
181
+
182
+ Widget resize corrections wait for 100 ms without height changes, with a 300 ms
183
+ maximum wait during continuous resizing. The feed preserves the visible message
184
+ or continues following the bottom; manual scrolling updates that choice.
@@ -1,8 +1,11 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
2
  import type { RoomClient, Tool } from "@meshagent/meshagent";
3
3
  import type { AgentMessage, AgentMessageEvent, BaseChatClient, ClientToolkitDescription } from "@meshagent/meshagent-agents";
4
- import type { AgentUsageSnapshot } from "./chat-thread-timeline.js";
4
+ import type { AgentUsageSnapshot, ChatThreadItem } from "./chat-thread-timeline.js";
5
5
  export { AgentUsageSnapshot, shouldReplaceAgentUsageSnapshot } from "./chat-thread-timeline.js";
6
+ export type { ChatThreadItem } from "./chat-thread-timeline.js";
7
+ import { type ChatInputProps } from "./chat-input.js";
8
+ import { ChatMessage } from "./chat-message.js";
6
9
  import type { ChatFeedWidget } from "./chat-feed-widget.js";
7
10
  export declare class AgentToolChoice {
8
11
  readonly toolkitName: string;
@@ -42,6 +45,9 @@ export interface AgentThreadProps {
42
45
  closeThreadOnUnmount?: boolean;
43
46
  onPersistedEventsInjectionStarted?: () => void;
44
47
  onPersistedEventsInjected?: (error: unknown | null) => void;
48
+ /** Called before a valid local submission begins any asynchronous work. */
49
+ onSubmissionStarted?: (message: ChatMessage, steeringTurnId?: string) => void;
50
+ onSubmissionFailed?: (message: ChatMessage, error: unknown) => void;
45
51
  onEventsChanged?: (threadId: string, events: readonly AgentMessageEvent[], latestMessage: AgentMessage | null) => void;
46
52
  }
47
53
  export interface AgentThreadProviderProps extends AgentThreadProps {
@@ -50,7 +56,7 @@ export interface AgentThreadProviderProps extends AgentThreadProps {
50
56
  export declare function formatAgentUsageTokenCount(value: number): string;
51
57
  export declare function formatAgentUsageFooter(usage: AgentUsageSnapshot): string;
52
58
  export declare function formatAgentUsageTooltip(usage: AgentUsageSnapshot): string;
53
- export declare function AgentUsageFooter({ usage, className }: {
59
+ export declare function AgentUsageFooter({ usage, className, }: {
54
60
  usage: AgentUsageSnapshot | null;
55
61
  className?: string;
56
62
  }): ReactElement;
@@ -69,7 +75,7 @@ export interface ShellLineProps {
69
75
  title?: string;
70
76
  className?: string;
71
77
  }
72
- export declare function ShellLine({ command, result, stdout, stderr, argumentsText, logs, title, className }: ShellLineProps): ReactElement | null;
78
+ export declare function ShellLine({ command, result, stdout, stderr, argumentsText, logs, title, className, }: ShellLineProps): ReactElement | null;
73
79
  export type EventLineState = "info" | "queued" | "running" | "in_progress" | "completed" | "failed" | "cancelled";
74
80
  export interface EventLineProps {
75
81
  headline: string;
@@ -79,14 +85,43 @@ export interface EventLineProps {
79
85
  failed?: boolean;
80
86
  className?: string;
81
87
  }
82
- export declare function EventLine({ headline, details, state, failed, className }: EventLineProps): ReactElement | null;
88
+ export declare function EventLine({ headline, details, state, failed, className, }: EventLineProps): ReactElement | null;
83
89
  export interface ChatThreadPreviewProps {
84
90
  room?: RoomClient;
85
91
  path: string;
86
92
  className?: string;
87
93
  }
88
94
  export declare function ChatThreadPreview({ room, path, className }: ChatThreadPreviewProps): ReactElement;
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;
95
+ 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, onSubmissionStarted, onSubmissionFailed, }: AgentThreadProviderProps): ReactElement;
96
+ export interface AgentThreadFeedState {
97
+ /** Visible feed items in chronological order, including grouped tool calls. */
98
+ items: readonly ChatThreadItem[];
99
+ }
100
+ export declare function useAgentThreadFeedState(): AgentThreadFeedState;
101
+ /** Controls for application-owned turn status presentations. */
102
+ export declare function useAgentThreadStatus(): {
103
+ canInterrupt: boolean;
104
+ interrupt: () => Promise<void>;
105
+ };
106
+ export interface AgentThreadFeedProps {
107
+ /** Show the built-in progress overlay and reserve its bottom spacing. Defaults to true. */
108
+ showStatusIndicator?: boolean;
109
+ /** Renders application-owned content after a visible feed item without sending it to the agent. */
110
+ renderAfterItem?: (item: ChatThreadItem) => ReactNode;
111
+ /** Renders local content before the oldest item, or in place of the empty state. */
112
+ renderUnanchored?: () => ReactNode;
113
+ }
114
+ export declare function AgentThreadFeed({ renderAfterItem, renderUnanchored, showStatusIndicator, }?: AgentThreadFeedProps): ReactElement;
115
+ export interface AgentThreadInputProps extends Pick<ChatInputProps, "className" | "inputRowClassName" | "textareaClassName" | "leadingButton"> {
116
+ showSubmitButton?: boolean;
117
+ submitButtonComponent?: ChatInputProps["submitButtonComponent"];
118
+ }
119
+ export declare function AgentThreadInput({ className, inputRowClassName, textareaClassName, leadingButton, showSubmitButton, submitButtonComponent, }?: AgentThreadInputProps): ReactElement;
120
+ export interface AgentThreadSubmitButtonProps {
121
+ className?: string;
122
+ icon?: ReactNode;
123
+ title?: string;
124
+ ariaLabel?: string;
125
+ }
126
+ export declare function AgentThreadSubmitButton({ className, icon, title, ariaLabel, }?: AgentThreadSubmitButtonProps): ReactElement;
92
127
  export declare function AgentThread(props: AgentThreadProps): ReactElement;