Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore(assistant-ui): reorder imports to follow project conventions

Steven Enamakelf7dc21cc3a60
diff --git a/app/src/components/assistant-ui/elements/agent-status.aui.tsx b/app/src/components/assistant-ui/elements/agent-status.aui.tsx
index fc3ebba4f9..9e4ef54d1f 100644
--- a/app/src/components/assistant-ui/elements/agent-status.aui.tsx
+++ b/app/src/components/assistant-ui/elements/agent-status.aui.tsx
@@ -13,16 +13,12 @@
* handed `useT()`-sourced copy from the host; every call site that omits
* it keeps upstream's exact English text.
*/
-import { useAuiState, type TaskState } from '@assistant-ui/react';
-import { ChevronDownIcon } from 'lucide-react';
-import { type FC, useMemo, useState } from 'react';
-
import { cn } from '@/components/assistant-ui/lib/utils';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/assistant-ui/ui/popover';
+import { type TaskState, useAuiState } from '@assistant-ui/react';
+import { ChevronDownIcon } from 'lucide-react';
+import { type FC, useMemo, useState } from 'react';
-import { AgentStatus as AgentStatusBase, type AgentState } from './agent-status';
-import { mono } from './surfaces';
-import { TaskStateIcon } from './task-card';
import {
formatElapsed,
TASK_PAGE_SIZE,
@@ -31,6 +27,9 @@ import {
taskStateOf,
useTaskElapsed,
} from '../utils/task';
+import { type AgentState, AgentStatus as AgentStatusBase } from './agent-status';
+import { mono } from './surfaces';
+import { TaskStateIcon } from './task-card';
export type TaskSummary = {
readonly total: number;
@@ -100,7 +99,10 @@ export const summaryState = (summary: TaskSummary): AgentState => {
return summary.failed > 0 ? 'failed' : 'done';
};
-export const summaryLabel = (summary: TaskSummary, strings: AgentStatusStrings = DEFAULT_STRINGS) => {
+export const summaryLabel = (
+ summary: TaskSummary,
+ strings: AgentStatusStrings = DEFAULT_STRINGS
+) => {
if (summary.running === 1 && summary.runningLabel !== undefined) {
return summary.runningLabel;
}
@@ -216,7 +218,10 @@ export const TaskTray: FC<{ className?: string; strings?: AgentStatusStrings }>
/>
</PopoverTrigger>
<PopoverContent align="end" className="w-80 p-1">
- <ul data-slot="aui_task-tray" aria-label="Tasks" className="flex max-h-80 flex-col overflow-y-auto">
+ <ul
+ data-slot="aui_task-tray"
+ aria-label="Tasks"
+ className="flex max-h-80 flex-col overflow-y-auto">
{tasks.slice(0, visible).map((task, index) => (
<TaskTrayItem key={`${index}:${task.id}`} task={task} />
))}
diff --git a/app/src/components/assistant-ui/elements/background-inbox.tsx b/app/src/components/assistant-ui/elements/background-inbox.tsx
index ad6b2d7a49..8621a5c44a 100644
--- a/app/src/components/assistant-ui/elements/background-inbox.tsx
+++ b/app/src/components/assistant-ui/elements/background-inbox.tsx
@@ -9,10 +9,9 @@
* is now a `strings` prop (English defaults matching upstream) so the host
* can supply `useT()`-sourced copy — see `aui/BackgroundInboxCard.tsx`.
*/
-import type { ComponentProps } from 'react';
-import { CheckIcon, Loader2Icon, XIcon } from 'lucide-react';
-
import { cn } from '@/components/assistant-ui/lib/utils';
+import { CheckIcon, Loader2Icon, XIcon } from 'lucide-react';
+import type { ComponentProps } from 'react';
import { mono, paper } from './surfaces';
@@ -73,7 +72,11 @@ export function BackgroundInbox({
{runs.map(run => {
const rowClassName = cn(
'flex items-center gap-2.5 rounded-xl px-1.5 py-2 text-start transition-colors',
- run.state === 'running' ? 'cursor-default' : onCollect ? 'hover:bg-foreground/[0.04]' : undefined
+ run.state === 'running'
+ ? 'cursor-default'
+ : onCollect
+ ? 'hover:bg-foreground/[0.04]'
+ : undefined
);
const content = (
<>
@@ -100,7 +103,9 @@ export function BackgroundInbox({
)}
</span>
- <span className={cn(mono, 'text-foreground/25 shrink-0 tabular-nums')}>{run.elapsed}</span>
+ <span className={cn(mono, 'text-foreground/25 shrink-0 tabular-nums')}>
+ {run.elapsed}
+ </span>
</>
);
diff --git a/app/src/components/assistant-ui/elements/job-progress.tsx b/app/src/components/assistant-ui/elements/job-progress.tsx
index 0e70ef85ed..57aa742eac 100644
--- a/app/src/components/assistant-ui/elements/job-progress.tsx
+++ b/app/src/components/assistant-ui/elements/job-progress.tsx
@@ -11,11 +11,10 @@
* `title`/`stages[].name`/`eta` are caller-supplied props; nothing else here
* is hard-coded user-facing copy.
*/
-import type { ComponentProps } from 'react';
-import { CheckIcon, Loader2Icon, XIcon } from 'lucide-react';
-
import { cn } from '@/components/assistant-ui/lib/utils';
import { announced, clamp, pct, progressOf, take } from '@/components/assistant-ui/utils/range';
+import { CheckIcon, Loader2Icon, XIcon } from 'lucide-react';
+import type { ComponentProps } from 'react';
import { ghostButton, mono, paper } from './surfaces';
@@ -102,7 +101,11 @@ export function JobProgress({
key={item.name}
className={cn(
mono,
- i < stage ? 'text-foreground/35' : i === stage ? 'text-foreground/90' : 'text-foreground/20'
+ i < stage
+ ? 'text-foreground/35'
+ : i === stage
+ ? 'text-foreground/90'
+ : 'text-foreground/20'
)}>
{item.name}
</span>
diff --git a/app/src/components/assistant-ui/elements/subagent-list.tsx b/app/src/components/assistant-ui/elements/subagent-list.tsx
index df548dc379..8acd5d1581 100644
--- a/app/src/components/assistant-ui/elements/subagent-list.tsx
+++ b/app/src/components/assistant-ui/elements/subagent-list.tsx
@@ -9,11 +9,10 @@
* No hard-coded user-facing copy — `agent.name`/`agent.model` are
* caller-supplied props, so there is nothing to route through `useT()` here.
*/
-import type { ComponentProps } from 'react';
-import { CheckIcon, Loader2Icon } from 'lucide-react';
-
import { cn } from '@/components/assistant-ui/lib/utils';
import { pct } from '@/components/assistant-ui/utils/range';
+import { CheckIcon, Loader2Icon } from 'lucide-react';
+import type { ComponentProps } from 'react';
import { mono, paper } from './surfaces';
@@ -51,7 +50,9 @@ export function SubagentList({
const percentage = pct(width, 100);
return (
- <div key={agent.name} className={cn(paper, 'flex flex-col gap-2 rounded-2xl px-3.5 py-2.5')}>
+ <div
+ key={agent.name}
+ className={cn(paper, 'flex flex-col gap-2 rounded-2xl px-3.5 py-2.5')}>
<div className="flex items-center gap-2">
{done ? (
<CheckIcon className="fade-in zoom-in-90 animate-in size-3.5 shrink-0 text-emerald-500 duration-200" />
diff --git a/app/src/components/assistant-ui/elements/task-card.aui.tsx b/app/src/components/assistant-ui/elements/task-card.aui.tsx
index 166a57ae2d..d3c20c85e0 100644
--- a/app/src/components/assistant-ui/elements/task-card.aui.tsx
+++ b/app/src/components/assistant-ui/elements/task-card.aui.tsx
@@ -21,32 +21,22 @@
* `tool-fallback` registry item's `.aui` content directly under that
* filename, without a plain/`.aui` split).
*/
+import { cn } from '@/components/assistant-ui/lib/utils';
+import { MarkdownText } from '@/components/assistant-ui/markdown-text';
import {
MessagePrimitive,
ReadonlyThreadProvider,
- ThreadPrimitive,
- useAui,
- useAuiState,
type ThreadMessage,
+ ThreadPrimitive,
type ToolCallMessagePart,
type ToolCallMessagePartComponent,
type ToolCallMessagePartProps,
type ToolCallMessagePartStatus,
+ useAui,
+ useAuiState,
} from '@assistant-ui/react';
import { type FC, useState } from 'react';
-import { cn } from '@/components/assistant-ui/lib/utils';
-import { MarkdownText } from '@/components/assistant-ui/markdown-text';
-import {
- formatUnknownValue,
- offersInterruptAction,
- ToolFallback,
- ToolFallbackApproval,
- ToolFallbackError,
-} from './tool-fallback';
-
-import { mono } from './surfaces';
-import { TaskCard as TaskCardBase } from './task-card';
import {
formatElapsed,
TASK_PAGE_SIZE,
@@ -55,6 +45,15 @@ import {
taskStateOf,
useTaskElapsed,
} from '../utils/task';
+import { mono } from './surfaces';
+import { TaskCard as TaskCardBase } from './task-card';
+import {
+ formatUnknownValue,
+ offersInterruptAction,
+ ToolFallback,
+ ToolFallbackApproval,
+ ToolFallbackError,
+} from './tool-fallback';
export type { TaskCardState } from './task-card';
export { TASK_PAGE_SIZE } from '../utils/task';
@@ -68,11 +67,7 @@ export const isTaskPart = (part: { readonly type: string; readonly messages?: un
const KEY_SEPARATOR = String.fromCharCode(31);
-const ROLE_LABELS = {
- user: 'instruction',
- assistant: 'agent',
- system: 'system',
-} as const;
+const ROLE_LABELS = { user: 'instruction', assistant: 'agent', system: 'system' } as const;
// A transcript is a readonly snapshot, so a call waiting inside it is answered where its run is live, and renders here as paused on something else.
const NestedToolCall: ToolCallMessagePartComponent = ({ approval, interrupt, ...rest }) => {
@@ -92,7 +87,9 @@ const NestedMessage: FC = () => {
data-role={role}
className="flex flex-col gap-1 text-xs leading-relaxed">
<span className={cn(mono, 'text-foreground/35')}>{ROLE_LABELS[role]}</span>
- <MessagePrimitive.Parts components={{ Text: MarkdownText, tools: { Fallback: NestedToolCall } }} />
+ <MessagePrimitive.Parts
+ components={{ Text: MarkdownText, tools: { Fallback: NestedToolCall } }}
+ />
</MessagePrimitive.Root>
);
};
@@ -117,7 +114,9 @@ export const TaskCard: FC<{ part: TaskPart; className?: string }> = ({ part, cla
);
const messages = part.messages ?? [];
const showError =
- part.status.type === 'incomplete' && part.status.error !== undefined && part.status.error !== null;
+ part.status.type === 'incomplete' &&
+ part.status.error !== undefined &&
+ part.status.error !== null;
const result =
showError || part.result !== undefined ? (
<>
@@ -208,7 +207,9 @@ export const TaskGroup: FC<{
].filter((entry): entry is string => typeof entry === 'string');
return (
- <div data-slot="aui_task-group" className={cn('flex w-full max-w-sm flex-col gap-2', className)}>
+ <div
+ data-slot="aui_task-group"
+ className={cn('flex w-full max-w-sm flex-col gap-2', className)}>
<div data-slot="aui_task-group-summary" className="text-muted-foreground px-1 text-xs">
{summary.join(' · ')}
</div>
diff --git a/app/src/components/assistant-ui/elements/task-card.tsx b/app/src/components/assistant-ui/elements/task-card.tsx
index d14f10cf4b..e160412c33 100644
--- a/app/src/components/assistant-ui/elements/task-card.tsx
+++ b/app/src/components/assistant-ui/elements/task-card.tsx
@@ -10,10 +10,9 @@
* `result`) is a caller-supplied prop, so there is nothing to route through
* `useT()` here.
*/
-import { Children, type ComponentProps, type ReactNode, useState } from 'react';
-import { Ban, CheckIcon, ChevronRightIcon, Loader2Icon, XIcon } from 'lucide-react';
-
import { cn } from '@/components/assistant-ui/lib/utils';
+import { Ban, CheckIcon, ChevronRightIcon, Loader2Icon, XIcon } from 'lucide-react';
+import { Children, type ComponentProps, type ReactNode, useState } from 'react';
import { mono, paper } from './surfaces';
@@ -24,7 +23,9 @@ const isRenderable = (node: ReactNode) =>
export function TaskStateIcon({ state, className }: { state: TaskCardState; className?: string }) {
if (state === 'done') {
- return <CheckIcon aria-hidden className={cn('size-3.5 shrink-0 text-emerald-500', className)} />;
+ return (
+ <CheckIcon aria-hidden className={cn('size-3.5 shrink-0 text-emerald-500', className)} />
+ );
}
if (state === 'failed') {
return <XIcon aria-hidden className={cn('text-destructive size-3.5 shrink-0', className)} />;
diff --git a/app/src/components/assistant-ui/utils/task.ts b/app/src/components/assistant-ui/utils/task.ts
index 3961bbe449..809a69cd0c 100644
--- a/app/src/components/assistant-ui/utils/task.ts
+++ b/app/src/components/assistant-ui/utils/task.ts
@@ -5,8 +5,8 @@
* util (https://r.assistant-ui.com/styles/base-nova/task-card.json,
* `utils/task.ts` upstream). No local changes.
*/
-import { useEffect, useState } from 'react';
import type { ToolCallMessagePart, ToolCallMessagePartStatus } from '@assistant-ui/react';
+import { useEffect, useState } from 'react';
export type TaskViewState = 'working' | 'waiting' | 'done' | 'failed' | 'cancelled';
diff --git a/app/src/features/conversations/aui/AgentRunningStatus.test.tsx b/app/src/features/conversations/aui/AgentRunningStatus.test.tsx
index 58802ca8d1..8b3f214d49 100644
--- a/app/src/features/conversations/aui/AgentRunningStatus.test.tsx
+++ b/app/src/features/conversations/aui/AgentRunningStatus.test.tsx
@@ -12,7 +12,13 @@ vi.mock('../../../services/api/threadApi', () => ({
threadApi: {
getDerivedTranscript: vi
.fn()
- .mockResolvedValue({ threadId: 't-status', items: [], total: 0, hasMore: false, hasTranscript: false }),
+ .mockResolvedValue({
+ threadId: 't-status',
+ items: [],
+ total: 0,
+ hasMore: false,
+ hasTranscript: false,
+ }),
},
}));
diff --git a/app/src/features/conversations/aui/AgentRunningStatus.tsx b/app/src/features/conversations/aui/AgentRunningStatus.tsx
index d60c787a1e..3aa1e84a16 100644
--- a/app/src/features/conversations/aui/AgentRunningStatus.tsx
+++ b/app/src/features/conversations/aui/AgentRunningStatus.tsx
@@ -19,7 +19,10 @@
* (WS-E) rather than rendering nothing, so a turn that has not yet spawned any
* sub-agent still shows a running signal beneath the composer.
*/
-import { TaskTray, useTaskSummary } from '../../../components/assistant-ui/elements/agent-status.aui';
+import {
+ TaskTray,
+ useTaskSummary,
+} from '../../../components/assistant-ui/elements/agent-status.aui';
import { ThinkingIndicator } from '../../../components/assistant-ui/elements/thinking-indicator';
import { useT } from '../../../lib/i18n/I18nContext';
@@ -43,7 +46,10 @@ export function AgentRunningStatus() {
const strings = useAgentStatusStrings();
if (summary.total === 0) {
return (
- <ThinkingIndicator data-testid="agent-running-status-thinking" label={t('chat.thinkingDots')} />
+ <ThinkingIndicator
+ data-testid="agent-running-status-thinking"
+ label={t('chat.thinkingDots')}
+ />
);
}
return <TaskTray data-testid="agent-running-status-tasks" strings={strings} />;
diff --git a/app/src/features/conversations/aui/SubagentTaskCard.test.tsx b/app/src/features/conversations/aui/SubagentTaskCard.test.tsx
index 29a40b574e..950a63fdea 100644
--- a/app/src/features/conversations/aui/SubagentTaskCard.test.tsx
+++ b/app/src/features/conversations/aui/SubagentTaskCard.test.tsx
@@ -29,7 +29,10 @@ describe('SubagentTaskCard', () => {
/>
);
- expect(screen.getByTestId('assistant-ui-subagent-call')).toHaveAttribute('data-state', 'working');
+ expect(screen.getByTestId('assistant-ui-subagent-call')).toHaveAttribute(
+ 'data-state',
+ 'working'
+ );
expect(screen.getByText('Delegated to Researcher')).toBeInTheDocument();
// The transcript is collapsed by default, but the card knows it has one
// (the vendored `TaskCard`'s disclosure chevron only renders when
@@ -57,7 +60,10 @@ describe('SubagentTaskCard', () => {
/>
);
- expect(screen.getByTestId('assistant-ui-subagent-call')).toHaveAttribute('data-status', 'failed');
+ expect(screen.getByTestId('assistant-ui-subagent-call')).toHaveAttribute(
+ 'data-status',
+ 'failed'
+ );
});
it('renders the awaiting-user reply box and lets the answer through the composer path', async () => {
diff --git a/app/src/features/conversations/aui/SubagentTaskCard.tsx b/app/src/features/conversations/aui/SubagentTaskCard.tsx
index 603dc42991..023556d497 100644
--- a/app/src/features/conversations/aui/SubagentTaskCard.tsx
+++ b/app/src/features/conversations/aui/SubagentTaskCard.tsx
@@ -19,19 +19,19 @@
* (`elements/task-card.tsx`) + `utils/task.ts` pieces instead, with those
* actions supplied explicitly.
*/
-import { useAui, type ToolCallMessagePartComponent } from '@assistant-ui/react';
+import { type ToolCallMessagePartComponent, useAui } from '@assistant-ui/react';
import { useCallback, useState } from 'react';
import { TaskCard, type TaskCardState } from '../../../components/assistant-ui/elements/task-card';
import { TaskTranscript } from '../../../components/assistant-ui/elements/task-card.aui';
import { formatElapsed } from '../../../components/assistant-ui/utils/task';
+import { Button } from '../../../components/ui';
+import Badge from '../../../components/ui/Badge';
+import WorktreeActions from '../../../components/worktree/WorktreeActions';
import { useT } from '../../../lib/i18n/I18nContext';
-import type { SubagentActivity } from '../../../store/chatRuntimeSlice';
import { subagentMessages } from '../../../providers/assistantUiMessages';
+import type { SubagentActivity } from '../../../store/chatRuntimeSlice';
import { basename } from '../../../utils/pathUtils';
-import WorktreeActions from '../../../components/worktree/WorktreeActions';
-import Badge from '../../../components/ui/Badge';
-import { Button } from '../../../components/ui';
function asSubagentActivity(value: unknown): SubagentActivity | undefined {
if (!value || typeof value !== 'object') return undefined;
@@ -68,8 +68,13 @@ function readSubagentCall(
return { activity, state };
}
const progress =
- args && typeof args === 'object' ? asSubagentActivity((args as { progress?: unknown }).progress) : undefined;
- return { activity: progress, state: progress?.status === 'awaiting_user' ? 'waiting' : 'working' };
+ args && typeof args === 'object'
+ ? asSubagentActivity((args as { progress?: unknown }).progress)
+ : undefined;
+ return {
+ activity: progress,
+ state: progress?.status === 'awaiting_user' ? 'waiting' : 'working',
+ };
}
/** The child's question plus a reply box, sent via `aui.thread.append` — an ordinary new user turn. */
@@ -143,7 +148,9 @@ function WorktreeRow({ activity }: { activity: SubagentActivity }) {
<div className="flex flex-col gap-1.5">
<div className="flex flex-wrap items-center gap-1.5">
<span className="font-medium text-content-secondary">{t('worktree.label')}</span>
- <span className="truncate font-mono text-[12px] text-content-muted" title={activity.worktreePath}>
+ <span
+ className="truncate font-mono text-[12px] text-content-muted"
+ title={activity.worktreePath}>
{basename(activity.worktreePath)}
</span>
<Badge variant={activity.isDirty ? 'warning' : 'success'} className="rounded-full">
diff --git a/app/src/features/conversations/aui/toolkit.test.tsx b/app/src/features/conversations/aui/toolkit.test.tsx
index 7e05ae3387..4607286453 100644
--- a/app/src/features/conversations/aui/toolkit.test.tsx
+++ b/app/src/features/conversations/aui/toolkit.test.tsx
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
-import { buildOpenHumanToolkit, openHumanToolEntries } from './toolkit';
import { SubagentTaskCard } from './SubagentTaskCard';
+import { buildOpenHumanToolkit, openHumanToolEntries } from './toolkit';
describe('buildOpenHumanToolkit', () => {
it('registers the task tool against the shared delegation card', () => {