@agents24/chat-react 0.5.35 → 0.5.37

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 (46) hide show
  1. package/compatibility.json +5 -5
  2. package/dist/{chunk-INO5DSSJ.js → chunk-DWDHK4FZ.js} +3 -4
  3. package/dist/chunk-DWDHK4FZ.js.map +1 -0
  4. package/dist/generated/delegation-types.d.ts +3 -2
  5. package/dist/generated/run-usage.d.ts +11 -0
  6. package/dist/registry/agents24-chat.json +13 -13
  7. package/dist/runtime/index.cjs +25 -9
  8. package/dist/runtime/index.cjs.map +1 -1
  9. package/dist/runtime/index.js +24 -7
  10. package/dist/runtime/index.js.map +1 -1
  11. package/dist/runtime/input-contract.d.ts +1 -1
  12. package/dist/runtime/use-agent-chat-hitl.d.ts +2 -2
  13. package/dist/runtime/use-agent-chat-runtime.d.ts +4 -6
  14. package/dist/scaffold/app.d.ts +2 -2
  15. package/dist/scaffold/components/chat/chat-composer.d.ts +2 -1
  16. package/dist/scaffold/components/chat/chat-message.d.ts +2 -2
  17. package/dist/scaffold/components/chat/message-parts.d.ts +2 -2
  18. package/dist/scaffold/index.cjs +17 -13
  19. package/dist/scaffold/index.cjs.map +1 -1
  20. package/dist/scaffold/index.js +11 -7
  21. package/dist/scaffold/index.js.map +1 -1
  22. package/dist/styles.css +55 -0
  23. package/dist/ui/agent-chat-composer.d.ts +2 -1
  24. package/dist/ui/agent-chat-message.d.ts +6 -2
  25. package/dist/ui/agent-response-timeline.d.ts +11 -3
  26. package/dist/ui/ask-user-interaction.d.ts +5 -1
  27. package/dist/ui/bubble.d.ts +1 -1
  28. package/dist/ui/code-block.d.ts +33 -0
  29. package/dist/ui/code-highlighter.d.ts +8 -0
  30. package/dist/ui/hitl-submission-status.d.ts +22 -0
  31. package/dist/ui/index.cjs +985 -301
  32. package/dist/ui/index.cjs.map +1 -1
  33. package/dist/ui/index.d.ts +3 -0
  34. package/dist/ui/index.js +969 -296
  35. package/dist/ui/index.js.map +1 -1
  36. package/dist/ui/message-code.d.ts +21 -0
  37. package/dist/ui/use-agent-chat-composer.d.ts +17 -2
  38. package/dist/ui/use-audio-recorder.d.ts +15 -2
  39. package/dist/ui/use-highlighted-code.d.ts +2 -0
  40. package/package.json +4 -3
  41. package/scaffold/src/app.tsx +2 -1
  42. package/scaffold/src/components/chat/chat-composer.tsx +5 -3
  43. package/scaffold/src/components/chat/chat-message.tsx +3 -3
  44. package/scaffold/src/components/chat/chat-shell.tsx +2 -1
  45. package/scaffold/src/components/chat/message-parts.tsx +6 -6
  46. package/dist/chunk-INO5DSSJ.js.map +0 -1
package/dist/styles.css CHANGED
@@ -235,12 +235,19 @@ button.a24-tool-trigger:focus-visible { outline: 2px solid var(--a24-focus); out
235
235
  .a24-chat-message { display: flex; flex-direction: column; min-width: 0; width: 100%; }
236
236
  .a24-chat-message--user { gap: 0; max-width: 100%; }
237
237
  .a24-chat-message--assistant { gap: .5rem; max-width: 100%; }
238
+ .a24-chat-message-action-row--assistant { opacity: 1; pointer-events: auto; transition: opacity 150ms ease; }
239
+ @media (hover: hover) and (pointer: fine) {
240
+ .a24-chat-message-action-row--assistant { opacity: 0; pointer-events: none; }
241
+ [data-slot="message"]:is(:hover, :focus-within) .a24-chat-message-action-row--assistant,
242
+ .a24-chat-message-action-row--assistant:has([data-state="open"]) { opacity: 1; pointer-events: auto; }
243
+ }
238
244
  .a24-chat-completion-actions { animation: a24-chat-completion-actions-in 200ms cubic-bezier(.2, 0, 0, 1) both; }
239
245
  @keyframes a24-chat-completion-actions-in {
240
246
  from { filter: blur(4px); opacity: 0; transform: translateY(4px); }
241
247
  to { filter: blur(0); opacity: 1; transform: translateY(0); }
242
248
  }
243
249
  @media (prefers-reduced-motion: reduce) {
250
+ .a24-chat-message-action-row--assistant { transition: none; }
244
251
  .a24-chat-completion-actions { animation: none; }
245
252
  }
246
253
  .a24-chat-message-action-row--user { align-items: center; align-self: flex-start; display: flex; gap: .5rem; height: 2rem; margin-left: auto; margin-top: .25rem; padding-inline: .25rem; transition: opacity 150ms ease; width: auto; }
@@ -284,6 +291,54 @@ button.a24-tool-trigger:focus-visible { outline: 2px solid var(--a24-focus); out
284
291
  .a24-message-response > :last-child { margin-bottom: 0; }
285
292
  .a24-message-response :is(pre, table) { max-width: 100%; overflow-x: auto; }
286
293
  .a24-message-response :is(p, li, blockquote, code) { overflow-wrap: anywhere; }
294
+ /* shadcn/ui Code Block: package-owned styles, independent of host Tailwind scanning. */
295
+ .a24-inline-code { background: var(--a24-surface); border-radius: .25rem; font-family: var(--font-mono, ui-monospace, monospace); font-size: .875em; padding: .125rem .375rem; }
296
+ .a24-code-block { --a24-code-inset: 1rem; background: color-mix(in srgb, var(--a24-text) 4%, var(--a24-background)); border: 0; border-radius: 1.25rem; box-sizing: border-box; color: var(--a24-text); display: flex; flex-direction: column; font-size: .8125rem; margin-block: 1rem; max-width: 100%; min-width: 0; overflow: hidden; position: relative; width: 100%; }
297
+ .a24-code-block[data-size="sm"] { --a24-code-inset: .625rem; font-size: .75rem; }
298
+ .a24-code-block--destructive { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a24-danger) 35%, transparent); color: var(--a24-danger); }
299
+ .a24-code-block__header, .a24-code-block__footer { align-items: center; color: var(--a24-muted); display: flex; flex-shrink: 0; gap: .5rem; min-width: 0; padding: var(--a24-code-inset); }
300
+ .a24-code-block__header { padding-bottom: 0; }
301
+ .a24-code-block__footer { padding-top: 0; }
302
+ .a24-code-block__title { align-items: center; display: flex; gap: .375rem; color: var(--a24-text); font-family: var(--font-sans, system-ui, sans-serif); font-size: inherit; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
303
+ .a24-code-block__title > svg { flex-shrink: 0; height: .875rem; width: .875rem; }
304
+ .a24-code-block__title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
305
+ .a24-code-block__actions { align-items: center; display: flex; flex-shrink: 0; gap: .25rem; margin-block: -.25rem; margin-inline-start: auto; }
306
+ .a24-code-block > .a24-code-block__actions { background: var(--a24-background); border-radius: .375rem; inset-inline-end: .5rem; margin: 0; opacity: 0; position: absolute; top: .5rem; z-index: 1; }
307
+ .a24-code-block:hover > .a24-code-block__actions, .a24-code-block:focus-within > .a24-code-block__actions { opacity: 1; }
308
+ .a24-code-block__action { align-items: center; appearance: none; background: transparent; border: 0; border-radius: .375rem; color: color-mix(in srgb, var(--a24-muted) 70%, transparent); cursor: pointer; display: inline-flex; flex-shrink: 0; height: 1.5rem; justify-content: center; padding: 0; width: 1.5rem; }
309
+ .a24-code-block__action:hover, .a24-code-block__action:focus-visible { background: var(--a24-surface-hover); color: var(--a24-text); }
310
+ .a24-code-block__action:focus-visible { outline: 2px solid var(--a24-focus); outline-offset: -2px; }
311
+ .a24-code-block__action[aria-pressed="true"] { background: var(--a24-surface-hover); color: var(--a24-text); }
312
+ .a24-code-block__action:disabled { cursor: default; opacity: .5; }
313
+ .a24-code-block__action svg { flex-shrink: 0; height: .75rem; pointer-events: none; width: .75rem; }
314
+ .a24-code-block__announcement { clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
315
+ .a24-code-block .a24-code-block__content { background: transparent; border: 0; border-radius: 0; color: inherit; font-family: var(--font-mono, ui-monospace, monospace); font-size: inherit; line-height: 1.65; margin: 0; max-height: 32rem; max-width: 100%; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: var(--a24-code-inset); scrollbar-width: thin; text-align: start; white-space: pre; }
316
+ .a24-code-block__content:focus-visible { outline: 2px solid var(--a24-focus); outline-offset: -2px; }
317
+ .a24-code-block .a24-code-block__content { scrollbar-color: color-mix(in srgb, var(--a24-muted) 40%, transparent) transparent; }
318
+ .a24-code-block__content::-webkit-scrollbar { display: block; height: 6px; width: 6px; background: transparent; }
319
+ .a24-code-block__content::-webkit-scrollbar-track, .a24-code-block__content::-webkit-scrollbar-corner { background: transparent; border: 0; box-shadow: none; }
320
+ .a24-code-block__content::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--a24-muted) 40%, transparent); border: 0; border-radius: 999px; }
321
+ .a24-code-block__content::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--a24-muted) 60%, transparent); }
322
+ .a24-code-block__content::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
323
+ .a24-code-block:has(> .a24-code-block__header) .a24-code-block__content { padding-top: .5rem; }
324
+ .a24-code-block .a24-code-block__code { background: transparent; border: 0; border-radius: 0; color: inherit; content-visibility: visible; display: grid; font: inherit; min-height: 1lh; min-width: max-content; overflow-wrap: normal; padding: 0; }
325
+ .a24-code-block__content[data-numbered] .a24-code-block__code { grid-template-columns: auto minmax(0, 1fr); }
326
+ .a24-code-block__content[data-wrap] { overflow-wrap: anywhere; white-space: pre-wrap; }
327
+ .a24-code-block__content[data-wrap] .a24-code-block__code { min-width: 0; overflow-wrap: anywhere; }
328
+ .a24-code-block__line { display: block; min-height: 1lh; position: relative; }
329
+ .a24-code-block__line-content { min-width: 0; }
330
+ .a24-code-block__content[data-numbered] .a24-code-block__line { column-gap: 1rem; counter-increment: line; display: grid; grid-column: span 2; grid-template-columns: subgrid; }
331
+ .a24-code-block__content[data-numbered] .a24-code-block__line::before { color: var(--a24-muted); content: counter(line); min-width: 1.5rem; text-align: end; user-select: none; }
332
+ @supports (content: counter(line) / "") { .a24-code-block__content[data-numbered] .a24-code-block__line::before { content: counter(line) / ""; } }
333
+ .a24-code-block__line--added, .a24-code-block__line--highlighted { background: var(--a24-surface-hover); }
334
+ .a24-code-block__line--removed { background: color-mix(in srgb, var(--a24-danger) 10%, transparent); }
335
+ .a24-code-block__line--added::after, .a24-code-block__line--removed::after { inset-inline-start: 0; position: absolute; user-select: none; }
336
+ .a24-code-block__line--added::after { content: "+"; }
337
+ .a24-code-block__line--removed::after { color: var(--a24-danger); content: "−"; }
338
+ .a24-code-token { color: var(--shiki-light); }
339
+ :root.dark .a24-code-token, [data-agents24-color-mode="dark"] .a24-code-token, [data-agents24-theme-root].dark .a24-code-token { color: var(--shiki-dark); }
340
+ @media (prefers-color-scheme: dark) { :root:not(.light):not([data-agents24-color-mode="light"]):not(:has([data-agents24-color-mode="light"])) .a24-code-token { color: var(--shiki-dark); } }
341
+ @media (pointer: coarse) { .a24-code-block > .a24-code-block__actions { opacity: 1; } }
287
342
  .a24-source-link,
288
343
  .a24-citation { color: #075f9a; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; }
289
344
  .a24-output-attachment { background: var(--a24-surface); border: 1px solid var(--a24-border); border-radius: .5rem; display: inline-flex; font-size: .8rem; padding: .45rem .65rem; }
@@ -20,6 +20,7 @@ export type AgentChatComposerProps = {
20
20
  disabled?: boolean;
21
21
  forceExpanded?: boolean;
22
22
  focusKey?: string | null;
23
+ scopeKey?: string | null;
23
24
  inputToolbarContent?: React.ReactNode;
24
25
  isRunning?: boolean;
25
26
  isCancelling?: boolean;
@@ -34,4 +35,4 @@ export type AgentChatComposerProps = {
34
35
  } | null;
35
36
  textareaRef?: React.Ref<HTMLTextAreaElement>;
36
37
  };
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;
38
+ export declare function AgentChatComposer({ inputContract, recordingEnabled, contextWindow, accept, allowAttachments, className, disabled, forceExpanded, focusKey, scopeKey, inputToolbarContent, isRunning, isCancelling, onAttachmentCountChange, onStop, onSubmit, placeholder, restoredDraft, textareaRef, }: AgentChatComposerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,5 @@
1
+ import type { HitlSubmissionOptions } from "@agents24/react";
2
+ import type { HitlSubmissionLabels } from "./hitl-submission-status";
1
3
  import * as React from "react";
2
4
  import type { ChatHitlPart, ChatHitlResponse, ChatMessage } from "../types";
3
5
  import { type ChatAttachmentContentResolver } from "./adapters";
@@ -19,10 +21,12 @@ export type AgentChatMessageProps = {
19
21
  className?: string;
20
22
  contentClassName?: string;
21
23
  dir?: "ltr" | "rtl";
24
+ hitlLabels?: Partial<HitlSubmissionLabels>;
25
+ onHitlPaint?: (durationMs: number) => void;
22
26
  getHitlActionState?: (part: ChatHitlPart) => AgentChatPartActionState | undefined;
23
27
  message: ChatMessage;
24
28
  nodeActivityMode?: "default" | "all" | "hidden";
25
- onHitlAction?: (part: ChatHitlPart, response: ChatHitlResponse) => void;
29
+ onHitlAction?: (part: ChatHitlPart, response: ChatHitlResponse, options?: HitlSubmissionOptions) => void;
26
30
  Timeline?: AgentChatTimelineComponent;
27
31
  renderAssistantContent?: (input: {
28
32
  isStreaming: boolean;
@@ -45,4 +49,4 @@ export declare function AgentChatUserMessageActionRow({ children, className, }:
45
49
  children: React.ReactNode;
46
50
  className?: string;
47
51
  }): import("react/jsx-runtime").JSX.Element;
48
- export declare function AgentChatMessage({ actionHandlers, additionalActions, actions, actionsClassName, attachmentContentResolver, className, contentClassName, dir, getHitlActionState, message, nodeActivityMode, onHitlAction, Timeline, renderAssistantContent, renderUserContent, showAssistantAttachments, streamingMessageId, userMessageCollapsedLines, userMessageContent, userMessageCollapseThreshold, userMessageShowLessLabel, userMessageShowMoreLabel, }: AgentChatMessageProps): import("react/jsx-runtime").JSX.Element;
52
+ export declare function AgentChatMessage({ actionHandlers, additionalActions, actions, actionsClassName, attachmentContentResolver, className, contentClassName, dir, getHitlActionState, hitlLabels, onHitlPaint, message, nodeActivityMode, onHitlAction, Timeline, renderAssistantContent, renderUserContent, showAssistantAttachments, streamingMessageId, userMessageCollapsedLines, userMessageContent, userMessageCollapseThreshold, userMessageShowLessLabel, userMessageShowMoreLabel, }: AgentChatMessageProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,5 @@
1
+ import type { HitlSubmissionOptions } from "@agents24/react";
2
+ import { type HitlSubmissionLabels } from "./hitl-submission-status";
1
3
  import * as React from "react";
2
4
  import type { ChatHitlPart, ChatHitlResponse, ChatMessage, ChatNodeActivityPart, ChatPart, ChatToolPart, ChatUiBlocksPart } from "../types";
3
5
  import type { McpConnectRequiredStatus } from "./mcp-connect-required-card";
@@ -6,14 +8,18 @@ import { type AgentChatToolSlots, type AgentChatToolViewMode } from "./tool-sess
6
8
  export type AgentChatPartActionState = {
7
9
  status?: McpConnectRequiredStatus | string;
8
10
  error?: string | null;
11
+ action?: string;
12
+ retry?: () => Promise<void>;
9
13
  };
10
14
  export type HitlActionState = AgentChatPartActionState;
11
15
  export type AgentResponseTimelineProps = {
16
+ hitlLabels?: Partial<HitlSubmissionLabels>;
17
+ onHitlPaint?: (durationMs: number) => void;
12
18
  getHitlActionState?: (part: ChatHitlPart) => AgentChatPartActionState | undefined;
13
19
  isLoading?: boolean;
14
20
  message: ChatMessage;
15
21
  nodeActivityMode?: "default" | "all" | "hidden";
16
- onHitlAction?: (part: ChatHitlPart, response: ChatHitlResponse) => void;
22
+ onHitlAction?: (part: ChatHitlPart, response: ChatHitlResponse, options?: HitlSubmissionOptions) => void;
17
23
  onNodeSelect?: (part: ChatNodeActivityPart) => void;
18
24
  parts?: readonly ChatPart[];
19
25
  renderUiBlocks?: (part: ChatUiBlocksPart) => React.ReactNode;
@@ -36,6 +42,8 @@ export declare function AgentChatToolGroup({ activeToolId, parts, }: {
36
42
  export type AgentChatPartProps = {
37
43
  activeToolId?: string | null;
38
44
  getHitlActionState?: AgentResponseTimelineProps["getHitlActionState"];
45
+ hitlLabels?: AgentResponseTimelineProps["hitlLabels"];
46
+ onHitlPaint?: AgentResponseTimelineProps["onHitlPaint"];
39
47
  isLoading?: boolean;
40
48
  isTextStreaming?: boolean;
41
49
  message: ChatMessage;
@@ -44,5 +52,5 @@ export type AgentChatPartProps = {
44
52
  responseProps?: AgentResponseTimelineProps["responseProps"];
45
53
  toolSlots?: AgentChatToolSlots;
46
54
  };
47
- export declare function AgentChatPart({ activeToolId, getHitlActionState, isLoading, isTextStreaming, message, onHitlAction, part, responseProps, toolSlots, }: AgentChatPartProps): import("react/jsx-runtime").JSX.Element | null;
48
- export declare function AgentResponseTimeline({ getHitlActionState, isLoading, message, nodeActivityMode, onHitlAction, onNodeSelect, parts: displayParts, renderUiBlocks, responseProps, toolSlots, toolViewMode, }: AgentResponseTimelineProps): import("react/jsx-runtime").JSX.Element;
55
+ export declare function AgentChatPart({ activeToolId, getHitlActionState, hitlLabels, onHitlPaint, isLoading, isTextStreaming, message, onHitlAction, part, responseProps, toolSlots, }: AgentChatPartProps): import("react/jsx-runtime").JSX.Element | null;
56
+ export declare function AgentResponseTimeline({ getHitlActionState, hitlLabels, onHitlPaint, isLoading, message, nodeActivityMode, onHitlAction, onNodeSelect, parts: displayParts, renderUiBlocks, responseProps, toolSlots, toolViewMode, }: AgentResponseTimelineProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,12 @@
1
+ import { type HitlSubmissionLabels, type HitlSubmissionPresentation } from "./hitl-submission-status";
1
2
  import type { ChatHitlAnswer, ChatHitlPart } from "../types";
2
3
  export type AskUserInteractionProps = {
3
4
  error?: string | null;
5
+ submission?: HitlSubmissionPresentation;
6
+ submissionLabels?: Partial<HitlSubmissionLabels>;
7
+ onSubmissionPaint?: (durationMs: number) => void;
4
8
  isBusy?: boolean;
5
9
  onSubmit?: (answers: ChatHitlAnswer[]) => void;
6
10
  part: ChatHitlPart;
7
11
  };
8
- export declare function AskUserInteraction({ error, isBusy, onSubmit, part, }: AskUserInteractionProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function AskUserInteraction({ error, submission, submissionLabels, onSubmissionPaint, isBusy, onSubmit, part, }: AskUserInteractionProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
4
4
  declare const bubbleVariants: (props?: ({
5
- variant?: "default" | "secondary" | "muted" | "tinted" | "outline" | "ghost" | "destructive" | null | undefined;
5
+ variant?: "default" | "destructive" | "secondary" | "muted" | "tinted" | "outline" | "ghost" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
8
8
  align?: "start" | "end";
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const codeBlockVariants: (props?: ({
4
+ variant?: "default" | "destructive" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function CodeBlock({ className, variant, size, ...props }: React.ComponentProps<"div"> & VariantProps<typeof codeBlockVariants> & {
7
+ size?: "default" | "sm";
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare function CodeBlockHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
10
+ declare function CodeBlockTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
11
+ declare function CodeBlockActions({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function CodeBlockCopyButton({ value, className, onClick, ...props }: React.ComponentProps<"button"> & {
13
+ value: string;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ declare function CodeBlockWrapButton({ wrap, onWrapChange, className, onClick, ...props }: React.ComponentProps<"button"> & {
16
+ wrap: boolean;
17
+ onWrapChange: (wrap: boolean) => void;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ declare function CodeBlockDownloadButton({ value, filename, className, onClick, ...props }: React.ComponentProps<"button"> & {
20
+ value: string;
21
+ filename?: string;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ declare function CodeBlockContent({ className, children, style, wrap, lineNumbers, startLine, ...props }: React.ComponentProps<"pre"> & {
24
+ wrap?: boolean;
25
+ lineNumbers?: boolean;
26
+ startLine?: number;
27
+ }): import("react/jsx-runtime").JSX.Element;
28
+ declare const codeBlockLineVariants: (props?: ({
29
+ variant?: "default" | "added" | "removed" | "highlighted" | null | undefined;
30
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
31
+ declare function CodeBlockLine({ className, variant, children, ...props }: React.ComponentProps<"span"> & VariantProps<typeof codeBlockLineVariants>): import("react/jsx-runtime").JSX.Element;
32
+ declare function CodeBlockFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
33
+ export { CodeBlock, CodeBlockHeader, CodeBlockTitle, CodeBlockActions, CodeBlockCopyButton, CodeBlockWrapButton, CodeBlockDownloadButton, CodeBlockContent, CodeBlockLine, CodeBlockFooter, };
@@ -0,0 +1,8 @@
1
+ import { type GrammarState } from "shiki/core";
2
+ export declare function loadHighlighter(language: string): Promise<{
3
+ highlight(code: string, state?: GrammarState): {
4
+ lines: import("react/jsx-runtime").JSX.Element[][];
5
+ state: GrammarState | undefined;
6
+ };
7
+ } | null>;
8
+ export declare function highlightCode(code: string, language: string): Promise<import("react/jsx-runtime").JSX.Element[][] | null>;
@@ -0,0 +1,22 @@
1
+ export type HitlSubmissionLabels = {
2
+ submitting: string;
3
+ checking: string;
4
+ uncertain: string;
5
+ retry: string;
6
+ accepted: string;
7
+ approved: string;
8
+ rejected: string;
9
+ };
10
+ export declare const defaultHitlSubmissionLabels: HitlSubmissionLabels;
11
+ export type HitlSubmissionPresentation = {
12
+ status?: string;
13
+ action?: string;
14
+ retry?: () => Promise<void>;
15
+ };
16
+ export declare function isHitlSubmissionCompact(state?: HitlSubmissionPresentation): boolean;
17
+ /** Also available to host-owned approval cards; keeps their decision feedback consistent. */
18
+ export declare function HitlSubmissionStatus({ state, labels: overrides, onPaint }: {
19
+ state: HitlSubmissionPresentation;
20
+ labels?: Partial<HitlSubmissionLabels>;
21
+ onPaint?: (durationMs: number) => void;
22
+ }): import("react/jsx-runtime").JSX.Element;