The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(assistant-ui, todos): apply consistent formatting and scope store to workspace
Steven Enamakelba8f03274790
diff --git a/app/src/components/assistant-ui/elements/day-separator.tsx b/app/src/components/assistant-ui/elements/day-separator.tsxindex 0daf5695c3..9e94db9243 100644--- a/app/src/components/assistant-ui/elements/day-separator.tsx+++ b/app/src/components/assistant-ui/elements/day-separator.tsx@@ -23,14 +23,15 @@ export function DaySeparator({messages,className,...props-}: Omit<ComponentProps<'div'>, 'children' | 'messages'> & {- messages: readonly DatedMessage[];-}) {+}: Omit<ComponentProps<'div'>, 'children' | 'messages'> & { messages: readonly DatedMessage[] }) {let lastDay = '';return (- <div data-slot="day-separator" className={cn('flex w-full max-w-sm flex-col gap-2', className)} {...props}>- {messages.map((message) => {+ <div+ data-slot="day-separator"+ className={cn('flex w-full max-w-sm flex-col gap-2', className)}+ {...props}>+ {messages.map(message => {const newDay = message.day !== lastDay;lastDay = message.day;diff --git a/app/src/components/assistant-ui/elements/edit-message.tsx b/app/src/components/assistant-ui/elements/edit-message.tsxindex 8c936ec08a..d2862987e0 100644--- a/app/src/components/assistant-ui/elements/edit-message.tsx+++ b/app/src/components/assistant-ui/elements/edit-message.tsx@@ -60,7 +60,10 @@ export function EditMessage({}) {if (!editing) {return (- <div data-slot="edit-message" className={cn('flex w-full max-w-sm justify-end', className)} {...props}>+ <div+ data-slot="edit-message"+ className={cn('flex w-full max-w-sm justify-end', className)}+ {...props}><buttontype="button"onClick={onStartEdit}@@ -81,7 +84,7 @@ export function EditMessage({{...props}><textareavalue={value}- onChange={(event) => onValueChange?.(event.target.value)}+ onChange={event => onValueChange?.(event.target.value)}rows={2}aria-label={editAriaLabel}className={cn(@@ -107,7 +110,10 @@ export function EditMessage({<buttontype="button"onClick={onSave}- className={cn(inkButton, 'flex h-8 items-center rounded-full px-3.5 text-xs font-medium')}>+ className={cn(+ inkButton,+ 'flex h-8 items-center rounded-full px-3.5 text-xs font-medium'+ )}>{sendLabel}</button></div>diff --git a/app/src/components/assistant-ui/elements/error-state.tsx b/app/src/components/assistant-ui/elements/error-state.tsxindex 5e43c303b9..6387c92769 100644--- a/app/src/components/assistant-ui/elements/error-state.tsx+++ b/app/src/components/assistant-ui/elements/error-state.tsx@@ -45,7 +45,9 @@ export function ErrorState({)}{...props}><RefreshCwIcon className="text-foreground/45 size-3.5 shrink-0 animate-spin motion-reduce:animate-none" />- <ShimmerLabel className="text-foreground/55 relative inline-block">{retryingLabel}</ShimmerLabel>+ <ShimmerLabel className="text-foreground/55 relative inline-block">+ {retryingLabel}+ </ShimmerLabel></div>);}@@ -63,7 +65,9 @@ export function ErrorState({<CircleAlertIcon className="mt-0.5 size-4 shrink-0 text-red-500/80" /><div><p className="font-medium text-red-600 dark:text-red-400">{title}</p>- <p className="mt-0.5 text-[13px] leading-snug text-red-600/60 dark:text-red-400/60">{detail}</p>+ <p className="mt-0.5 text-[13px] leading-snug text-red-600/60 dark:text-red-400/60">+ {detail}+ </p></div><buttontype="button"diff --git a/app/src/components/assistant-ui/elements/feedback-dialog.tsx b/app/src/components/assistant-ui/elements/feedback-dialog.tsxindex d7d0d803ab..ada8c3ae41 100644--- a/app/src/components/assistant-ui/elements/feedback-dialog.tsx+++ b/app/src/components/assistant-ui/elements/feedback-dialog.tsx@@ -33,7 +33,14 @@ export function FeedbackDialog({...props}: Omit<ComponentProps<'div'>,- 'children' | 'reasons' | 'selected' | 'note' | 'sent' | 'onToggleReason' | 'onNoteChange' | 'onSubmit'+ | 'children'+ | 'reasons'+ | 'selected'+ | 'note'+ | 'sent'+ | 'onToggleReason'+ | 'onNoteChange'+ | 'onSubmit'> & {reasons: readonly string[];selected: readonly string[];@@ -85,7 +92,7 @@ export function FeedbackDialog({</div><div className="flex flex-wrap gap-1.5">- {reasons.map((reason) => {+ {reasons.map(reason => {const active = selected.includes(reason);const buttonClassName = cn('rounded-full px-2.5 py-1 text-xs transition-[background-color,color,scale] duration-150',@@ -104,7 +111,12 @@ export function FeedbackDialog({{reason}</button>) : (- <span key={reason} role="button" aria-disabled="true" aria-pressed={active} className={buttonClassName}>+ <span+ key={reason}+ role="button"+ aria-disabled="true"+ aria-pressed={active}+ className={buttonClassName}>{reason}</span>);@@ -113,7 +125,7 @@ export function FeedbackDialog({<textareavalue={note}- onChange={(event) => onNoteChange?.(event.target.value)}+ onChange={event => onNoteChange?.(event.target.value)}rows={2}placeholder={notePlaceholder}aria-label={notePlaceholder}diff --git a/app/src/components/assistant-ui/elements/guardrail-notice.tsx b/app/src/components/assistant-ui/elements/guardrail-notice.tsxindex 99a5bdab6c..75adb027ff 100644--- a/app/src/components/assistant-ui/elements/guardrail-notice.tsx+++ b/app/src/components/assistant-ui/elements/guardrail-notice.tsx@@ -52,7 +52,7 @@ export function GuardrailNotice({{alternatives.length > 0 && (<div className="flex flex-col gap-1.5"><span className={cn(mono, 'text-foreground/30')}>{alternativesLabel}</span>- {alternatives.map((alternative) =>+ {alternatives.map(alternative =>onPick ? (<buttonkey={alternative}diff --git a/app/src/components/assistant-ui/elements/message-actions.tsx b/app/src/components/assistant-ui/elements/message-actions.tsxindex c25562233e..8143e56c80 100644--- a/app/src/components/assistant-ui/elements/message-actions.tsx+++ b/app/src/components/assistant-ui/elements/message-actions.tsx@@ -60,7 +60,10 @@ export function MessageActions({const buttonClassName = cn(ghostButton, 'size-7');return (- <div data-slot="message-actions" className={cn('flex items-center gap-1', className)} {...props}>+ <div+ data-slot="message-actions"+ className={cn('flex items-center gap-1', className)}+ {...props}><buttontype="button"aria-label={copied ? copiedLabel : copyLabel}@@ -91,8 +94,14 @@ export function MessageActions({)}><ThumbsDownIcon className="size-3.5" /></button>- <button type="button" aria-label={regenerateLabel} onClick={onRegenerate} className={buttonClassName}>- <RefreshCwIcon className={cn('size-3.5', regenerating && 'animate-spin motion-reduce:animate-none')} />+ <button+ type="button"+ aria-label={regenerateLabel}+ onClick={onRegenerate}+ className={buttonClassName}>+ <RefreshCwIcon+ className={cn('size-3.5', regenerating && 'animate-spin motion-reduce:animate-none')}+ /></button><button type="button" aria-label={moreLabel} onClick={onMore} className={buttonClassName}><EllipsisIcon className="size-3.5" />diff --git a/app/src/components/assistant-ui/elements/message-timing.aui.tsx b/app/src/components/assistant-ui/elements/message-timing.aui.tsxindex 05878d78ce..c15eabf467 100644--- a/app/src/components/assistant-ui/elements/message-timing.aui.tsx+++ b/app/src/components/assistant-ui/elements/message-timing.aui.tsx@@ -12,7 +12,6 @@* `tokensPerSecondSuffix` props; the "Message timing" aria-label is* `ariaLabel`; all with English defaults, for `useT()`.*/-import { useMessageTiming } from '@assistant-ui/react';import { cn } from '@/components/assistant-ui/lib/utils';import {Tooltip,@@ -20,6 +19,7 @@ import {TooltipProvider,TooltipTrigger,} from '@/components/assistant-ui/ui/tooltip';+import { useMessageTiming } from '@assistant-ui/react';import type { FC } from 'react';const formatTimingMs = (ms: number | undefined): string => {@@ -98,7 +98,9 @@ export const MessageTiming: FC<{{timing.firstTokenTime !== undefined && (<div className="flex items-center justify-between gap-4"><span className="text-muted-foreground">{firstTokenLabel}</span>- <span className="font-mono tabular-nums">{formatTiming(timing.firstTokenTime)}</span>+ <span className="font-mono tabular-nums">+ {formatTiming(timing.firstTokenTime)}+ </span></div>)}<div className="flex items-center justify-between gap-4">diff --git a/app/src/components/assistant-ui/elements/message-timing.tsx b/app/src/components/assistant-ui/elements/message-timing.tsxindex ae7c83de40..47ae2604d8 100644--- a/app/src/components/assistant-ui/elements/message-timing.tsx+++ b/app/src/components/assistant-ui/elements/message-timing.tsx@@ -33,7 +33,7 @@ export function MessageTiming({className)}{...props}>- {stats.map((stat) => (+ {stats.map(stat => (<span key={stat.label} className="flex items-baseline gap-1"><span className={cn(mono, 'text-foreground/25')}>{stat.label}</span><spandiff --git a/app/src/components/assistant-ui/elements/stopped-run.tsx b/app/src/components/assistant-ui/elements/stopped-run.tsxindex 51641bc4ab..9baed95124 100644--- a/app/src/components/assistant-ui/elements/stopped-run.tsx+++ b/app/src/components/assistant-ui/elements/stopped-run.tsx@@ -23,10 +23,7 @@ export function StoppedRun({discardLabel = 'Discard',className,...props-}: Omit<- ComponentProps<'div'>,- 'children' | 'words' | 'reason' | 'onContinue' | 'onDiscard'-> & {+}: Omit<ComponentProps<'div'>, 'children' | 'words' | 'reason' | 'onContinue' | 'onDiscard'> & {words: readonly string[];reason: string;onContinue?: () => void;@@ -35,7 +32,10 @@ export function StoppedRun({discardLabel?: string;}) {return (- <div data-slot="stopped-run" className={cn('flex w-full max-w-sm flex-col gap-3', className)} {...props}>+ <div+ data-slot="stopped-run"+ className={cn('flex w-full max-w-sm flex-col gap-3', className)}+ {...props}><p className="text-foreground/80 text-[13.5px] leading-relaxed">{words.join(' ')}<spandiff --git a/app/src/components/assistant-ui/elements/streaming-text.tsx b/app/src/components/assistant-ui/elements/streaming-text.tsxindex d862e134cc..3556a0d60e 100644--- a/app/src/components/assistant-ui/elements/streaming-text.tsx+++ b/app/src/components/assistant-ui/elements/streaming-text.tsx@@ -29,8 +29,8 @@ export function StreamingText({}) {const words = useMemo(() =>- segments.flatMap((segment) =>- segment.text.split(' ').map((word) => ({ word, mono: segment.mono ?? false }))+ segments.flatMap(segment =>+ segment.text.split(' ').map(word => ({ word, mono: segment.mono ?? false }))),[segments]);@@ -44,7 +44,9 @@ export function StreamingText({{shown.map(({ word, mono: isMono }, i) => {const fresh = streaming && shown.length - 1 - i < 2;return (- <span key={i} className="fade-in animate-in fill-mode-both duration-500 motion-reduce:animate-none">+ <span+ key={i}+ className="fade-in animate-in fill-mode-both duration-500 motion-reduce:animate-none"><spanclassName={cn('transition-colors duration-700 motion-reduce:transition-none',diff --git a/app/src/components/assistant-ui/elements/typing-indicator.tsx b/app/src/components/assistant-ui/elements/typing-indicator.tsxindex 4fbb835fe1..f58d70c236 100644--- a/app/src/components/assistant-ui/elements/typing-indicator.tsx+++ b/app/src/components/assistant-ui/elements/typing-indicator.tsx@@ -23,7 +23,7 @@ export function TypingIndicator({variant?: 'bubble' | 'bare';label?: string;}) {- const dots = DOT_DELAYS.map((delay) => (+ const dots = DOT_DELAYS.map(delay => (<spankey={delay}aria-hiddendiff --git a/crates/openhuman-core/src/agent/todos/ops.rs b/crates/openhuman-core/src/agent/todos/ops.rsindex a220e00fa4..5e16f940b4 100644--- a/crates/openhuman-core/src/agent/todos/ops.rs+++ b/crates/openhuman-core/src/agent/todos/ops.rs@@ -2,10 +2,11 @@//!//! A todo list is scoped to one agent session ([`TodoScope::Session`]) or,//! when a tool runs with no session at all, to a scratch list-//! ([`TodoScope::Scratch`]). Both live in the one in-process [`store`];+//! ([`TodoScope::Scratch`]). Both live in the workspace-scoped [`store`];//! validation, the whole-list write and rendering are TinyAgents'. This file//! only maps a scope onto a store key. `clear` is for tests and cleanup.+use std::path::Path;use std::sync::Arc;use tinyagents_graph::todos::store as todos;@@ -35,25 +36,29 @@ impl TodoScope {}}-/// The process-wide store every session's list lives in.-pub fn store() -> Arc<dyn Store> {- session_todos_store()+/// The workspace-scoped store every session's list lives in.+pub fn store(workspace_dir: &Path) -> Arc<dyn Store> {+ session_todos_store(workspace_dir)}-pub async fn replace(scope: &TodoScope, items: Vec<TodoItem>) -> Result<TodosSnapshot, String> {- todos::replace(&store(), scope.key(), items)+pub async fn replace(+ workspace_dir: &Path,+ scope: &TodoScope,+ items: Vec<TodoItem>,+) -> Result<TodosSnapshot, String> {+ todos::replace(&store(workspace_dir), scope.key(), items).await.map_err(|error| error.to_string())}-pub async fn clear(scope: &TodoScope) -> Result<TodosSnapshot, String> {- todos::clear(&store(), scope.key())+pub async fn clear(workspace_dir: &Path, scope: &TodoScope) -> Result<TodosSnapshot, String> {+ todos::clear(&store(workspace_dir), scope.key()).await.map_err(|error| error.to_string())}-pub async fn list(scope: &TodoScope) -> Result<TodosSnapshot, String> {- todos::list(&store(), scope.key())+pub async fn list(workspace_dir: &Path, scope: &TodoScope) -> Result<TodosSnapshot, String> {+ todos::list(&store(workspace_dir), scope.key()).await.map_err(|error| error.to_string())}