From 4d51410dc8c696b4a127f905fe9c9b545733a64c Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Fri, 17 Jul 2026 14:51:12 -0400 Subject: [PATCH] refactor: move ui/src/{components,lib}/agents into features/ layout Part of the domain-reorg adoption (build plan step C6): fork content, upstream layout. git mv's all 80 pure-rename files from the move-map (agent-scoped components/lib -> ui/src/features/{agents,automations, reviews,settings}/...), including ported/ splitting into features/agents/experiments/ (still-unintegrated desktop-host ports) and features/agents/components/chat/ (CloudPromptBar, CodeBlock, DiffView, Logo, Markdown, ReplyCard, ShellCommand, ToolExecution -- files actually wired into the live dashboard). Fork-diverged files (PlanReview.tsx, WorkflowApprovalCard.tsx, AgentsSidebar.tsx, SidebarFilterMenu.tsx, AgentGitPanel.tsx, AutomationEditor.tsx, DiffView.tsx, CloudPromptBar.tsx) keep fork content -- verified via diff that only import lines changed. Rewrote @/components/agents and @/lib/agents imports across all 54 importer files plus the moved files' own internal imports (grep-driven, 85-entry alias map covering every old->new path pair). Two hazards caught only by the build gate (not tsc, since both files sit under the new experiments/** tsconfig exclude): ui/src/lib/notifications.ts had a relative `./agents/types` import (no `@/` alias) that the grep missed; and features/agents/experiments/index.ts's barrel re-export of the messages module needed to switch from an `@/` alias to a relative import (`../components/messages`) after landing inside the newly tsconfig-excluded experiments/ directory -- vite-tsconfig-paths failed to resolve it at build time even though tsc stayed silent. AgentPromptBar.tsx (the 2-line CloudPromptBar re-export shim) moves to features/agents/components/ with its export path retargeted at CloudPromptBar's new chat/ location -- a D/A pair, not a content loss, since the import-path edit drops it below git's rename-similarity threshold. ported/index.ts is the same D/A story for the same reason. Swapped the 8-file ported/ exclude lists in tsconfig.json and eslint.config.js for the single `src/features/agents/experiments/**` glob (upstream's simplification, no behavior change). Deleted ui/pnpm-workspace.yaml (lockfile hygiene -- bun stays the toolchain). Gates: bunx tsc --noEmit (clean), bun run build (clean after the two notifications.ts / experiments-index.ts fixes above), bun run test (33/33), and the full Playwright E2E suite against the real langgraph dev server + built dashboard (9/9). --- ui/eslint.config.js | 9 +-------- ui/pnpm-workspace.yaml | 3 --- ui/src/components/agents/AgentPromptBar.tsx | 2 -- ui/src/components/agents/ported/index.ts | 18 ----------------- .../agents/components}/AgentGitPanel.tsx | 20 +++++++++---------- .../agents/components/AgentPromptBar.tsx | 2 ++ .../agents/components}/AgentRunCard.tsx | 2 +- .../agents/components}/AgentThreadView.tsx | 20 +++++++++---------- .../agents/components}/AgentsHome.tsx | 16 +++++++-------- .../agents/components}/AgentsSidebar.tsx | 12 +++++------ .../agents/components}/AgentsThreadsPage.tsx | 4 ++-- .../agents/components}/OnboardingDialog.tsx | 0 .../agents/components}/PlanReview.tsx | 2 +- .../agents/components}/SidebarFilterMenu.tsx | 8 ++++---- .../components}/WorkflowApprovalCard.tsx | 4 ++-- .../components/chat}/CloudPromptBar.tsx | 12 +++++------ .../agents/components/chat}/CodeBlock.tsx | 0 .../agents/components/chat}/DiffView.tsx | 6 +++--- .../agents/components/chat}/Logo.tsx | 0 .../agents/components/chat}/Markdown.tsx | 0 .../agents/components/chat}/ReplyCard.tsx | 2 +- .../agents/components/chat}/ShellCommand.tsx | 2 +- .../agents/components/chat}/ToolExecution.tsx | 6 +++--- .../components}/messages/AgentMessage.tsx | 12 +++++------ .../components}/messages/ChunkRenderer.tsx | 8 ++++---- .../components}/messages/MessageTimestamp.tsx | 0 .../agents/components}/messages/Messages.tsx | 2 +- .../components}/messages/ReasoningBlock.tsx | 0 .../components}/messages/ThinkingSpinner.tsx | 0 .../messages/TurnChangedFilesCard.tsx | 2 +- .../components}/messages/UserMessage.tsx | 2 +- .../components}/messages/WorkSummary.tsx | 0 .../agents/components}/messages/index.ts | 0 .../components}/messages/renderItems.ts | 2 +- .../messages/summarizeChangedFiles.ts | 4 ++-- .../agents/components}/messages/types.ts | 2 +- .../subagents/SubagentActivity.tsx | 0 .../components}/subagents/SubagentCard.tsx | 4 ++-- .../components}/subagents/SubagentGroup.tsx | 2 +- .../agents/components}/subagents/index.ts | 0 .../agents/components}/z-index.ts | 0 .../agents/experiments}/BranchSelector.tsx | 0 .../agents/experiments}/BubblePrefix.tsx | 2 +- .../agents/experiments}/ChatView.tsx | 4 ++-- .../experiments}/CompactingIndicator.tsx | 0 .../agents/experiments}/ContextIndicator.tsx | 0 .../agents/experiments}/Footer.tsx | 0 .../agents/experiments}/HeaderBar.tsx | 0 .../agents/experiments}/MarkdownTable.tsx | 0 .../agents/experiments}/PanelResizeHandle.tsx | 0 .../agents/experiments}/PromptBar.tsx | 2 +- .../experiments}/SourceControlPanel.tsx | 0 .../agents/experiments}/SourceControlTile.tsx | 6 +++--- .../agents/experiments}/ThreadPicker.tsx | 2 +- .../agents/experiments}/TodoList.tsx | 2 +- ui/src/features/agents/experiments/index.ts | 18 +++++++++++++++++ .../agents/lib}/AgentThreadStreamProvider.tsx | 0 .../agents => features/agents/lib}/api.ts | 0 .../agents/lib}/messageTimestamps.ts | 0 .../provider/useIsInAgentThreadStream.tsx | 0 .../lib}/provider/useLiveMarkdownMessageId.ts | 2 +- .../agents/lib}/provider/useModelOptions.ts | 0 .../lib}/provider/useSubmitAgentMessage.ts | 8 ++++---- .../agents => features/agents/lib}/queries.ts | 0 .../agents/lib}/sidebarFilter.test.ts | 0 .../agents/lib}/sidebarFilter.ts | 0 .../agents/lib}/sidebarPrefs.ts | 0 .../agents/lib}/streamMessagesToUi.ts | 0 .../agents => features/agents/lib}/types.ts | 0 .../agents/lib}/useRunCompletionNotifier.ts | 2 +- .../agents/utils/diffStats.ts | 0 .../agents/utils/diffUtils.test.ts | 0 .../agents/utils/diffUtils.ts | 0 .../components}/AutomationEditor.tsx | 16 +++++++-------- .../components}/AutomationTemplates.tsx | 4 ++-- .../components}/AutomationsList.tsx | 8 ++++---- .../components}/ScheduleTriggerPicker.tsx | 2 +- .../automations/lib}/automation-templates.ts | 0 .../automations/lib}/cron.ts | 0 .../reviews/components}/PrHeader.tsx | 0 .../reviews/components}/ReviewChat.tsx | 2 +- .../components}/ReviewCommentsMenu.tsx | 0 .../reviews/components}/ReviewMainBody.tsx | 16 +++++++-------- .../reviews/components}/ReviewSidebar.tsx | 2 +- .../reviews/components}/ReviewTab.tsx | 4 ++-- .../settings/components}/RepoSelector.tsx | 0 ui/src/lib/notifications.ts | 2 +- ui/src/routes/admin.tsx | 2 +- ui/src/routes/agents.tsx | 4 ++-- ui/src/routes/agents/$threadId.tsx | 6 +++--- ui/src/routes/agents/$threadId_.plan.tsx | 2 +- .../routes/agents/automations/$scheduleId.tsx | 4 ++-- ui/src/routes/agents/automations/index.tsx | 2 +- ui/src/routes/agents/automations/new.tsx | 4 ++-- ui/src/routes/agents/index.tsx | 2 +- .../agents/reviews/$owner.$repo.$number.tsx | 4 ++-- ui/src/routes/agents/threads.tsx | 6 +++--- ui/src/routes/cloud-agents.tsx | 2 +- ui/tsconfig.json | 9 +-------- 99 files changed, 162 insertions(+), 179 deletions(-) delete mode 100644 ui/pnpm-workspace.yaml delete mode 100644 ui/src/components/agents/AgentPromptBar.tsx delete mode 100644 ui/src/components/agents/ported/index.ts rename ui/src/{components/agents => features/agents/components}/AgentGitPanel.tsx (97%) create mode 100644 ui/src/features/agents/components/AgentPromptBar.tsx rename ui/src/{components/agents => features/agents/components}/AgentRunCard.tsx (98%) rename ui/src/{components/agents => features/agents/components}/AgentThreadView.tsx (92%) rename ui/src/{components/agents => features/agents/components}/AgentsHome.tsx (89%) rename ui/src/{components/agents => features/agents/components}/AgentsSidebar.tsx (98%) rename ui/src/{components/agents => features/agents/components}/AgentsThreadsPage.tsx (98%) rename ui/src/{components/agents => features/agents/components}/OnboardingDialog.tsx (100%) rename ui/src/{components/agents => features/agents/components}/PlanReview.tsx (99%) rename ui/src/{components/agents => features/agents/components}/SidebarFilterMenu.tsx (97%) rename ui/src/{components/agents => features/agents/components}/WorkflowApprovalCard.tsx (98%) rename ui/src/{components/agents/ported => features/agents/components/chat}/CloudPromptBar.tsx (97%) rename ui/src/{components/agents/ported => features/agents/components/chat}/CodeBlock.tsx (100%) rename ui/src/{components/agents/ported => features/agents/components/chat}/DiffView.tsx (88%) rename ui/src/{components/agents/ported => features/agents/components/chat}/Logo.tsx (100%) rename ui/src/{components/agents/ported => features/agents/components/chat}/Markdown.tsx (100%) rename ui/src/{components/agents/ported => features/agents/components/chat}/ReplyCard.tsx (98%) rename ui/src/{components/agents/ported => features/agents/components/chat}/ShellCommand.tsx (98%) rename ui/src/{components/agents/ported => features/agents/components/chat}/ToolExecution.tsx (97%) rename ui/src/{components/agents => features/agents/components}/messages/AgentMessage.tsx (96%) rename ui/src/{components/agents => features/agents/components}/messages/ChunkRenderer.tsx (83%) rename ui/src/{components/agents => features/agents/components}/messages/MessageTimestamp.tsx (100%) rename ui/src/{components/agents => features/agents/components}/messages/Messages.tsx (98%) rename ui/src/{components/agents => features/agents/components}/messages/ReasoningBlock.tsx (100%) rename ui/src/{components/agents => features/agents/components}/messages/ThinkingSpinner.tsx (100%) rename ui/src/{components/agents => features/agents/components}/messages/TurnChangedFilesCard.tsx (97%) rename ui/src/{components/agents => features/agents/components}/messages/UserMessage.tsx (97%) rename ui/src/{components/agents => features/agents/components}/messages/WorkSummary.tsx (100%) rename ui/src/{components/agents => features/agents/components}/messages/index.ts (100%) rename ui/src/{components/agents => features/agents/components}/messages/renderItems.ts (98%) rename ui/src/{components/agents => features/agents/components}/messages/summarizeChangedFiles.ts (92%) rename ui/src/{components/agents => features/agents/components}/messages/types.ts (94%) rename ui/src/{components/agents => features/agents/components}/subagents/SubagentActivity.tsx (100%) rename ui/src/{components/agents => features/agents/components}/subagents/SubagentCard.tsx (92%) rename ui/src/{components/agents => features/agents/components}/subagents/SubagentGroup.tsx (91%) rename ui/src/{components/agents => features/agents/components}/subagents/index.ts (100%) rename ui/src/{components/agents => features/agents/components}/z-index.ts (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/BranchSelector.tsx (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/BubblePrefix.tsx (89%) rename ui/src/{components/agents/ported => features/agents/experiments}/ChatView.tsx (99%) rename ui/src/{components/agents/ported => features/agents/experiments}/CompactingIndicator.tsx (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/ContextIndicator.tsx (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/Footer.tsx (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/HeaderBar.tsx (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/MarkdownTable.tsx (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/PanelResizeHandle.tsx (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/PromptBar.tsx (99%) rename ui/src/{components/agents/ported => features/agents/experiments}/SourceControlPanel.tsx (100%) rename ui/src/{components/agents/ported => features/agents/experiments}/SourceControlTile.tsx (99%) rename ui/src/{components/agents/ported => features/agents/experiments}/ThreadPicker.tsx (99%) rename ui/src/{components/agents/ported => features/agents/experiments}/TodoList.tsx (98%) create mode 100644 ui/src/features/agents/experiments/index.ts rename ui/src/{lib/agents => features/agents/lib}/AgentThreadStreamProvider.tsx (100%) rename ui/src/{lib/agents => features/agents/lib}/api.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/messageTimestamps.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/provider/useIsInAgentThreadStream.tsx (100%) rename ui/src/{lib/agents => features/agents/lib}/provider/useLiveMarkdownMessageId.ts (96%) rename ui/src/{lib/agents => features/agents/lib}/provider/useModelOptions.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/provider/useSubmitAgentMessage.ts (95%) rename ui/src/{lib/agents => features/agents/lib}/queries.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/sidebarFilter.test.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/sidebarFilter.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/sidebarPrefs.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/streamMessagesToUi.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/types.ts (100%) rename ui/src/{lib/agents => features/agents/lib}/useRunCompletionNotifier.ts (95%) rename ui/src/{components => features}/agents/utils/diffStats.ts (100%) rename ui/src/{components => features}/agents/utils/diffUtils.test.ts (100%) rename ui/src/{components => features}/agents/utils/diffUtils.ts (100%) rename ui/src/{components/agents => features/automations/components}/AutomationEditor.tsx (95%) rename ui/src/{components/agents => features/automations/components}/AutomationTemplates.tsx (91%) rename ui/src/{components/agents => features/automations/components}/AutomationsList.tsx (96%) rename ui/src/{components/agents => features/automations/components}/ScheduleTriggerPicker.tsx (97%) rename ui/src/{lib/agents => features/automations/lib}/automation-templates.ts (100%) rename ui/src/{lib/agents => features/automations/lib}/cron.ts (100%) rename ui/src/{components/agents => features/reviews/components}/PrHeader.tsx (100%) rename ui/src/{components/agents => features/reviews/components}/ReviewChat.tsx (99%) rename ui/src/{components/agents => features/reviews/components}/ReviewCommentsMenu.tsx (100%) rename ui/src/{components/agents => features/reviews/components}/ReviewMainBody.tsx (99%) rename ui/src/{components/agents => features/reviews/components}/ReviewSidebar.tsx (99%) rename ui/src/{components/agents => features/reviews/components}/ReviewTab.tsx (93%) rename ui/src/{components/agents => features/settings/components}/RepoSelector.tsx (100%) diff --git a/ui/eslint.config.js b/ui/eslint.config.js index 71b53ea5..4133b45b 100644 --- a/ui/eslint.config.js +++ b/ui/eslint.config.js @@ -14,14 +14,7 @@ export default [ // Ported from a desktop host app and excluded from tsconfig (not yet // integrated), so type-aware linting cannot resolve them. Keep this list // in sync with the `exclude` entries in tsconfig.json. - "src/components/agents/ported/ChatView.tsx", - "src/components/agents/ported/PromptBar.tsx", - "src/components/agents/ported/BranchSelector.tsx", - "src/components/agents/ported/ContextIndicator.tsx", - "src/components/agents/ported/SourceControlPanel.tsx", - "src/components/agents/ported/SourceControlTile.tsx", - "src/components/agents/ported/Footer.tsx", - "src/components/agents/ported/ThreadPicker.tsx", + "src/features/agents/experiments/**", ], }, ...tanstackConfig, diff --git a/ui/pnpm-workspace.yaml b/ui/pnpm-workspace.yaml deleted file mode 100644 index 6c458aba..00000000 --- a/ui/pnpm-workspace.yaml +++ /dev/null @@ -1,3 +0,0 @@ -allowBuilds: - esbuild: true - unrs-resolver: true diff --git a/ui/src/components/agents/AgentPromptBar.tsx b/ui/src/components/agents/AgentPromptBar.tsx deleted file mode 100644 index cb3c98f6..00000000 --- a/ui/src/components/agents/AgentPromptBar.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export { CloudPromptBar as AgentPromptBar } from "@/components/agents/ported/CloudPromptBar"; -export type { CloudPromptBarProps as AgentPromptBarProps } from "@/components/agents/ported/CloudPromptBar"; diff --git a/ui/src/components/agents/ported/index.ts b/ui/src/components/agents/ported/index.ts deleted file mode 100644 index d8211955..00000000 --- a/ui/src/components/agents/ported/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -export { BubblePrefix } from "./BubblePrefix"; -export { CloudPromptBar } from "./CloudPromptBar"; -export { CodeBlock } from "./CodeBlock"; -export { CompactingIndicator } from "./CompactingIndicator"; -export { DiffView } from "./DiffView"; -export { HeaderBar } from "./HeaderBar"; -export { Logo } from "./Logo"; -export { Markdown } from "./Markdown"; -export { MarkdownTable } from "./MarkdownTable"; -export { - Messages, - summarizeChangedFiles, - type MessagesScrollControl, -} from "@/components/agents/messages"; -export { PanelResizeHandle } from "./PanelResizeHandle"; -export { ShellCommand } from "./ShellCommand"; -export { TodoList } from "./TodoList"; -export { ToolExecution } from "./ToolExecution"; diff --git a/ui/src/components/agents/AgentGitPanel.tsx b/ui/src/features/agents/components/AgentGitPanel.tsx similarity index 97% rename from ui/src/components/agents/AgentGitPanel.tsx rename to ui/src/features/agents/components/AgentGitPanel.tsx index daa3c784..540b0d9f 100644 --- a/ui/src/components/agents/AgentGitPanel.tsx +++ b/ui/src/features/agents/components/AgentGitPanel.tsx @@ -18,13 +18,13 @@ import { import type { FileContents } from "@pierre/diffs/react" import type { GitStatus, GitStatusEntry } from "@pierre/trees" -import type { AgentThread, Message } from "@/lib/agents/types" -import type { ThreadPrDiffFile } from "@/lib/agents/api" -import type { ChangedFileSummaryItem } from "@/components/agents/messages" -import { agentsApi } from "@/lib/agents/api" -import { useAgentThreadPrDiff } from "@/lib/agents/queries" -import { ReviewTab } from "@/components/agents/ReviewTab" -import { PrHeader } from "@/components/agents/PrHeader" +import type { AgentThread, Message } from "@/features/agents/lib/types" +import type { ThreadPrDiffFile } from "@/features/agents/lib/api" +import type { ChangedFileSummaryItem } from "@/features/agents/components/messages" +import { agentsApi } from "@/features/agents/lib/api" +import { useAgentThreadPrDiff } from "@/features/agents/lib/queries" +import { ReviewTab } from "@/features/reviews/components/ReviewTab" +import { PrHeader } from "@/features/reviews/components/PrHeader" import { buttonVariants } from "@/components/ui/button" import { DIFF_VIRTUALIZER_CONFIG, @@ -33,9 +33,9 @@ import { DIFF_WORKER_POOL_OPTIONS, fileContentsCacheKey, useDiffOptions, -} from "@/components/agents/utils/diffUtils" -import { summarizeChangedFiles } from "@/components/agents/ported" -import { Z } from "@/components/agents/z-index" +} from "@/features/agents/utils/diffUtils" +import { summarizeChangedFiles } from "@/features/agents/experiments" +import { Z } from "@/features/agents/components/z-index" import { useIsMobile } from "@/lib/useIsMobile" import { cn } from "@/lib/utils" diff --git a/ui/src/features/agents/components/AgentPromptBar.tsx b/ui/src/features/agents/components/AgentPromptBar.tsx new file mode 100644 index 00000000..a9e8adf0 --- /dev/null +++ b/ui/src/features/agents/components/AgentPromptBar.tsx @@ -0,0 +1,2 @@ +export { CloudPromptBar as AgentPromptBar } from "@/features/agents/components/chat/CloudPromptBar"; +export type { CloudPromptBarProps as AgentPromptBarProps } from "@/features/agents/components/chat/CloudPromptBar"; diff --git a/ui/src/components/agents/AgentRunCard.tsx b/ui/src/features/agents/components/AgentRunCard.tsx similarity index 98% rename from ui/src/components/agents/AgentRunCard.tsx rename to ui/src/features/agents/components/AgentRunCard.tsx index 2d4d1da5..e1e25d81 100644 --- a/ui/src/components/agents/AgentRunCard.tsx +++ b/ui/src/features/agents/components/AgentRunCard.tsx @@ -10,7 +10,7 @@ import { IoLogoGithub, IoLogoSlack } from "react-icons/io5" import { SiLinear } from "react-icons/si" import type { ComponentType, SVGProps } from "react" -import type { AgentSource, AgentThread } from "@/lib/agents/types" +import type { AgentSource, AgentThread } from "@/features/agents/lib/types" import { cn, formatRelativeTime } from "@/lib/utils" type SourceIcon = ComponentType> diff --git a/ui/src/components/agents/AgentThreadView.tsx b/ui/src/features/agents/components/AgentThreadView.tsx similarity index 92% rename from ui/src/components/agents/AgentThreadView.tsx rename to ui/src/features/agents/components/AgentThreadView.tsx index fc9ece4a..c1b3fb9a 100644 --- a/ui/src/components/agents/AgentThreadView.tsx +++ b/ui/src/features/agents/components/AgentThreadView.tsx @@ -7,23 +7,23 @@ import type { AgentThread, Message, QueuedThreadMessage, -} from "@/lib/agents/types" -import type { ModelSelection } from "@/lib/agents/provider/useModelOptions" +} from "@/features/agents/lib/types" +import type { ModelSelection } from "@/features/agents/lib/provider/useModelOptions" import { AgentGitPanel, PANEL_MIN_CHAT_WIDTH, readStoredPanelCollapsed, writeStoredPanelCollapsed, -} from "@/components/agents/AgentGitPanel" -import { AgentPromptBar } from "@/components/agents/AgentPromptBar" -import { Messages } from "@/components/agents/messages" -import { streamMessagesToUi } from "@/lib/agents/streamMessagesToUi" -import { messageArrivalTimestamp } from "@/lib/agents/messageTimestamps" -import { useSubmitAgentMessage } from "@/lib/agents/provider/useSubmitAgentMessage" -import { useModelOptions } from "@/lib/agents/provider/useModelOptions" +} from "@/features/agents/components/AgentGitPanel" +import { AgentPromptBar } from "@/features/agents/components/AgentPromptBar" +import { Messages } from "@/features/agents/components/messages" +import { streamMessagesToUi } from "@/features/agents/lib/streamMessagesToUi" +import { messageArrivalTimestamp } from "@/features/agents/lib/messageTimestamps" +import { useSubmitAgentMessage } from "@/features/agents/lib/provider/useSubmitAgentMessage" +import { useModelOptions } from "@/features/agents/lib/provider/useModelOptions" import { useIsMobile } from "@/lib/useIsMobile" import { cn } from "@/lib/utils" -import { WorkflowApprovalCard } from "@/components/agents/WorkflowApprovalCard" +import { WorkflowApprovalCard } from "@/features/agents/components/WorkflowApprovalCard" interface AgentThreadViewProps { thread: AgentThread diff --git a/ui/src/components/agents/AgentsHome.tsx b/ui/src/features/agents/components/AgentsHome.tsx similarity index 89% rename from ui/src/components/agents/AgentsHome.tsx rename to ui/src/features/agents/components/AgentsHome.tsx index b5ac974d..176aad53 100644 --- a/ui/src/components/agents/AgentsHome.tsx +++ b/ui/src/features/agents/components/AgentsHome.tsx @@ -3,19 +3,19 @@ import { useStreamContext as useAgentThreadStream } from "@langchain/react" import { useQueryClient } from "@tanstack/react-query" import { useNavigate } from "@tanstack/react-router" -import type { ImageChunk } from "@/lib/agents/types" -import type { CreateAgentThreadVariables } from "@/lib/agents/queries" -import type { ModelSelection } from "@/lib/agents/provider/useModelOptions" -import { AgentPromptBar } from "@/components/agents/AgentPromptBar" -import { OnboardingDialog } from "@/components/agents/OnboardingDialog" -import { Logo } from "@/components/agents/ported/Logo" +import type { ImageChunk } from "@/features/agents/lib/types" +import type { CreateAgentThreadVariables } from "@/features/agents/lib/queries" +import type { ModelSelection } from "@/features/agents/lib/provider/useModelOptions" +import { AgentPromptBar } from "@/features/agents/components/AgentPromptBar" +import { OnboardingDialog } from "@/features/agents/components/OnboardingDialog" +import { Logo } from "@/features/agents/components/chat/Logo" import { agentThreadKeys, invalidateAgentThreadLists, optimisticThread, seedAgentThreadLists, -} from "@/lib/agents/queries" -import { useModelOptions } from "@/lib/agents/provider/useModelOptions" +} from "@/features/agents/lib/queries" +import { useModelOptions } from "@/features/agents/lib/provider/useModelOptions" import { useProfile, useRepos } from "@/lib/profile" import { requestNotificationPermission, diff --git a/ui/src/components/agents/AgentsSidebar.tsx b/ui/src/features/agents/components/AgentsSidebar.tsx similarity index 98% rename from ui/src/components/agents/AgentsSidebar.tsx rename to ui/src/features/agents/components/AgentsSidebar.tsx index 07f1b749..b6057ac5 100644 --- a/ui/src/components/agents/AgentsSidebar.tsx +++ b/ui/src/features/agents/components/AgentsSidebar.tsx @@ -25,10 +25,10 @@ import { useState } from "react" import type { ComponentType, SVGProps } from "react" import type { SessionUser } from "@/lib/api" -import type { AgentSource, AgentThread } from "@/lib/agents/types" +import type { AgentSource, AgentThread } from "@/features/agents/lib/types" import type { SidebarLayout } from "@/components/sidebar-layout" import { SidebarUserMenu } from "@/components/SidebarUserMenu" -import { SidebarFilterMenu } from "@/components/agents/SidebarFilterMenu" +import { SidebarFilterMenu } from "@/features/agents/components/SidebarFilterMenu" import { Button } from "@/components/ui/button" import { SidebarCollapseButton, @@ -41,15 +41,15 @@ import { filterThreads, groupThreadsByMode, hasActiveFilters, -} from "@/lib/agents/sidebarFilter" -import { useSidebarPrefs } from "@/lib/agents/sidebarPrefs" +} from "@/features/agents/lib/sidebarFilter" +import { useSidebarPrefs } from "@/features/agents/lib/sidebarPrefs" import { useDeleteAgentThread, useResolveAgentThread, useSeedAgentThreadDetails, useSidebarThreads, -} from "@/lib/agents/queries" -import { useRunCompletionNotifier } from "@/lib/agents/useRunCompletionNotifier" +} from "@/features/agents/lib/queries" +import { useRunCompletionNotifier } from "@/features/agents/lib/useRunCompletionNotifier" import { cn } from "@/lib/utils" const RESOLVED_SIDEBAR_LIMIT = 20 diff --git a/ui/src/components/agents/AgentsThreadsPage.tsx b/ui/src/features/agents/components/AgentsThreadsPage.tsx similarity index 98% rename from ui/src/components/agents/AgentsThreadsPage.tsx rename to ui/src/features/agents/components/AgentsThreadsPage.tsx index 8021de16..1d89dd01 100644 --- a/ui/src/components/agents/AgentsThreadsPage.tsx +++ b/ui/src/features/agents/components/AgentsThreadsPage.tsx @@ -7,10 +7,10 @@ import { } from "@phosphor-icons/react" import { useState } from "react" -import type { AgentSource, AgentStatus, AgentThread } from "@/lib/agents/types" +import type { AgentSource, AgentStatus, AgentThread } from "@/features/agents/lib/types" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" -import { useResolveAgentThread, useThreadsPage } from "@/lib/agents/queries" +import { useResolveAgentThread, useThreadsPage } from "@/features/agents/lib/queries" import { cn } from "@/lib/utils" const PAGE_SIZE = 25 diff --git a/ui/src/components/agents/OnboardingDialog.tsx b/ui/src/features/agents/components/OnboardingDialog.tsx similarity index 100% rename from ui/src/components/agents/OnboardingDialog.tsx rename to ui/src/features/agents/components/OnboardingDialog.tsx diff --git a/ui/src/components/agents/PlanReview.tsx b/ui/src/features/agents/components/PlanReview.tsx similarity index 99% rename from ui/src/components/agents/PlanReview.tsx rename to ui/src/features/agents/components/PlanReview.tsx index fb833d6c..7d2d5afb 100644 --- a/ui/src/components/agents/PlanReview.tsx +++ b/ui/src/features/agents/components/PlanReview.tsx @@ -11,7 +11,7 @@ import { updatePlan, } from "@/lib/plan" import { Button } from "@/components/ui/button" -import { Markdown } from "@/components/agents/ported" +import { Markdown } from "@/features/agents/experiments" import { useResolvedTheme } from "@/lib/theme" const POLL_MS = 4000 diff --git a/ui/src/components/agents/SidebarFilterMenu.tsx b/ui/src/features/agents/components/SidebarFilterMenu.tsx similarity index 97% rename from ui/src/components/agents/SidebarFilterMenu.tsx rename to ui/src/features/agents/components/SidebarFilterMenu.tsx index 6eeb0d9b..44e80438 100644 --- a/ui/src/components/agents/SidebarFilterMenu.tsx +++ b/ui/src/features/agents/components/SidebarFilterMenu.tsx @@ -1,14 +1,14 @@ import { Menu } from "@base-ui/react/menu" import { CaretRightIcon, CheckIcon, FunnelIcon } from "@phosphor-icons/react" -import type { AgentSource, AgentStatus } from "@/lib/agents/types" +import type { AgentSource, AgentStatus } from "@/features/agents/lib/types" import type { PrFilter, SidebarFacets, SidebarFilters, SidebarGroupMode, -} from "@/lib/agents/sidebarFilter" -import type { SidebarPrefs } from "@/lib/agents/sidebarPrefs" +} from "@/features/agents/lib/sidebarFilter" +import type { SidebarPrefs } from "@/features/agents/lib/sidebarPrefs" import { GROUP_MODE_OPTIONS, OWNERSHIP_OPTIONS, @@ -17,7 +17,7 @@ import { STATUS_FILTER_OPTIONS, hasActiveFilters, toggleArrayValue, -} from "@/lib/agents/sidebarFilter" +} from "@/features/agents/lib/sidebarFilter" import { cn } from "@/lib/utils" const POPUP_CLASS = diff --git a/ui/src/components/agents/WorkflowApprovalCard.tsx b/ui/src/features/agents/components/WorkflowApprovalCard.tsx similarity index 98% rename from ui/src/components/agents/WorkflowApprovalCard.tsx rename to ui/src/features/agents/components/WorkflowApprovalCard.tsx index cdd150f9..0142419d 100644 --- a/ui/src/components/agents/WorkflowApprovalCard.tsx +++ b/ui/src/features/agents/components/WorkflowApprovalCard.tsx @@ -1,11 +1,11 @@ import { useMemo, useState } from "react" import { ShieldCheck } from "lucide-react" -import type { WorkflowPushApproval } from "@/lib/agents/api" +import type { WorkflowPushApproval } from "@/features/agents/lib/api" import { useWorkflowApprovalDecision, useWorkflowApprovals, -} from "@/lib/agents/queries" +} from "@/features/agents/lib/queries" import { Button } from "@/components/ui/button" import { cn } from "@/lib/utils" diff --git a/ui/src/components/agents/ported/CloudPromptBar.tsx b/ui/src/features/agents/components/chat/CloudPromptBar.tsx similarity index 97% rename from ui/src/components/agents/ported/CloudPromptBar.tsx rename to ui/src/features/agents/components/chat/CloudPromptBar.tsx index cd6ebadd..bdffc20a 100644 --- a/ui/src/components/agents/ported/CloudPromptBar.tsx +++ b/ui/src/features/agents/components/chat/CloudPromptBar.tsx @@ -20,12 +20,12 @@ import { } from "react" import type { ModelOption } from "@/lib/api" -import type { ImageChunk } from "@/lib/agents/types" -import type { ModelSelection } from "@/lib/agents/provider/useModelOptions" -import { RepoSelector } from "@/components/agents/RepoSelector" -import { useIsInAgentThreadStream } from "@/lib/agents/provider/useIsInAgentThreadStream" -import { agentThreadKeys, invalidateAgentThreadLists } from "@/lib/agents/queries" -import { formatModelSelection } from "@/lib/agents/provider/useModelOptions" +import type { ImageChunk } from "@/features/agents/lib/types" +import type { ModelSelection } from "@/features/agents/lib/provider/useModelOptions" +import { RepoSelector } from "@/features/settings/components/RepoSelector" +import { useIsInAgentThreadStream } from "@/features/agents/lib/provider/useIsInAgentThreadStream" +import { agentThreadKeys, invalidateAgentThreadLists } from "@/features/agents/lib/queries" +import { formatModelSelection } from "@/features/agents/lib/provider/useModelOptions" import { IconButton } from "@/components/ui/button" import { cn } from "@/lib/utils" diff --git a/ui/src/components/agents/ported/CodeBlock.tsx b/ui/src/features/agents/components/chat/CodeBlock.tsx similarity index 100% rename from ui/src/components/agents/ported/CodeBlock.tsx rename to ui/src/features/agents/components/chat/CodeBlock.tsx diff --git a/ui/src/components/agents/ported/DiffView.tsx b/ui/src/features/agents/components/chat/DiffView.tsx similarity index 88% rename from ui/src/components/agents/ported/DiffView.tsx rename to ui/src/features/agents/components/chat/DiffView.tsx index 243c814e..36f24de6 100644 --- a/ui/src/components/agents/ported/DiffView.tsx +++ b/ui/src/features/agents/components/chat/DiffView.tsx @@ -1,8 +1,8 @@ import { useMemo } from "react"; import { MultiFileDiff } from "@pierre/diffs/react"; -import type { DiffData } from "@/lib/agents/types"; -import { diffOptions } from "@/components/agents/utils/diffUtils"; -import { countLineChanges } from "@/components/agents/utils/diffStats"; +import type { DiffData } from "@/features/agents/lib/types"; +import { diffOptions } from "@/features/agents/utils/diffUtils"; +import { countLineChanges } from "@/features/agents/utils/diffStats"; interface DiffViewProps { diffData: DiffData; diff --git a/ui/src/components/agents/ported/Logo.tsx b/ui/src/features/agents/components/chat/Logo.tsx similarity index 100% rename from ui/src/components/agents/ported/Logo.tsx rename to ui/src/features/agents/components/chat/Logo.tsx diff --git a/ui/src/components/agents/ported/Markdown.tsx b/ui/src/features/agents/components/chat/Markdown.tsx similarity index 100% rename from ui/src/components/agents/ported/Markdown.tsx rename to ui/src/features/agents/components/chat/Markdown.tsx diff --git a/ui/src/components/agents/ported/ReplyCard.tsx b/ui/src/features/agents/components/chat/ReplyCard.tsx similarity index 98% rename from ui/src/components/agents/ported/ReplyCard.tsx rename to ui/src/features/agents/components/chat/ReplyCard.tsx index b1b2a4dd..e4f4161a 100644 --- a/ui/src/components/agents/ported/ReplyCard.tsx +++ b/ui/src/features/agents/components/chat/ReplyCard.tsx @@ -2,7 +2,7 @@ import { memo } from "react" import { MessageCircle } from "lucide-react" import { Markdown } from "./Markdown" import type { ReactNode } from "react" -import type { ToolExecutionChunk } from "@/lib/agents/types" +import type { ToolExecutionChunk } from "@/features/agents/lib/types" interface ReplyCardProps { chunk: ToolExecutionChunk diff --git a/ui/src/components/agents/ported/ShellCommand.tsx b/ui/src/features/agents/components/chat/ShellCommand.tsx similarity index 98% rename from ui/src/components/agents/ported/ShellCommand.tsx rename to ui/src/features/agents/components/chat/ShellCommand.tsx index e53de8e7..bfe1ec7d 100644 --- a/ui/src/components/agents/ported/ShellCommand.tsx +++ b/ui/src/features/agents/components/chat/ShellCommand.tsx @@ -1,5 +1,5 @@ import { memo, useCallback, useLayoutEffect, useRef, useState } from "react"; -import type { ToolExecutionChunk } from "@/lib/agents/types"; +import type { ToolExecutionChunk } from "@/features/agents/lib/types"; interface ShellCommandProps { chunk: ToolExecutionChunk; diff --git a/ui/src/components/agents/ported/ToolExecution.tsx b/ui/src/features/agents/components/chat/ToolExecution.tsx similarity index 97% rename from ui/src/components/agents/ported/ToolExecution.tsx rename to ui/src/features/agents/components/chat/ToolExecution.tsx index 25f2e018..59bd2411 100644 --- a/ui/src/components/agents/ported/ToolExecution.tsx +++ b/ui/src/features/agents/components/chat/ToolExecution.tsx @@ -1,9 +1,9 @@ import { memo, useCallback, useLayoutEffect, useMemo, useRef, useState } from "react"; import { MultiFileDiff } from "@pierre/diffs/react"; import { DiffView } from "./DiffView"; -import type { AcpToolKind, ToolExecutionChunk } from "@/lib/agents/types"; -import { useDiffOptions } from "@/components/agents/utils/diffUtils"; -import { countLineChanges } from "@/components/agents/utils/diffStats"; +import type { AcpToolKind, ToolExecutionChunk } from "@/features/agents/lib/types"; +import { useDiffOptions } from "@/features/agents/utils/diffUtils"; +import { countLineChanges } from "@/features/agents/utils/diffStats"; interface ToolExecutionProps { chunk: ToolExecutionChunk; diff --git a/ui/src/components/agents/messages/AgentMessage.tsx b/ui/src/features/agents/components/messages/AgentMessage.tsx similarity index 96% rename from ui/src/components/agents/messages/AgentMessage.tsx rename to ui/src/features/agents/components/messages/AgentMessage.tsx index 8647faca..c66e16be 100644 --- a/ui/src/components/agents/messages/AgentMessage.tsx +++ b/ui/src/features/agents/components/messages/AgentMessage.tsx @@ -9,13 +9,13 @@ import { TurnChangedFilesCard } from "./TurnChangedFilesCard"; import { WorkSummary } from "./WorkSummary"; import type { ReactNode } from "react"; import type { RenderItem } from "./renderItems"; -import type { Message } from "@/lib/agents/types"; +import type { Message } from "@/features/agents/lib/types"; import type { ApprovalCallbacks, ChangedFileSummaryItem } from "./types"; -import { formatHoverTimestamp } from "@/lib/agents/messageTimestamps"; -import { SubagentGroup } from "@/components/agents/subagents"; -import { ToolExecution } from "@/components/agents/ported/ToolExecution"; -import { ShellCommand } from "@/components/agents/ported/ShellCommand"; -import { ReplyCard } from "@/components/agents/ported/ReplyCard"; +import { formatHoverTimestamp } from "@/features/agents/lib/messageTimestamps"; +import { SubagentGroup } from "@/features/agents/components/subagents"; +import { ToolExecution } from "@/features/agents/components/chat/ToolExecution"; +import { ShellCommand } from "@/features/agents/components/chat/ShellCommand"; +import { ReplyCard } from "@/features/agents/components/chat/ReplyCard"; /** * Render-item types kept visible (not collapsed) when a turn finishes — the diff --git a/ui/src/components/agents/messages/ChunkRenderer.tsx b/ui/src/features/agents/components/messages/ChunkRenderer.tsx similarity index 83% rename from ui/src/components/agents/messages/ChunkRenderer.tsx rename to ui/src/features/agents/components/messages/ChunkRenderer.tsx index 5b6fc70e..857ed729 100644 --- a/ui/src/components/agents/messages/ChunkRenderer.tsx +++ b/ui/src/features/agents/components/messages/ChunkRenderer.tsx @@ -1,8 +1,8 @@ -import type { Chunk } from "@/lib/agents/types"; +import type { Chunk } from "@/features/agents/lib/types"; import type { ApprovalCallbacks } from "./types"; -import { CodeBlock } from "@/components/agents/ported/CodeBlock"; -import { Markdown } from "@/components/agents/ported/Markdown"; -import { ToolExecution } from "@/components/agents/ported/ToolExecution"; +import { CodeBlock } from "@/features/agents/components/chat/CodeBlock"; +import { Markdown } from "@/features/agents/components/chat/Markdown"; +import { ToolExecution } from "@/features/agents/components/chat/ToolExecution"; export function ChunkRenderer({ chunk, diff --git a/ui/src/components/agents/messages/MessageTimestamp.tsx b/ui/src/features/agents/components/messages/MessageTimestamp.tsx similarity index 100% rename from ui/src/components/agents/messages/MessageTimestamp.tsx rename to ui/src/features/agents/components/messages/MessageTimestamp.tsx diff --git a/ui/src/components/agents/messages/Messages.tsx b/ui/src/features/agents/components/messages/Messages.tsx similarity index 98% rename from ui/src/components/agents/messages/Messages.tsx rename to ui/src/features/agents/components/messages/Messages.tsx index 750e8116..efc61c88 100644 --- a/ui/src/components/agents/messages/Messages.tsx +++ b/ui/src/features/agents/components/messages/Messages.tsx @@ -5,7 +5,7 @@ import { AgentMessage } from "./AgentMessage"; import { ThinkingSpinner } from "./ThinkingSpinner"; import { UserMessage } from "./UserMessage"; import type { MessagesProps } from "./types"; -import { useLiveMarkdownMessageId } from "@/lib/agents/provider/useLiveMarkdownMessageId"; +import { useLiveMarkdownMessageId } from "@/features/agents/lib/provider/useLiveMarkdownMessageId"; const BOTTOM_LOCK_THRESHOLD_PX = 24; diff --git a/ui/src/components/agents/messages/ReasoningBlock.tsx b/ui/src/features/agents/components/messages/ReasoningBlock.tsx similarity index 100% rename from ui/src/components/agents/messages/ReasoningBlock.tsx rename to ui/src/features/agents/components/messages/ReasoningBlock.tsx diff --git a/ui/src/components/agents/messages/ThinkingSpinner.tsx b/ui/src/features/agents/components/messages/ThinkingSpinner.tsx similarity index 100% rename from ui/src/components/agents/messages/ThinkingSpinner.tsx rename to ui/src/features/agents/components/messages/ThinkingSpinner.tsx diff --git a/ui/src/components/agents/messages/TurnChangedFilesCard.tsx b/ui/src/features/agents/components/messages/TurnChangedFilesCard.tsx similarity index 97% rename from ui/src/components/agents/messages/TurnChangedFilesCard.tsx rename to ui/src/features/agents/components/messages/TurnChangedFilesCard.tsx index 3575a033..de98a3d9 100644 --- a/ui/src/components/agents/messages/TurnChangedFilesCard.tsx +++ b/ui/src/features/agents/components/messages/TurnChangedFilesCard.tsx @@ -3,7 +3,7 @@ import { ChevronDown, ChevronUp } from "lucide-react"; import { MultiFileDiff } from "@pierre/diffs/react"; import type { ChangedFileSummaryItem } from "./types"; -import { useDiffOptions, warmDiffHighlighter } from "@/components/agents/utils/diffUtils"; +import { useDiffOptions, warmDiffHighlighter } from "@/features/agents/utils/diffUtils"; function stripProjectPathForDisplay(path: string, projectPath?: string): string { if (!projectPath) return path; diff --git a/ui/src/components/agents/messages/UserMessage.tsx b/ui/src/features/agents/components/messages/UserMessage.tsx similarity index 97% rename from ui/src/components/agents/messages/UserMessage.tsx rename to ui/src/features/agents/components/messages/UserMessage.tsx index 42adb574..ac80579e 100644 --- a/ui/src/components/agents/messages/UserMessage.tsx +++ b/ui/src/features/agents/components/messages/UserMessage.tsx @@ -1,7 +1,7 @@ import { useCallback, useLayoutEffect, useRef, useState } from "react"; import { MessageTimestamp } from "./MessageTimestamp"; -import type { Message } from "@/lib/agents/types"; +import type { Message } from "@/features/agents/lib/types"; export function UserMessage({ message }: { message: Message }) { const text = message.chunks diff --git a/ui/src/components/agents/messages/WorkSummary.tsx b/ui/src/features/agents/components/messages/WorkSummary.tsx similarity index 100% rename from ui/src/components/agents/messages/WorkSummary.tsx rename to ui/src/features/agents/components/messages/WorkSummary.tsx diff --git a/ui/src/components/agents/messages/index.ts b/ui/src/features/agents/components/messages/index.ts similarity index 100% rename from ui/src/components/agents/messages/index.ts rename to ui/src/features/agents/components/messages/index.ts diff --git a/ui/src/components/agents/messages/renderItems.ts b/ui/src/features/agents/components/messages/renderItems.ts similarity index 98% rename from ui/src/components/agents/messages/renderItems.ts rename to ui/src/features/agents/components/messages/renderItems.ts index c8386184..28232a4f 100644 --- a/ui/src/components/agents/messages/renderItems.ts +++ b/ui/src/features/agents/components/messages/renderItems.ts @@ -1,4 +1,4 @@ -import type { Chunk, ToolExecutionChunk } from "@/lib/agents/types"; +import type { Chunk, ToolExecutionChunk } from "@/features/agents/lib/types"; export type RenderItem = | { type: "text-chunk"; key: string; chunk: Chunk } diff --git a/ui/src/components/agents/messages/summarizeChangedFiles.ts b/ui/src/features/agents/components/messages/summarizeChangedFiles.ts similarity index 92% rename from ui/src/components/agents/messages/summarizeChangedFiles.ts rename to ui/src/features/agents/components/messages/summarizeChangedFiles.ts index edc27845..3c7cdbad 100644 --- a/ui/src/components/agents/messages/summarizeChangedFiles.ts +++ b/ui/src/features/agents/components/messages/summarizeChangedFiles.ts @@ -1,7 +1,7 @@ -import type { Chunk } from "@/lib/agents/types"; +import type { Chunk } from "@/features/agents/lib/types"; import type { ChangedFileSummaryItem } from "./types"; -import { countLineChanges } from "@/components/agents/utils/diffStats"; +import { countLineChanges } from "@/features/agents/utils/diffStats"; export function summarizeChangedFiles(chunks: Array): Array { const byFile = new Map(); diff --git a/ui/src/components/agents/messages/types.ts b/ui/src/features/agents/components/messages/types.ts similarity index 94% rename from ui/src/components/agents/messages/types.ts rename to ui/src/features/agents/components/messages/types.ts index 8b940421..b91ea8ef 100644 --- a/ui/src/components/agents/messages/types.ts +++ b/ui/src/features/agents/components/messages/types.ts @@ -1,4 +1,4 @@ -import type { Message, Project, QueuedThreadMessage } from "@/lib/agents/types"; +import type { Message, Project, QueuedThreadMessage } from "@/features/agents/lib/types"; export interface ChangedFileSummaryItem { filePath: string; diff --git a/ui/src/components/agents/subagents/SubagentActivity.tsx b/ui/src/features/agents/components/subagents/SubagentActivity.tsx similarity index 100% rename from ui/src/components/agents/subagents/SubagentActivity.tsx rename to ui/src/features/agents/components/subagents/SubagentActivity.tsx diff --git a/ui/src/components/agents/subagents/SubagentCard.tsx b/ui/src/features/agents/components/subagents/SubagentCard.tsx similarity index 92% rename from ui/src/components/agents/subagents/SubagentCard.tsx rename to ui/src/features/agents/components/subagents/SubagentCard.tsx index 6e3a0df8..38fb8674 100644 --- a/ui/src/components/agents/subagents/SubagentCard.tsx +++ b/ui/src/features/agents/components/subagents/SubagentCard.tsx @@ -2,8 +2,8 @@ import { memo } from "react"; import { Bot, Loader2 } from "lucide-react"; import { SubagentActivity } from "./SubagentActivity"; -import type { ToolExecutionChunk } from "@/lib/agents/types"; -import { useIsInAgentThreadStream } from "@/lib/agents/provider/useIsInAgentThreadStream"; +import type { ToolExecutionChunk } from "@/features/agents/lib/types"; +import { useIsInAgentThreadStream } from "@/features/agents/lib/provider/useIsInAgentThreadStream"; /** Coerce an unknown tool-argument value to a trimmed string, or `""`. */ function asString(value: unknown): string { diff --git a/ui/src/components/agents/subagents/SubagentGroup.tsx b/ui/src/features/agents/components/subagents/SubagentGroup.tsx similarity index 91% rename from ui/src/components/agents/subagents/SubagentGroup.tsx rename to ui/src/features/agents/components/subagents/SubagentGroup.tsx index 3cc2bf7d..a2f3dedb 100644 --- a/ui/src/components/agents/subagents/SubagentGroup.tsx +++ b/ui/src/features/agents/components/subagents/SubagentGroup.tsx @@ -1,5 +1,5 @@ import { SubagentCard } from "./SubagentCard"; -import type { ToolExecutionChunk } from "@/lib/agents/types"; +import type { ToolExecutionChunk } from "@/features/agents/lib/types"; /** Maximum number of subagent cards rendered per row. */ const MAX_SUBAGENT_COLUMNS = 4; diff --git a/ui/src/components/agents/subagents/index.ts b/ui/src/features/agents/components/subagents/index.ts similarity index 100% rename from ui/src/components/agents/subagents/index.ts rename to ui/src/features/agents/components/subagents/index.ts diff --git a/ui/src/components/agents/z-index.ts b/ui/src/features/agents/components/z-index.ts similarity index 100% rename from ui/src/components/agents/z-index.ts rename to ui/src/features/agents/components/z-index.ts diff --git a/ui/src/components/agents/ported/BranchSelector.tsx b/ui/src/features/agents/experiments/BranchSelector.tsx similarity index 100% rename from ui/src/components/agents/ported/BranchSelector.tsx rename to ui/src/features/agents/experiments/BranchSelector.tsx diff --git a/ui/src/components/agents/ported/BubblePrefix.tsx b/ui/src/features/agents/experiments/BubblePrefix.tsx similarity index 89% rename from ui/src/components/agents/ported/BubblePrefix.tsx rename to ui/src/features/agents/experiments/BubblePrefix.tsx index 08b6a4ef..96fd6867 100644 --- a/ui/src/components/agents/ported/BubblePrefix.tsx +++ b/ui/src/features/agents/experiments/BubblePrefix.tsx @@ -1,4 +1,4 @@ -import type { Author } from '@/lib/agents/types'; +import type { Author } from '@/features/agents/lib/types'; interface BubblePrefixProps { author: Author; diff --git a/ui/src/components/agents/ported/ChatView.tsx b/ui/src/features/agents/experiments/ChatView.tsx similarity index 99% rename from ui/src/components/agents/ported/ChatView.tsx rename to ui/src/features/agents/experiments/ChatView.tsx index 2863a64a..3e7bc4ed 100644 --- a/ui/src/components/agents/ported/ChatView.tsx +++ b/ui/src/features/agents/experiments/ChatView.tsx @@ -1,14 +1,14 @@ import { useCallback, useRef, useEffect, useState, forwardRef } from "react"; import { useStore } from "../../store"; import { useShallow } from 'zustand/react/shallow'; -import { Messages, summarizeChangedFiles } from "@/components/agents/messages"; +import { Messages, summarizeChangedFiles } from "@/features/agents/components/messages"; import { PromptBar } from "./PromptBar"; import { TodoList } from "./TodoList"; import { Logo } from "./Logo"; import { ThreadPicker } from "./ThreadPicker"; import { CompactingIndicator } from "./CompactingIndicator"; import { executeCommand } from "../../commands"; -import type { Message, ChatMessage, ChatMessageContentBlock, ImageChunk, Thread, ToolExecutionChunk, ScheduledTask as ScheduledTaskType } from "@/lib/agents/types"; +import type { Message, ChatMessage, ChatMessageContentBlock, ImageChunk, Thread, ToolExecutionChunk, ScheduledTask as ScheduledTaskType } from "@/features/agents/lib/types"; const PROMPT_CONTENT_WIDTH = "max-w-[44rem]"; const STACKED_STATUS_WIDTH = PROMPT_CONTENT_WIDTH; diff --git a/ui/src/components/agents/ported/CompactingIndicator.tsx b/ui/src/features/agents/experiments/CompactingIndicator.tsx similarity index 100% rename from ui/src/components/agents/ported/CompactingIndicator.tsx rename to ui/src/features/agents/experiments/CompactingIndicator.tsx diff --git a/ui/src/components/agents/ported/ContextIndicator.tsx b/ui/src/features/agents/experiments/ContextIndicator.tsx similarity index 100% rename from ui/src/components/agents/ported/ContextIndicator.tsx rename to ui/src/features/agents/experiments/ContextIndicator.tsx diff --git a/ui/src/components/agents/ported/Footer.tsx b/ui/src/features/agents/experiments/Footer.tsx similarity index 100% rename from ui/src/components/agents/ported/Footer.tsx rename to ui/src/features/agents/experiments/Footer.tsx diff --git a/ui/src/components/agents/ported/HeaderBar.tsx b/ui/src/features/agents/experiments/HeaderBar.tsx similarity index 100% rename from ui/src/components/agents/ported/HeaderBar.tsx rename to ui/src/features/agents/experiments/HeaderBar.tsx diff --git a/ui/src/components/agents/ported/MarkdownTable.tsx b/ui/src/features/agents/experiments/MarkdownTable.tsx similarity index 100% rename from ui/src/components/agents/ported/MarkdownTable.tsx rename to ui/src/features/agents/experiments/MarkdownTable.tsx diff --git a/ui/src/components/agents/ported/PanelResizeHandle.tsx b/ui/src/features/agents/experiments/PanelResizeHandle.tsx similarity index 100% rename from ui/src/components/agents/ported/PanelResizeHandle.tsx rename to ui/src/features/agents/experiments/PanelResizeHandle.tsx diff --git a/ui/src/components/agents/ported/PromptBar.tsx b/ui/src/features/agents/experiments/PromptBar.tsx similarity index 99% rename from ui/src/components/agents/ported/PromptBar.tsx rename to ui/src/features/agents/experiments/PromptBar.tsx index 027d3235..4f1ad748 100644 --- a/ui/src/components/agents/ported/PromptBar.tsx +++ b/ui/src/features/agents/experiments/PromptBar.tsx @@ -13,7 +13,7 @@ import { getModelsForHarness, MODEL_DISPLAY_NAMES, type ModelOption } from '../. import { ContextIndicator } from './ContextIndicator'; import { WorktreeSelector } from './WorktreeSelector'; import type { Command } from '../../commands'; -import type { ApprovalDecision, DiffData, ImageChunk, ModelConfig, PermissionMode, WorktreeType, AcpToolKind } from '@/lib/agents/types'; +import type { ApprovalDecision, DiffData, ImageChunk, ModelConfig, PermissionMode, WorktreeType, AcpToolKind } from '@/features/agents/lib/types'; const PERMISSION_OPTIONS: Array<{ value: PermissionMode; label: string }> = [ { value: 'default', label: 'Default permissions' }, diff --git a/ui/src/components/agents/ported/SourceControlPanel.tsx b/ui/src/features/agents/experiments/SourceControlPanel.tsx similarity index 100% rename from ui/src/components/agents/ported/SourceControlPanel.tsx rename to ui/src/features/agents/experiments/SourceControlPanel.tsx diff --git a/ui/src/components/agents/ported/SourceControlTile.tsx b/ui/src/features/agents/experiments/SourceControlTile.tsx similarity index 99% rename from ui/src/components/agents/ported/SourceControlTile.tsx rename to ui/src/features/agents/experiments/SourceControlTile.tsx index c3ad5ec9..69a16fc6 100644 --- a/ui/src/components/agents/ported/SourceControlTile.tsx +++ b/ui/src/features/agents/experiments/SourceControlTile.tsx @@ -3,8 +3,8 @@ import { useState, useCallback, useRef, memo, useMemo, useEffect } from "react"; import { MultiFileDiff } from "@pierre/diffs/react"; import type { FileContents } from "@pierre/diffs/react"; -import type { GitStatusEntry, GitFileStatus } from "@/lib/agents/types"; -import { countLineChanges } from "@/components/agents/utils/diffStats"; +import type { GitStatusEntry, GitFileStatus } from "@/features/agents/lib/types"; +import { countLineChanges } from "@/features/agents/utils/diffStats"; import { ChevronDown, ChevronRight, @@ -23,7 +23,7 @@ import { X, Undo2, } from "lucide-react"; -import { useDiffOptions } from "@/components/agents/utils/diffUtils"; +import { useDiffOptions } from "@/features/agents/utils/diffUtils"; const STATUS_LABELS: Partial> = { "index-modified": "M", diff --git a/ui/src/components/agents/ported/ThreadPicker.tsx b/ui/src/features/agents/experiments/ThreadPicker.tsx similarity index 99% rename from ui/src/components/agents/ported/ThreadPicker.tsx rename to ui/src/features/agents/experiments/ThreadPicker.tsx index 7231ab4e..3089574d 100644 --- a/ui/src/components/agents/ported/ThreadPicker.tsx +++ b/ui/src/features/agents/experiments/ThreadPicker.tsx @@ -1,6 +1,6 @@ import { MessageSquare } from 'lucide-react'; import { useState, useEffect, useRef, useCallback, useMemo } from 'react'; -import type { Thread } from '@/lib/agents/types'; +import type { Thread } from '@/features/agents/lib/types'; import { useStore } from '../../store'; function getTimeGroup(timestamp: number): string { diff --git a/ui/src/components/agents/ported/TodoList.tsx b/ui/src/features/agents/experiments/TodoList.tsx similarity index 98% rename from ui/src/components/agents/ported/TodoList.tsx rename to ui/src/features/agents/experiments/TodoList.tsx index 2d003bee..89e0e7df 100644 --- a/ui/src/components/agents/ported/TodoList.tsx +++ b/ui/src/features/agents/experiments/TodoList.tsx @@ -7,7 +7,7 @@ import { ListChecks, Loader2, } from "lucide-react"; -import type { TodoItem } from "@/lib/agents/types"; +import type { TodoItem } from "@/features/agents/lib/types"; interface TodoListProps { todos: Array; diff --git a/ui/src/features/agents/experiments/index.ts b/ui/src/features/agents/experiments/index.ts new file mode 100644 index 00000000..2f28ec6d --- /dev/null +++ b/ui/src/features/agents/experiments/index.ts @@ -0,0 +1,18 @@ +export { BubblePrefix } from "./BubblePrefix"; +export { CloudPromptBar } from "../components/chat/CloudPromptBar"; +export { CodeBlock } from "../components/chat/CodeBlock"; +export { CompactingIndicator } from "./CompactingIndicator"; +export { DiffView } from "../components/chat/DiffView"; +export { HeaderBar } from "./HeaderBar"; +export { Logo } from "../components/chat/Logo"; +export { Markdown } from "../components/chat/Markdown"; +export { MarkdownTable } from "./MarkdownTable"; +export { + Messages, + summarizeChangedFiles, + type MessagesScrollControl, +} from "../components/messages"; +export { PanelResizeHandle } from "./PanelResizeHandle"; +export { ShellCommand } from "../components/chat/ShellCommand"; +export { TodoList } from "./TodoList"; +export { ToolExecution } from "../components/chat/ToolExecution"; diff --git a/ui/src/lib/agents/AgentThreadStreamProvider.tsx b/ui/src/features/agents/lib/AgentThreadStreamProvider.tsx similarity index 100% rename from ui/src/lib/agents/AgentThreadStreamProvider.tsx rename to ui/src/features/agents/lib/AgentThreadStreamProvider.tsx diff --git a/ui/src/lib/agents/api.ts b/ui/src/features/agents/lib/api.ts similarity index 100% rename from ui/src/lib/agents/api.ts rename to ui/src/features/agents/lib/api.ts diff --git a/ui/src/lib/agents/messageTimestamps.ts b/ui/src/features/agents/lib/messageTimestamps.ts similarity index 100% rename from ui/src/lib/agents/messageTimestamps.ts rename to ui/src/features/agents/lib/messageTimestamps.ts diff --git a/ui/src/lib/agents/provider/useIsInAgentThreadStream.tsx b/ui/src/features/agents/lib/provider/useIsInAgentThreadStream.tsx similarity index 100% rename from ui/src/lib/agents/provider/useIsInAgentThreadStream.tsx rename to ui/src/features/agents/lib/provider/useIsInAgentThreadStream.tsx diff --git a/ui/src/lib/agents/provider/useLiveMarkdownMessageId.ts b/ui/src/features/agents/lib/provider/useLiveMarkdownMessageId.ts similarity index 96% rename from ui/src/lib/agents/provider/useLiveMarkdownMessageId.ts rename to ui/src/features/agents/lib/provider/useLiveMarkdownMessageId.ts index 42ddbfcd..25fa6e31 100644 --- a/ui/src/lib/agents/provider/useLiveMarkdownMessageId.ts +++ b/ui/src/features/agents/lib/provider/useLiveMarkdownMessageId.ts @@ -1,6 +1,6 @@ import { useEffect, useRef, useState } from "react"; -import type { Message } from "@/lib/agents/types"; +import type { Message } from "@/features/agents/lib/types"; /** How long run-idle must persist before clearing the live markdown target. */ const LIVE_MARKDOWN_CLEAR_MS = 2000; diff --git a/ui/src/lib/agents/provider/useModelOptions.ts b/ui/src/features/agents/lib/provider/useModelOptions.ts similarity index 100% rename from ui/src/lib/agents/provider/useModelOptions.ts rename to ui/src/features/agents/lib/provider/useModelOptions.ts diff --git a/ui/src/lib/agents/provider/useSubmitAgentMessage.ts b/ui/src/features/agents/lib/provider/useSubmitAgentMessage.ts similarity index 95% rename from ui/src/lib/agents/provider/useSubmitAgentMessage.ts rename to ui/src/features/agents/lib/provider/useSubmitAgentMessage.ts index 11ff403d..72fe96ba 100644 --- a/ui/src/lib/agents/provider/useSubmitAgentMessage.ts +++ b/ui/src/features/agents/lib/provider/useSubmitAgentMessage.ts @@ -1,13 +1,13 @@ import { useMutation, useQueryClient } from "@tanstack/react-query" import { useStreamContext as useAgentThreadStream } from "@langchain/react" -import type { SendAgentMessageVariables } from "@/lib/agents/queries" -import type { AgentThread } from "@/lib/agents/types" -import { AgentsApiError, agentsApi } from "@/lib/agents/api" +import type { SendAgentMessageVariables } from "@/features/agents/lib/queries" +import type { AgentThread } from "@/features/agents/lib/types" +import { AgentsApiError, agentsApi } from "@/features/agents/lib/api" import { agentThreadKeys, invalidateAgentThreadLists, -} from "@/lib/agents/queries" +} from "@/features/agents/lib/queries" /** * Construct the message content for the LangGraph run. diff --git a/ui/src/lib/agents/queries.ts b/ui/src/features/agents/lib/queries.ts similarity index 100% rename from ui/src/lib/agents/queries.ts rename to ui/src/features/agents/lib/queries.ts diff --git a/ui/src/lib/agents/sidebarFilter.test.ts b/ui/src/features/agents/lib/sidebarFilter.test.ts similarity index 100% rename from ui/src/lib/agents/sidebarFilter.test.ts rename to ui/src/features/agents/lib/sidebarFilter.test.ts diff --git a/ui/src/lib/agents/sidebarFilter.ts b/ui/src/features/agents/lib/sidebarFilter.ts similarity index 100% rename from ui/src/lib/agents/sidebarFilter.ts rename to ui/src/features/agents/lib/sidebarFilter.ts diff --git a/ui/src/lib/agents/sidebarPrefs.ts b/ui/src/features/agents/lib/sidebarPrefs.ts similarity index 100% rename from ui/src/lib/agents/sidebarPrefs.ts rename to ui/src/features/agents/lib/sidebarPrefs.ts diff --git a/ui/src/lib/agents/streamMessagesToUi.ts b/ui/src/features/agents/lib/streamMessagesToUi.ts similarity index 100% rename from ui/src/lib/agents/streamMessagesToUi.ts rename to ui/src/features/agents/lib/streamMessagesToUi.ts diff --git a/ui/src/lib/agents/types.ts b/ui/src/features/agents/lib/types.ts similarity index 100% rename from ui/src/lib/agents/types.ts rename to ui/src/features/agents/lib/types.ts diff --git a/ui/src/lib/agents/useRunCompletionNotifier.ts b/ui/src/features/agents/lib/useRunCompletionNotifier.ts similarity index 95% rename from ui/src/lib/agents/useRunCompletionNotifier.ts rename to ui/src/features/agents/lib/useRunCompletionNotifier.ts index fcf09653..36d74833 100644 --- a/ui/src/lib/agents/useRunCompletionNotifier.ts +++ b/ui/src/features/agents/lib/useRunCompletionNotifier.ts @@ -1,6 +1,6 @@ import { useEffect, useRef } from "react" -import type { AgentThread } from "@/lib/agents/types" +import type { AgentThread } from "@/features/agents/lib/types" import { showRunNotification } from "@/lib/notifications" const TERMINAL_STATUSES = new Set(["finished", "error", "interrupted"]) diff --git a/ui/src/components/agents/utils/diffStats.ts b/ui/src/features/agents/utils/diffStats.ts similarity index 100% rename from ui/src/components/agents/utils/diffStats.ts rename to ui/src/features/agents/utils/diffStats.ts diff --git a/ui/src/components/agents/utils/diffUtils.test.ts b/ui/src/features/agents/utils/diffUtils.test.ts similarity index 100% rename from ui/src/components/agents/utils/diffUtils.test.ts rename to ui/src/features/agents/utils/diffUtils.test.ts diff --git a/ui/src/components/agents/utils/diffUtils.ts b/ui/src/features/agents/utils/diffUtils.ts similarity index 100% rename from ui/src/components/agents/utils/diffUtils.ts rename to ui/src/features/agents/utils/diffUtils.ts diff --git a/ui/src/components/agents/AutomationEditor.tsx b/ui/src/features/automations/components/AutomationEditor.tsx similarity index 95% rename from ui/src/components/agents/AutomationEditor.tsx rename to ui/src/features/automations/components/AutomationEditor.tsx index 31d6c68b..4bc4dbbf 100644 --- a/ui/src/components/agents/AutomationEditor.tsx +++ b/ui/src/features/automations/components/AutomationEditor.tsx @@ -8,23 +8,23 @@ import { } from "@phosphor-icons/react" import type { ModelOption } from "@/lib/api" -import type { AgentSchedule } from "@/lib/agents/types" -import type { AutomationTemplate } from "@/lib/agents/automation-templates" -import type { ModelSelection } from "@/lib/agents/provider/useModelOptions" -import { RepoSelector } from "@/components/agents/RepoSelector" -import { ScheduleTriggerPicker } from "@/components/agents/ScheduleTriggerPicker" +import type { AgentSchedule } from "@/features/agents/lib/types" +import type { AutomationTemplate } from "@/features/automations/lib/automation-templates" +import type { ModelSelection } from "@/features/agents/lib/provider/useModelOptions" +import { RepoSelector } from "@/features/settings/components/RepoSelector" +import { ScheduleTriggerPicker } from "@/features/automations/components/ScheduleTriggerPicker" import { Button } from "@/components/ui/button" import { Switch } from "@/components/ui/switch" -import { describeCron, isDescribableCron } from "@/lib/agents/cron" +import { describeCron, isDescribableCron } from "@/features/automations/lib/cron" import { useCreateAgentSchedule, useDeleteAgentSchedule, useUpdateAgentSchedule, -} from "@/lib/agents/queries" +} from "@/features/agents/lib/queries" import { formatModelSelection, useModelOptions, -} from "@/lib/agents/provider/useModelOptions" +} from "@/features/agents/lib/provider/useModelOptions" import { useRepos } from "@/lib/profile" import { cn } from "@/lib/utils" diff --git a/ui/src/components/agents/AutomationTemplates.tsx b/ui/src/features/automations/components/AutomationTemplates.tsx similarity index 91% rename from ui/src/components/agents/AutomationTemplates.tsx rename to ui/src/features/automations/components/AutomationTemplates.tsx index e1c52f47..93c44484 100644 --- a/ui/src/components/agents/AutomationTemplates.tsx +++ b/ui/src/features/automations/components/AutomationTemplates.tsx @@ -1,8 +1,8 @@ import { Link } from "@tanstack/react-router" import { ClockIcon } from "@phosphor-icons/react" -import { AUTOMATION_TEMPLATES } from "@/lib/agents/automation-templates" -import { describeCron } from "@/lib/agents/cron" +import { AUTOMATION_TEMPLATES } from "@/features/automations/lib/automation-templates" +import { describeCron } from "@/features/automations/lib/cron" export function AutomationTemplates() { return ( diff --git a/ui/src/components/agents/AutomationsList.tsx b/ui/src/features/automations/components/AutomationsList.tsx similarity index 96% rename from ui/src/components/agents/AutomationsList.tsx rename to ui/src/features/automations/components/AutomationsList.tsx index 0a8bd99f..05fa56df 100644 --- a/ui/src/components/agents/AutomationsList.tsx +++ b/ui/src/features/automations/components/AutomationsList.tsx @@ -8,15 +8,15 @@ import { WarningCircleIcon, } from "@phosphor-icons/react" -import type { AgentSchedule } from "@/lib/agents/types" -import { AutomationTemplates } from "@/components/agents/AutomationTemplates" +import type { AgentSchedule } from "@/features/agents/lib/types" +import { AutomationTemplates } from "@/features/automations/components/AutomationTemplates" import { buttonVariants } from "@/components/ui/button" import { Skeleton } from "@/components/ui/skeleton" -import { describeCron } from "@/lib/agents/cron" +import { describeCron } from "@/features/automations/lib/cron" import { useAgentSchedules, useUpdateAgentSchedule, -} from "@/lib/agents/queries" +} from "@/features/agents/lib/queries" import { cn } from "@/lib/utils" function formatDate(value?: string | null): string { diff --git a/ui/src/components/agents/ScheduleTriggerPicker.tsx b/ui/src/features/automations/components/ScheduleTriggerPicker.tsx similarity index 97% rename from ui/src/components/agents/ScheduleTriggerPicker.tsx rename to ui/src/features/automations/components/ScheduleTriggerPicker.tsx index d96519df..4a56d2e9 100644 --- a/ui/src/components/agents/ScheduleTriggerPicker.tsx +++ b/ui/src/features/automations/components/ScheduleTriggerPicker.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from "react" import { CaretRightIcon, ClockIcon, PlusIcon } from "@phosphor-icons/react" -import { CRON_PRESETS } from "@/lib/agents/cron" +import { CRON_PRESETS } from "@/features/automations/lib/cron" import { cn } from "@/lib/utils" interface ScheduleTriggerPickerProps { diff --git a/ui/src/lib/agents/automation-templates.ts b/ui/src/features/automations/lib/automation-templates.ts similarity index 100% rename from ui/src/lib/agents/automation-templates.ts rename to ui/src/features/automations/lib/automation-templates.ts diff --git a/ui/src/lib/agents/cron.ts b/ui/src/features/automations/lib/cron.ts similarity index 100% rename from ui/src/lib/agents/cron.ts rename to ui/src/features/automations/lib/cron.ts diff --git a/ui/src/components/agents/PrHeader.tsx b/ui/src/features/reviews/components/PrHeader.tsx similarity index 100% rename from ui/src/components/agents/PrHeader.tsx rename to ui/src/features/reviews/components/PrHeader.tsx diff --git a/ui/src/components/agents/ReviewChat.tsx b/ui/src/features/reviews/components/ReviewChat.tsx similarity index 99% rename from ui/src/components/agents/ReviewChat.tsx rename to ui/src/features/reviews/components/ReviewChat.tsx index 2be23f2c..b771af70 100644 --- a/ui/src/components/agents/ReviewChat.tsx +++ b/ui/src/features/reviews/components/ReviewChat.tsx @@ -25,7 +25,7 @@ import { Menu } from "@base-ui/react/menu" import type { BaseMessage } from "@langchain/core/messages" import type { ReviewChatThread } from "@/lib/api" -import { Markdown } from "@/components/agents/ported" +import { Markdown } from "@/features/agents/experiments" import { IconButton } from "@/components/ui/button" import { Textarea } from "@/components/ui/textarea" import { Skeleton } from "@/components/ui/skeleton" diff --git a/ui/src/components/agents/ReviewCommentsMenu.tsx b/ui/src/features/reviews/components/ReviewCommentsMenu.tsx similarity index 100% rename from ui/src/components/agents/ReviewCommentsMenu.tsx rename to ui/src/features/reviews/components/ReviewCommentsMenu.tsx diff --git a/ui/src/components/agents/ReviewMainBody.tsx b/ui/src/features/reviews/components/ReviewMainBody.tsx similarity index 99% rename from ui/src/components/agents/ReviewMainBody.tsx rename to ui/src/features/reviews/components/ReviewMainBody.tsx index a6fa2f12..9322a334 100644 --- a/ui/src/components/agents/ReviewMainBody.tsx +++ b/ui/src/features/reviews/components/ReviewMainBody.tsx @@ -64,20 +64,20 @@ import type { import type { ReviewSidebarGroup, ReviewSidebarView, -} from "@/components/agents/ReviewSidebar" -import type { ChatAttachment } from "@/components/agents/ReviewChat" -import type { DiffStyle } from "@/components/agents/utils/diffUtils" -import { Markdown } from "@/components/agents/ported" -import { PrHeader } from "@/components/agents/PrHeader" +} from "@/features/reviews/components/ReviewSidebar" +import type { ChatAttachment } from "@/features/reviews/components/ReviewChat" +import type { DiffStyle } from "@/features/agents/utils/diffUtils" +import { Markdown } from "@/features/agents/experiments" +import { PrHeader } from "@/features/reviews/components/PrHeader" import { ReviewChat, ReviewChatComposerProvider, useReviewChatComposer, -} from "@/components/agents/ReviewChat" +} from "@/features/reviews/components/ReviewChat" import { ReviewSidebarPanel, renderInlineCode, -} from "@/components/agents/ReviewSidebar" +} from "@/features/reviews/components/ReviewSidebar" import { DIFF_VIRTUALIZER_CONFIG, DIFF_VIRTUAL_METRICS, @@ -86,7 +86,7 @@ import { fileContentsCacheKey, useDiffOptions, warmDiffHighlighter, -} from "@/components/agents/utils/diffUtils" +} from "@/features/agents/utils/diffUtils" import { IconButton } from "@/components/ui/button" import { Skeleton } from "@/components/ui/skeleton" import { Textarea } from "@/components/ui/textarea" diff --git a/ui/src/components/agents/ReviewSidebar.tsx b/ui/src/features/reviews/components/ReviewSidebar.tsx similarity index 99% rename from ui/src/components/agents/ReviewSidebar.tsx rename to ui/src/features/reviews/components/ReviewSidebar.tsx index 08397e75..9231080d 100644 --- a/ui/src/components/agents/ReviewSidebar.tsx +++ b/ui/src/features/reviews/components/ReviewSidebar.tsx @@ -17,7 +17,7 @@ import { Skeleton } from "@/components/ui/skeleton" import { TREE_UNSAFE_CSS, treeThemeStyle, -} from "@/components/agents/AgentGitPanel" +} from "@/features/agents/components/AgentGitPanel" import { cn } from "@/lib/utils" function reviewFileGitStatus(status: ReviewDiffFile["status"]): GitStatus { diff --git a/ui/src/components/agents/ReviewTab.tsx b/ui/src/features/reviews/components/ReviewTab.tsx similarity index 93% rename from ui/src/components/agents/ReviewTab.tsx rename to ui/src/features/reviews/components/ReviewTab.tsx index bae0679c..51add44a 100644 --- a/ui/src/components/agents/ReviewTab.tsx +++ b/ui/src/features/reviews/components/ReviewTab.tsx @@ -1,8 +1,8 @@ import { useNavigate } from "@tanstack/react-router" import { useQuery } from "@tanstack/react-query" -import type { AgentThread } from "@/lib/agents/types" -import { ReviewMainBody } from "@/components/agents/ReviewMainBody" +import type { AgentThread } from "@/features/agents/lib/types" +import { ReviewMainBody } from "@/features/reviews/components/ReviewMainBody" import { api } from "@/lib/api" // The git panel's "Review" sub-tab: the PR's Open SWE review rendered inline (no diff --git a/ui/src/components/agents/RepoSelector.tsx b/ui/src/features/settings/components/RepoSelector.tsx similarity index 100% rename from ui/src/components/agents/RepoSelector.tsx rename to ui/src/features/settings/components/RepoSelector.tsx diff --git a/ui/src/lib/notifications.ts b/ui/src/lib/notifications.ts index 20edaaae..210eaf16 100644 --- a/ui/src/lib/notifications.ts +++ b/ui/src/lib/notifications.ts @@ -1,4 +1,4 @@ -import type { AgentThread } from "./agents/types" +import type { AgentThread } from "@/features/agents/lib/types" export const NOTIFICATIONS_PREF_KEY = "open-swe-notifications-enabled" diff --git a/ui/src/routes/admin.tsx b/ui/src/routes/admin.tsx index caf03c3c..0b92b43a 100644 --- a/ui/src/routes/admin.tsx +++ b/ui/src/routes/admin.tsx @@ -27,7 +27,7 @@ import { api } from "@/lib/api" import { useAdminCancelAgentThread, useThreadsPage, -} from "@/lib/agents/queries" +} from "@/features/agents/lib/queries" import { RequireLogin } from "@/lib/auth-redirect" import { useSession } from "@/lib/session" diff --git a/ui/src/routes/agents.tsx b/ui/src/routes/agents.tsx index 1a19a924..d2801b12 100644 --- a/ui/src/routes/agents.tsx +++ b/ui/src/routes/agents.tsx @@ -1,9 +1,9 @@ import { Outlet, createFileRoute, useRouterState } from "@tanstack/react-router" -import { AgentsShell } from "@/components/agents/AgentsSidebar" +import { AgentsShell } from "@/features/agents/components/AgentsSidebar" import { Skeleton } from "@/components/ui/skeleton" import agentsCss from "@/styles/agents.css?url" -import { AgentThreadStreamProvider } from "@/lib/agents/AgentThreadStreamProvider" +import { AgentThreadStreamProvider } from "@/features/agents/lib/AgentThreadStreamProvider" import { RequireLogin } from "@/lib/auth-redirect" import { useSession } from "@/lib/session" diff --git a/ui/src/routes/agents/$threadId.tsx b/ui/src/routes/agents/$threadId.tsx index 8cd7d3ed..c10b273e 100644 --- a/ui/src/routes/agents/$threadId.tsx +++ b/ui/src/routes/agents/$threadId.tsx @@ -1,9 +1,9 @@ import { Navigate, createFileRoute } from "@tanstack/react-router" -import { AgentThreadView } from "@/components/agents/AgentThreadView" +import { AgentThreadView } from "@/features/agents/components/AgentThreadView" import { Skeleton } from "@/components/ui/skeleton" -import { AgentThreadStreamBoundary } from "@/lib/agents/provider/useIsInAgentThreadStream" -import { useAgentThread } from "@/lib/agents/queries" +import { AgentThreadStreamBoundary } from "@/features/agents/lib/provider/useIsInAgentThreadStream" +import { useAgentThread } from "@/features/agents/lib/queries" export const Route = createFileRoute("/agents/$threadId")({ component: AgentThreadPage, diff --git a/ui/src/routes/agents/$threadId_.plan.tsx b/ui/src/routes/agents/$threadId_.plan.tsx index 3b408059..08b33cac 100644 --- a/ui/src/routes/agents/$threadId_.plan.tsx +++ b/ui/src/routes/agents/$threadId_.plan.tsx @@ -3,7 +3,7 @@ import { useQuery } from "@tanstack/react-query" import { useEffect, useState } from "react" import { ArrowLeft } from "lucide-react" -import { PlanReview } from "@/components/agents/PlanReview" +import { PlanReview } from "@/features/agents/components/PlanReview" import { buttonVariants } from "@/components/ui/button" import { Skeleton } from "@/components/ui/skeleton" import { loginUrl } from "@/lib/api" diff --git a/ui/src/routes/agents/automations/$scheduleId.tsx b/ui/src/routes/agents/automations/$scheduleId.tsx index f8f24335..0dfdda0d 100644 --- a/ui/src/routes/agents/automations/$scheduleId.tsx +++ b/ui/src/routes/agents/automations/$scheduleId.tsx @@ -1,8 +1,8 @@ import { Link, createFileRoute } from "@tanstack/react-router" -import { AutomationEditor } from "@/components/agents/AutomationEditor" +import { AutomationEditor } from "@/features/automations/components/AutomationEditor" import { Skeleton } from "@/components/ui/skeleton" -import { useAgentSchedules } from "@/lib/agents/queries" +import { useAgentSchedules } from "@/features/agents/lib/queries" export const Route = createFileRoute("/agents/automations/$scheduleId")({ component: EditAutomationPage, diff --git a/ui/src/routes/agents/automations/index.tsx b/ui/src/routes/agents/automations/index.tsx index 1a7ae507..a6a0a65f 100644 --- a/ui/src/routes/agents/automations/index.tsx +++ b/ui/src/routes/agents/automations/index.tsx @@ -1,6 +1,6 @@ import { createFileRoute } from "@tanstack/react-router" -import { AutomationsList } from "@/components/agents/AutomationsList" +import { AutomationsList } from "@/features/automations/components/AutomationsList" export const Route = createFileRoute("/agents/automations/")({ component: AutomationsIndexPage, diff --git a/ui/src/routes/agents/automations/new.tsx b/ui/src/routes/agents/automations/new.tsx index 6c850f22..2a78ecc1 100644 --- a/ui/src/routes/agents/automations/new.tsx +++ b/ui/src/routes/agents/automations/new.tsx @@ -1,7 +1,7 @@ import { createFileRoute } from "@tanstack/react-router" -import { AutomationEditor } from "@/components/agents/AutomationEditor" -import { automationTemplateById } from "@/lib/agents/automation-templates" +import { AutomationEditor } from "@/features/automations/components/AutomationEditor" +import { automationTemplateById } from "@/features/automations/lib/automation-templates" interface NewAutomationSearch { template?: string diff --git a/ui/src/routes/agents/index.tsx b/ui/src/routes/agents/index.tsx index ebe18c66..61a05e34 100644 --- a/ui/src/routes/agents/index.tsx +++ b/ui/src/routes/agents/index.tsx @@ -1,6 +1,6 @@ import { createFileRoute } from "@tanstack/react-router" -import { AgentsHome } from "@/components/agents/AgentsHome" +import { AgentsHome } from "@/features/agents/components/AgentsHome" export const Route = createFileRoute("/agents/")({ component: AgentsIndexPage, diff --git a/ui/src/routes/agents/reviews/$owner.$repo.$number.tsx b/ui/src/routes/agents/reviews/$owner.$repo.$number.tsx index f2b424fc..56d4e869 100644 --- a/ui/src/routes/agents/reviews/$owner.$repo.$number.tsx +++ b/ui/src/routes/agents/reviews/$owner.$repo.$number.tsx @@ -4,8 +4,8 @@ import { useCallback, useEffect, useRef, useState } from "react" import { ArrowLeftIcon, GitPullRequestIcon } from "@phosphor-icons/react" import type { PrReviewComment } from "@/lib/api" -import { ReviewCommentsMenu } from "@/components/agents/ReviewCommentsMenu" -import { ReviewMainBody } from "@/components/agents/ReviewMainBody" +import { ReviewCommentsMenu } from "@/features/reviews/components/ReviewCommentsMenu" +import { ReviewMainBody } from "@/features/reviews/components/ReviewMainBody" import { useSidebarControls } from "@/components/sidebar-layout" import { Skeleton } from "@/components/ui/skeleton" import { api } from "@/lib/api" diff --git a/ui/src/routes/agents/threads.tsx b/ui/src/routes/agents/threads.tsx index 06f1fc23..545f67ec 100644 --- a/ui/src/routes/agents/threads.tsx +++ b/ui/src/routes/agents/threads.tsx @@ -1,8 +1,8 @@ import { createFileRoute } from "@tanstack/react-router" -import type { AgentSource, AgentStatus } from "@/lib/agents/types" -import type { ThreadsPageFilters } from "@/components/agents/AgentsThreadsPage"; -import { AgentsThreadsPage } from "@/components/agents/AgentsThreadsPage" +import type { AgentSource, AgentStatus } from "@/features/agents/lib/types" +import type { ThreadsPageFilters } from "@/features/agents/components/AgentsThreadsPage"; +import { AgentsThreadsPage } from "@/features/agents/components/AgentsThreadsPage" const SOURCES: ReadonlyArray = [ "dashboard", diff --git a/ui/src/routes/cloud-agents.tsx b/ui/src/routes/cloud-agents.tsx index 0f570522..8a77f632 100644 --- a/ui/src/routes/cloud-agents.tsx +++ b/ui/src/routes/cloud-agents.tsx @@ -5,7 +5,7 @@ import { useEffect, useRef, useState } from "react" import type { ModelOption } from "@/lib/api" import { AppShell, SettingsRow, SettingsSection } from "@/components/AppShell" import { Button } from "@/components/ui/button" -import { RepoSelector } from "@/components/agents/RepoSelector" +import { RepoSelector } from "@/features/settings/components/RepoSelector" import { Input } from "@/components/ui/input" import { Select, diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 029d26cb..8c23e025 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -2,15 +2,8 @@ "include": ["**/*.ts", "**/*.tsx", "eslint.config.js", "prettier.config.js", "vite.config.js"], "exclude": [ // Ported from a desktop host app; not typechecked until integrated (see file headers). - "src/components/agents/ported/ChatView.tsx", - "src/components/agents/ported/PromptBar.tsx", - "src/components/agents/ported/BranchSelector.tsx", - "src/components/agents/ported/ContextIndicator.tsx", - "src/components/agents/ported/SourceControlPanel.tsx", // Depends on host-provided window.git; live dashboard uses AgentGitPanel instead. - "src/components/agents/ported/SourceControlTile.tsx", - "src/components/agents/ported/Footer.tsx", - "src/components/agents/ported/ThreadPicker.tsx" + "src/features/agents/experiments/**" ], "compilerOptions": {