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
chore: reorder imports and format tool specs
Steven Enamakelaa9dd5d951aa
diff --git a/app/src/features/conversations/components/AssistantUiSubagentCall.tsx b/app/src/features/conversations/components/AssistantUiSubagentCall.tsxindex ed868b2ec7..930ac0c546 100644--- a/app/src/features/conversations/components/AssistantUiSubagentCall.tsx+++ b/app/src/features/conversations/components/AssistantUiSubagentCall.tsx@@ -25,9 +25,9 @@ import {} from '../../../store/chatRuntimeSlice';import { basename } from '../../../utils/pathUtils';import { stripToolCallEnvelopes } from '../../../utils/toolTimelineFormatting';-import { BubbleMarkdown } from './AgentMessageBubble';-import { describeToolCall } from '../tools/toolPresentation';import { ToolIcon } from '../tools/ToolIcon';+import { describeToolCall } from '../tools/toolPresentation';+import { BubbleMarkdown } from './AgentMessageBubble';import { AssistantUiToolCallCard } from './AssistantUiToolCall';type ChildToolCall = SubagentToolCallEntry | Extract<SubagentTranscriptItem, { kind: 'tool' }>;diff --git a/app/src/features/conversations/components/ChatToolParts.tsx b/app/src/features/conversations/components/ChatToolParts.tsxindex ffa4649967..7e089ba888 100644--- a/app/src/features/conversations/components/ChatToolParts.tsx+++ b/app/src/features/conversations/components/ChatToolParts.tsx@@ -7,20 +7,20 @@ import {} from '@assistant-ui/react';import { type FC, type PropsWithChildren, useCallback, useMemo } from 'react';-import type { ThreadGroupPart } from '../../../components/assistant-ui/thread';import { ToolTimeline } from '../../../components/assistant-ui/elements/tool-timeline';+import type { ThreadGroupPart } from '../../../components/assistant-ui/thread';import ApprovalRequestCard from '../../../components/chat/ApprovalRequestCard';import IntegrationConnectCard from '../../../components/chat/IntegrationConnectCard';import { useT } from '../../../lib/i18n/I18nContext';-import { useAuiThreadId } from '../../../providers/AssistantUiRuntimeProvider';import { readOpenHumanToolArtifact } from '../../../providers/assistantUiMessages';+import { useAuiThreadId } from '../../../providers/AssistantUiRuntimeProvider';import type { PendingApproval, SubagentActivity } from '../../../store/chatRuntimeSlice';import { useAppSelector } from '../../../store/hooks';+import { summarizeToolCalls } from '../../../utils/toolTimelineFormatting';+import { describeToolCall, toolLabel } from '../tools/toolPresentation';import { AssistantUiSubagentCall, isActiveSubagentStatus } from './AssistantUiSubagentCall';import { isApprovalPending, OpenHumanToolCall } from './AssistantUiToolCall';import { useSubagentDrawerHost } from './aui/subagentDrawerHost';-import { describeToolCall, toolLabel } from '../tools/toolPresentation';-import { summarizeToolCalls } from '../../../utils/toolTimelineFormatting';function asSubagentActivity(value: unknown): SubagentActivity | undefined {if (!value || typeof value !== 'object') return undefined;diff --git a/app/src/features/conversations/tools/ToolBodies.tsx b/app/src/features/conversations/tools/ToolBodies.tsxindex 7f9d828978..a6269b9ed1 100644--- a/app/src/features/conversations/tools/ToolBodies.tsx+++ b/app/src/features/conversations/tools/ToolBodies.tsx@@ -17,8 +17,8 @@ import { TerminalBlock } from '../../../components/assistant-ui/elements/terminaimport { WebPreview } from '../../../components/assistant-ui/elements/web-preview';import { WebSearch } from '../../../components/assistant-ui/elements/web-search';import { BubbleMarkdown } from '../components/AgentMessageBubble';-import { displayUrl, shortenPath, type ToolArgs } from './toolChips';import { parseWebSearchResult } from './parseWebSearchResult';+import { displayUrl, shortenPath, type ToolArgs } from './toolChips';import { fillPlaceholders } from './toolPhrases';import type { Translate } from './toolPresentation';@@ -38,7 +38,11 @@ function renderSearchLink({// routes it to the OS browser. `href` is an http(s) URL vetted by// `parseWebSearchResult`.return (- <Source href={href} rel="noreferrer noopener" className={className} data-testid="web-search-hit">+ <Source+ href={href}+ rel="noreferrer noopener"+ className={className}+ data-testid="web-search-hit">{children}</Source>);@@ -142,7 +146,9 @@ export function ShellBody({visibleCount={lines.length}donefailed={failed}- exitLabel={failed ? t('conversations.tools.status.failed') : t('conversations.tools.status.done')}+ exitLabel={+ failed ? t('conversations.tools.status.failed') : t('conversations.tools.status.done')+ }/>);}diff --git a/app/src/features/conversations/tools/parseWebSearchResult.ts b/app/src/features/conversations/tools/parseWebSearchResult.tsindex 25d631d86e..d09c0cdfb8 100644--- a/app/src/features/conversations/tools/parseWebSearchResult.ts+++ b/app/src/features/conversations/tools/parseWebSearchResult.ts@@ -104,7 +104,8 @@ function fromStructured(value: unknown): ParsedWebSearch | undefined {.map(item => {if (!item || typeof item !== 'object') return undefined;const row = item as Record<string, unknown>;- const str = (key: string) => (typeof row[key] === 'string' ? (row[key] as string) : undefined);+ const str = (key: string) =>+ typeof row[key] === 'string' ? (row[key] as string) : undefined;return hit(str('title'), str('url'), str('published'), str('excerpt'));}).filter((row): row is WebSearchHit => row !== undefined);@@ -197,12 +198,7 @@ function fromText(text: string): ParsedWebSearch | undefined {if (row) results.push(row);i = j;}- return {- query: headingQuery(textHeading[1]),- provider,- results,- empty: results.length === 0,- };+ return { query: headingQuery(textHeading[1]), provider, results, empty: results.length === 0 };}/**diff --git a/app/src/features/conversations/tools/toolPresentation.ts b/app/src/features/conversations/tools/toolPresentation.tsindex a126e883b8..fcb477a73f 100644--- a/app/src/features/conversations/tools/toolPresentation.ts+++ b/app/src/features/conversations/tools/toolPresentation.ts@@ -38,13 +38,13 @@ import {import {ACTION_TOOL_SPECS,AGENT_SPECS,- type ToolBodyKind,- type ToolCategory,EXACT_TOOL_SPECS,FALLBACK_ICON,FAMILY_TOOL_SPECS,INTEGRATION_ICON,INTEGRATIONS_AGENT_ID,+ type ToolBodyKind,+ type ToolCategory,type ToolSpec,} from './toolSpecs';diff --git a/app/src/features/conversations/tools/toolSpecs.ts b/app/src/features/conversations/tools/toolSpecs.tsindex 4f754f062e..ded81541d6 100644--- a/app/src/features/conversations/tools/toolSpecs.ts+++ b/app/src/features/conversations/tools/toolSpecs.ts@@ -161,7 +161,9 @@ export const EXACT_TOOL_SPECS: Record<string, ToolSpec> = {update_memory_md: spec('updateMemoryNotes', ScrollTextIcon, 'memory', {chip: chip.text('file'),}),- git_operations: spec('runGit', GitBranchIcon, 'code', { chip: chip.text('operation', 'command') }),+ git_operations: spec('runGit', GitBranchIcon, 'code', {+ chip: chip.text('operation', 'command'),+ }),read_diff: spec('readChanges', GitCompareIcon, 'code', { chip: chip.path() }),run_linter: spec('runLinter', ListChecksIcon, 'code'),run_tests: spec('runTests', ListChecksIcon, 'code'),@@ -380,7 +382,9 @@ export const EXACT_TOOL_SPECS: Record<string, ToolSpec> = {chip: chip.text('key', 'name'),}),storage_list_files: spec('listStoredFiles', HardDriveIcon, 'storage'),- storage_get_link: spec('createShareLink', LinkIcon, 'storage', { chip: chip.text('key', 'name') }),+ storage_get_link: spec('createShareLink', LinkIcon, 'storage', {+ chip: chip.text('key', 'name'),+ }),storage_delete_file: spec('deleteFile', HardDriveIcon, 'storage', {chip: chip.text('key', 'name'),}),@@ -440,86 +444,85 @@ export const EXACT_TOOL_SPECS: Record<string, ToolSpec> = {* then by the argument named in `arg`. A value the table does not list falls* back to the tool's {@link EXACT_TOOL_SPECS} entry.*/-export const ACTION_TOOL_SPECS: Record<string, { arg: string; specs: Record<string, ToolSpec> }> =- {- memory: {- arg: 'action',- specs: {- recall: spec('recallMemories', BrainCircuitIcon, 'memory', { chip: chip.query() }),- store: spec('saveToMemory', SaveIcon, 'memory', { chip: chip.text('key', 'content') }),- forget: spec('forgetMemory', EraserIcon, 'memory', { chip: chip.text('key') }),- hybrid_search: spec('searchMemory', BrainIcon, 'memory', { chip: chip.query() }),- vector_search: spec('searchMemory', BrainIcon, 'memory', { chip: chip.query() }),- raw_search: spec('searchMemory', BrainIcon, 'memory', { chip: chip.query() }),- chunk_context: spec('inspectMemory', BrainIcon, 'memory'),- raw_chunks: spec('inspectMemory', BrainIcon, 'memory'),- kinds: spec('inspectMemory', BrainIcon, 'memory'),- flavour: spec('inspectMemory', BrainIcon, 'memory'),- doctor: spec('inspectMemory', StethoscopeIcon, 'memory'),- },+export const ACTION_TOOL_SPECS: Record<string, { arg: string; specs: Record<string, ToolSpec> }> = {+ memory: {+ arg: 'action',+ specs: {+ recall: spec('recallMemories', BrainCircuitIcon, 'memory', { chip: chip.query() }),+ store: spec('saveToMemory', SaveIcon, 'memory', { chip: chip.text('key', 'content') }),+ forget: spec('forgetMemory', EraserIcon, 'memory', { chip: chip.text('key') }),+ hybrid_search: spec('searchMemory', BrainIcon, 'memory', { chip: chip.query() }),+ vector_search: spec('searchMemory', BrainIcon, 'memory', { chip: chip.query() }),+ raw_search: spec('searchMemory', BrainIcon, 'memory', { chip: chip.query() }),+ chunk_context: spec('inspectMemory', BrainIcon, 'memory'),+ raw_chunks: spec('inspectMemory', BrainIcon, 'memory'),+ kinds: spec('inspectMemory', BrainIcon, 'memory'),+ flavour: spec('inspectMemory', BrainIcon, 'memory'),+ doctor: spec('inspectMemory', StethoscopeIcon, 'memory'),},- memory_tree: {- arg: 'mode',- specs: {- ingest_document: spec('saveDocumentToMemory', SaveIcon, 'memory', {- chip: chip.text('title', 'path'),- }),- },+ },+ memory_tree: {+ arg: 'mode',+ specs: {+ ingest_document: spec('saveDocumentToMemory', SaveIcon, 'memory', {+ chip: chip.text('title', 'path'),+ }),},- goals: {- arg: 'op',- specs: {- list: spec('reviewGoals', TargetIcon, 'memory'),- add: spec('updateGoals', TargetIcon, 'memory', { chip: chip.text('text', 'goal') }),- edit: spec('updateGoals', TargetIcon, 'memory', { chip: chip.text('text', 'goal') }),- delete: spec('updateGoals', TargetIcon, 'memory'),- },+ },+ goals: {+ arg: 'op',+ specs: {+ list: spec('reviewGoals', TargetIcon, 'memory'),+ add: spec('updateGoals', TargetIcon, 'memory', { chip: chip.text('text', 'goal') }),+ edit: spec('updateGoals', TargetIcon, 'memory', { chip: chip.text('text', 'goal') }),+ delete: spec('updateGoals', TargetIcon, 'memory'),},- cron: {- arg: 'action',- specs: {- list: spec('checkSchedules', CalendarClockIcon, 'schedule'),- add: spec('scheduleTask', CalendarClockIcon, 'schedule', { chip: chip.text('name') }),- update: spec('updateSchedule', CalendarClockIcon, 'schedule', { chip: chip.text('name') }),- remove: spec('removeSchedule', CalendarClockIcon, 'schedule'),- run: spec('runScheduledTask', CalendarClockIcon, 'schedule'),- runs: spec('checkRunHistory', CalendarClockIcon, 'schedule'),- },+ },+ cron: {+ arg: 'action',+ specs: {+ list: spec('checkSchedules', CalendarClockIcon, 'schedule'),+ add: spec('scheduleTask', CalendarClockIcon, 'schedule', { chip: chip.text('name') }),+ update: spec('updateSchedule', CalendarClockIcon, 'schedule', { chip: chip.text('name') }),+ remove: spec('removeSchedule', CalendarClockIcon, 'schedule'),+ run: spec('runScheduledTask', CalendarClockIcon, 'schedule'),+ runs: spec('checkRunHistory', CalendarClockIcon, 'schedule'),},- schedule: {- arg: 'action',- specs: {- list: spec('checkSchedules', CalendarClockIcon, 'schedule'),- get: spec('checkSchedules', CalendarClockIcon, 'schedule'),- cancel: spec('removeSchedule', CalendarClockIcon, 'schedule'),- remove: spec('removeSchedule', CalendarClockIcon, 'schedule'),- pause: spec('updateSchedule', CalendarClockIcon, 'schedule'),- resume: spec('updateSchedule', CalendarClockIcon, 'schedule'),- },+ },+ schedule: {+ arg: 'action',+ specs: {+ list: spec('checkSchedules', CalendarClockIcon, 'schedule'),+ get: spec('checkSchedules', CalendarClockIcon, 'schedule'),+ cancel: spec('removeSchedule', CalendarClockIcon, 'schedule'),+ remove: spec('removeSchedule', CalendarClockIcon, 'schedule'),+ pause: spec('updateSchedule', CalendarClockIcon, 'schedule'),+ resume: spec('updateSchedule', CalendarClockIcon, 'schedule'),},- browser: {- arg: 'action',- specs: {- open: spec('openPage', AppWindowIcon, 'browser', { chip: chip.url() }),- snapshot: spec('takeScreenshot', CameraIcon, 'browser'),- click: spec('click', MousePointerClickIcon, 'browser', { chip: chip.text('selector') }),- mouse_click: spec('click', MousePointerClickIcon, 'browser'),- hover: spec('click', MousePointerClickIcon, 'browser', { chip: chip.text('selector') }),- fill: spec('typeKeys', KeyboardIcon, 'browser', { chip: chip.text('selector') }),- type: spec('typeKeys', KeyboardIcon, 'browser', { chip: chip.text('selector') }),- key_type: spec('typeKeys', KeyboardIcon, 'browser'),- key_press: spec('typeKeys', KeyboardIcon, 'browser', { chip: chip.text('key') }),- press: spec('typeKeys', KeyboardIcon, 'browser', { chip: chip.text('key') }),- scroll: spec('scrollPage', AppWindowIcon, 'browser'),- get_text: spec('readPage', AppWindowIcon, 'browser'),- get_title: spec('readPage', AppWindowIcon, 'browser'),- get_url: spec('readPage', AppWindowIcon, 'browser'),- find: spec('readPage', AppWindowIcon, 'browser', { chip: chip.text('value', 'selector') }),- is_visible: spec('readPage', AppWindowIcon, 'browser'),- wait: spec('wait', HourglassIcon, 'browser'),- },+ },+ browser: {+ arg: 'action',+ specs: {+ open: spec('openPage', AppWindowIcon, 'browser', { chip: chip.url() }),+ snapshot: spec('takeScreenshot', CameraIcon, 'browser'),+ click: spec('click', MousePointerClickIcon, 'browser', { chip: chip.text('selector') }),+ mouse_click: spec('click', MousePointerClickIcon, 'browser'),+ hover: spec('click', MousePointerClickIcon, 'browser', { chip: chip.text('selector') }),+ fill: spec('typeKeys', KeyboardIcon, 'browser', { chip: chip.text('selector') }),+ type: spec('typeKeys', KeyboardIcon, 'browser', { chip: chip.text('selector') }),+ key_type: spec('typeKeys', KeyboardIcon, 'browser'),+ key_press: spec('typeKeys', KeyboardIcon, 'browser', { chip: chip.text('key') }),+ press: spec('typeKeys', KeyboardIcon, 'browser', { chip: chip.text('key') }),+ scroll: spec('scrollPage', AppWindowIcon, 'browser'),+ get_text: spec('readPage', AppWindowIcon, 'browser'),+ get_title: spec('readPage', AppWindowIcon, 'browser'),+ get_url: spec('readPage', AppWindowIcon, 'browser'),+ find: spec('readPage', AppWindowIcon, 'browser', { chip: chip.text('value', 'selector') }),+ is_visible: spec('readPage', AppWindowIcon, 'browser'),+ wait: spec('wait', HourglassIcon, 'browser'),},- };+ },+};/*** Prefix families. Ordered: the first matching rule wins, so a narrower rule@@ -552,13 +555,13 @@ export const FAMILY_TOOL_SPECS: ReadonlyArray<{ test: RegExp; spec: ToolSpec }>},{ test: /^task_source_(fetch|list_tasks)/, spec: spec('fetchTasks', ListChecksIcon, 'app') },{ test: /^task_source_/, spec: spec('checkTaskSources', ListChecksIcon, 'app') },- {- test: /^hosting_(set_env|add_domain)/,- spec: spec('updateHosting', RocketIcon, 'storage'),- },+ { test: /^hosting_(set_env|add_domain)/, spec: spec('updateHosting', RocketIcon, 'storage') },{ test: /^hosting_/, spec: spec('checkHosting', RocketIcon, 'storage') },{ test: /^storage_/, spec: spec('listStoredFiles', HardDriveIcon, 'storage') },- { test: /^stock_/, spec: spec('checkMarkets', TrendingUpIcon, 'app', { chip: chip.text('symbol') }) },+ {+ test: /^stock_/,+ spec: spec('checkMarkets', TrendingUpIcon, 'app', { chip: chip.text('symbol') }),+ },{test: /^wallet_(tx_|lookup_tx)/,spec: spec('checkTransaction', WalletIcon, 'wallet', { chip: chip.text('tx_hash', 'hash') }),@@ -567,10 +570,7 @@ export const FAMILY_TOOL_SPECS: ReadonlyArray<{ test: RegExp; spec: ToolSpec }>{ test: /^composio_/, spec: spec('runAppAction', PlugIcon, 'app') },{ test: /^mcp_/, spec: spec('checkMcpServers', ServerIcon, 'mcp') },{ test: /^config_/, spec: spec('checkSettings', SettingsIcon, 'system') },- {- test: /^(daemon_host_prefs_|service_)/,- spec: spec('manageService', PowerIcon, 'system'),- },+ { test: /^(daemon_host_prefs_|service_)/, spec: spec('manageService', PowerIcon, 'system') },{ test: /^(doctor_|health_)/, spec: spec('runDiagnostics', StethoscopeIcon, 'system') },{ test: /^cost_/, spec: spec('checkUsageCosts', ReceiptIcon, 'system') },{ test: /^artifact_/, spec: spec('checkArtifacts', PackageIcon, 'system') },diff --git a/app/src/utils/toolTimelineFormatting.ts b/app/src/utils/toolTimelineFormatting.tsindex c42e5625b6..d68de10dc3 100644--- a/app/src/utils/toolTimelineFormatting.ts+++ b/app/src/utils/toolTimelineFormatting.ts@@ -10,6 +10,7 @@ import {extractSearchProvider,parseWebSearchResult,} from '../features/conversations/tools/parseWebSearchResult';+import { fillPlaceholders } from '../features/conversations/tools/toolPhrases';import {describeToolCall,type ToolCallPresentation,@@ -17,7 +18,6 @@ import {toolLabel,type Translate,} from '../features/conversations/tools/toolPresentation';-import { fillPlaceholders } from '../features/conversations/tools/toolPhrases';import type { ToolTimelineEntry } from '../store/chatRuntimeSlice';import type { PersistedTranscriptItem } from '../types/turnState';@@ -74,7 +74,10 @@ export function categorizeTool(name: string): ToolCategory {return describeToolCall({ name }).category;}-const STEPS_KEY = { one: 'conversations.tools.steps.one', other: 'conversations.tools.steps.other' };+const STEPS_KEY = {+ one: 'conversations.tools.steps.one',+ other: 'conversations.tools.steps.other',+};const STEPS_EN = { one: '{count} step', other: '{count} steps' };/** "3 steps" in the caller's locale. */