@agents24/chat-react 0.5.30 → 0.5.31
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/README.md +9 -4
- package/dist/generated/delegation-types.d.ts +129 -0
- package/dist/registry/agents24-chat.json +37 -19
- package/dist/runtime/index.cjs +52 -0
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +51 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/use-delegation-tasks.d.ts +20 -0
- package/dist/scaffold/app.d.ts +2 -1
- package/dist/scaffold/components/chat/chat-composer.d.ts +4 -1
- package/dist/scaffold/components/chat/subagent-tasks.d.ts +3 -0
- package/dist/scaffold/components/theme-provider.d.ts +4 -3
- package/dist/scaffold/index.cjs +425 -280
- package/dist/scaffold/index.cjs.map +1 -1
- package/dist/scaffold/index.d.ts +3 -2
- package/dist/scaffold/index.js +416 -271
- package/dist/scaffold/index.js.map +1 -1
- package/dist/styles.css +14 -0
- package/dist/ui/adapters.d.ts +5 -2
- package/dist/ui/agent-chat-composer.d.ts +2 -1
- package/dist/ui/agent-chat-queue.d.ts +0 -2
- package/dist/ui/index.cjs +306 -260
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.js +308 -263
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/tool-sessions.d.ts +10 -2
- package/dist/ui/use-agent-chat-composer.d.ts +25 -26
- package/dist/ui/use-audio-recorder.d.ts +4 -2
- package/package.json +4 -3
- package/scaffold/host-styles.css +3 -0
- package/scaffold/manifest.json +2 -2
- package/scaffold/src/app.tsx +4 -1
- package/scaffold/src/chat.css +11 -1
- package/scaffold/src/components/chat/chat-composer.tsx +36 -19
- package/scaffold/src/components/chat/chat-shell.tsx +5 -4
- package/scaffold/src/components/chat/external-link-dialog.tsx +6 -5
- package/scaffold/src/components/chat/identity-control.tsx +0 -1
- package/scaffold/src/components/chat/subagent-tasks.tsx +109 -0
- package/scaffold/src/components/theme-provider.tsx +30 -27
- package/scaffold/src/components/ui/tooltip.tsx +3 -0
- package/scaffold/src/host.css +11 -0
- package/scaffold/src/index.css +1 -213
- package/scaffold/src/index.tsx +4 -2
- package/scaffold/src/theme.css +215 -0
package/dist/styles.css
CHANGED
|
@@ -255,6 +255,9 @@ button.a24-tool-trigger:focus-visible { outline: 2px solid var(--a24-focus); out
|
|
|
255
255
|
.a24-chat-attachments { align-self: stretch; justify-content: safe flex-end; max-width: 100%; scrollbar-width: none; width: 100%; }
|
|
256
256
|
.a24-chat-attachments[dir="rtl"] { justify-content: safe flex-start; }
|
|
257
257
|
.a24-chat-attachment { align-items: center; border-radius: var(--radius, .75rem); flex-wrap: nowrap; max-width: min(22rem, 100%); min-height: 2.5rem; padding: .375rem .625rem !important; }
|
|
258
|
+
.a24-composer-attachment-row { padding: .5rem .375rem; }
|
|
259
|
+
.a24-composer-attachment-row .a24-chat-attachments { padding-top: 0; align-items: center; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; }
|
|
260
|
+
.a24-composer-attachment-row .a24-chat-attachment { flex-shrink: 0; }
|
|
258
261
|
.a24-chat-attachment-icon { border-radius: 0 !important; height: 1.75rem; width: 1.75rem; }
|
|
259
262
|
.a24-chat-attachment-icon svg { display: block; height: 100%; width: 100%; }
|
|
260
263
|
.a24-chat-attachment-content { overflow: hidden; }
|
|
@@ -263,6 +266,17 @@ button.a24-tool-trigger:focus-visible { outline: 2px solid var(--a24-focus); out
|
|
|
263
266
|
.a24-chat-image-media img { height: 100%; object-fit: cover; width: 100%; }
|
|
264
267
|
.a24-chat-image-spinner { color: var(--a24-muted); }
|
|
265
268
|
.a24-chat-image-remove { align-items: center; background: color-mix(in srgb, var(--a24-background) 88%, transparent); border: 0; border-radius: .375rem; color: var(--a24-text); display: inline-flex; height: 1.5rem; justify-content: center; position: absolute; right: .375rem; top: .375rem; width: 1.5rem; z-index: 2; }
|
|
269
|
+
/* Only draft cards change size; sent-message attachment styles stay above. */
|
|
270
|
+
.a24-composer-attachment-row .a24-composer-attachment-card { width: 7rem; height: 7rem; min-width: 0; max-width: none; flex: 0 0 7rem; overflow: hidden; border-radius: .625rem; }
|
|
271
|
+
.a24-composer-attachment-row .a24-chat-attachment { display: grid; grid-template-columns: 1rem minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 2rem; gap: 0 .5rem; align-items: center; padding: 0 .625rem !important; }
|
|
272
|
+
.a24-composer-file-preview { grid-column: 1 / -1; align-self: stretch; display: flex; align-items: center; justify-content: center; margin-inline: -.625rem; background: var(--a24-surface, #f5f5f5); border-bottom: 1px solid var(--a24-border, #e5e5e5); }
|
|
273
|
+
.a24-composer-file-preview svg { width: 2.5rem; height: 2.5rem; }
|
|
274
|
+
.a24-composer-attachment-row .a24-chat-attachment-icon { grid-row: 2; width: 1rem; height: 1rem; }
|
|
275
|
+
.a24-composer-attachment-row .a24-chat-attachment-content { grid-row: 2; font-size: .75rem; }
|
|
276
|
+
.a24-composer-attachment-row .a24-chat-attachment > button { position: absolute; right: .375rem; top: .375rem; background: var(--a24-background, white); }
|
|
277
|
+
.a24-composer-attachment-row .a24-chat-image-attachment { flex-wrap: nowrap; border: 1px solid var(--a24-border, #e5e5e5); padding: 0 !important; gap: 0; }
|
|
278
|
+
.a24-composer-attachment-row .a24-chat-image-media { width: 100% !important; height: calc(100% - 2rem); border-radius: 0 !important; }
|
|
279
|
+
.a24-composer-image-caption { display: block; width: 100%; height: 2rem; padding: .375rem .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
|
|
266
280
|
.a24-chat-message-content { display: flex; flex-direction: column; max-width: 100%; min-width: 0; }
|
|
267
281
|
.a24-chat-message-content--user { align-self: flex-end; max-width: 80%; overflow: visible; width: fit-content; }
|
|
268
282
|
.a24-chat-message-content--assistant { overflow: visible; width: 100%; }
|
package/dist/ui/adapters.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type ChatAttachmentData = Agents24ChatAttachment & {
|
|
|
27
27
|
};
|
|
28
28
|
export type ChatAttachmentProps = React.ComponentProps<typeof Attachment> & {
|
|
29
29
|
data: ChatAttachmentData;
|
|
30
|
+
presentation?: "message" | "composer";
|
|
30
31
|
onRemove?: () => void;
|
|
31
32
|
resolveContent?: ChatAttachmentContentResolver;
|
|
32
33
|
};
|
|
@@ -35,13 +36,15 @@ export type ChatAttachmentContentResult = {
|
|
|
35
36
|
validUntil?: string | null;
|
|
36
37
|
};
|
|
37
38
|
export type ChatAttachmentContentResolver = (attachment: ChatAttachmentData, signal: AbortSignal) => Promise<ChatAttachmentContentResult>;
|
|
38
|
-
export declare function ChatAttachment({ className, data, onRemove, orientation, resolveContent, ...props }: ChatAttachmentProps): React.ReactElement;
|
|
39
|
+
export declare function ChatAttachment({ className, data, presentation, onRemove, orientation, resolveContent, ...props }: ChatAttachmentProps): React.ReactElement;
|
|
39
40
|
export type ChatAttachmentsProps = React.ComponentProps<typeof AttachmentGroup>;
|
|
40
41
|
export declare function ChatAttachments({ children, className, ...props }: ChatAttachmentsProps): React.ReactElement | null;
|
|
41
42
|
export type ChatAttachmentRowsProps = Omit<React.ComponentProps<"div">, "children"> & {
|
|
42
43
|
attachments: readonly ChatAttachmentData[];
|
|
44
|
+
/** Composer drafts use one left-aligned row; transcript grouping stays unchanged. */
|
|
45
|
+
layout?: "message" | "composer";
|
|
43
46
|
onRemove?: (attachment: ChatAttachmentData) => void;
|
|
44
47
|
resolveContent?: ChatAttachmentContentResolver;
|
|
45
48
|
};
|
|
46
|
-
export declare function ChatAttachmentRows({ attachments, className, dir, onRemove, resolveContent, ...props }: ChatAttachmentRowsProps): React.ReactElement | null;
|
|
49
|
+
export declare function ChatAttachmentRows({ attachments, layout, className, dir, onRemove, resolveContent, ...props }: ChatAttachmentRowsProps): React.ReactElement | null;
|
|
47
50
|
export { ChatAttachment as MessageAttachment, ChatAttachmentRows as MessageAttachmentRows, ChatAttachments as MessageAttachments, ChatMessage as Message, ChatMessageAction as MessageAction, ChatMessageActions as MessageActions, ChatMessageContent as MessageContent, };
|
|
@@ -14,6 +14,7 @@ export type AgentChatComposerProps = {
|
|
|
14
14
|
contextWindow?: ContextWindow | null;
|
|
15
15
|
accept?: string;
|
|
16
16
|
allowAttachments?: boolean;
|
|
17
|
+
/** @deprecated Draft attachments are always contained inside the composer. */
|
|
17
18
|
attachmentLayout?: "flow" | "overlay";
|
|
18
19
|
className?: string;
|
|
19
20
|
disabled?: boolean;
|
|
@@ -33,4 +34,4 @@ export type AgentChatComposerProps = {
|
|
|
33
34
|
} | null;
|
|
34
35
|
textareaRef?: React.Ref<HTMLTextAreaElement>;
|
|
35
36
|
};
|
|
36
|
-
export declare function AgentChatComposer({ inputContract, recordingEnabled, contextWindow, accept, allowAttachments,
|
|
37
|
+
export declare function AgentChatComposer({ inputContract, recordingEnabled, contextWindow, accept, allowAttachments, className, disabled, forceExpanded, focusKey, inputToolbarContent, isRunning, isCancelling, onAttachmentCountChange, onStop, onSubmit, placeholder, restoredDraft, textareaRef, }: AgentChatComposerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,6 @@ import type { ThreadMessage, ThreadMessageQueueState } from "@agents24/client";
|
|
|
2
2
|
export type AgentChatQueueProps = {
|
|
3
3
|
pending: readonly ThreadMessage[];
|
|
4
4
|
queue: ThreadMessageQueueState | null;
|
|
5
|
-
canSteer: boolean;
|
|
6
|
-
onSteer(message: ThreadMessage): Promise<void>;
|
|
7
5
|
onRemove(message: ThreadMessage): Promise<void>;
|
|
8
6
|
onEdit(message: ThreadMessage): Promise<void>;
|
|
9
7
|
onResume(): Promise<void>;
|