Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
feat(settings): add Agents sections (agents, custom, notifications, commit)
enescd771cb0f9e6
diff --git a/src/renderer/components/settings/sections/AgentsSection.tsx b/src/renderer/components/settings/sections/AgentsSection.tsxnew file mode 100644index 000000000..633d4ce42--- /dev/null+++ b/src/renderer/components/settings/sections/AgentsSection.tsx@@ -0,0 +1,71 @@+import { useSettings } from '../../../state/settings'+import {+ isAgentEnabled,+ setAgentEnabled,+ setDefaultAgent+} from '../../../state/agentAvailability'+import { AGENT_CONFIG, BUILTIN_AGENT_IDS, type AgentId } from '@shared/agents/config'+import { AgentIcon } from '../../../lib/agentIcons'+import { SegmentedPill } from '@renderer/ui/SegmentedPill'+import { Button } from '@renderer/ui/Button'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'++const ROWS = {+ agents: {+ title: 'Agents',+ keywords: ['agent', 'claude', 'codex', 'gemini', 'enable', 'disable', 'default']+ }+}+const ENTRIES = Object.values(ROWS)++export function AgentsSection({ isActive }: { isActive: boolean }): React.JSX.Element {+ const settings = useSettings((s) => s.settings)+ const update = useSettings((s) => s.update)+ const rows: { id: AgentId; label: string; isBuiltin: boolean }[] = [+ ...BUILTIN_AGENT_IDS.map((id) => ({ id, label: AGENT_CONFIG[id].label, isBuiltin: true })),+ ...settings.customAgents.map((c) => ({ id: c.id, label: c.label || c.id, isBuiltin: false }))+ ]+ return (+ <SettingsSection+ id="agents"+ title="Agents"+ description="Enable or disable agents in the Add menus, and pick the default (⌘⇧C)."+ isActive={isActive}+ searchEntries={ENTRIES}+ >+ <SearchableRow {...ROWS.agents}>+ <div className="space-y-2">+ {rows.map((row) => {+ const enabled = isAgentEnabled(settings, row.id)+ const isDefault = settings.defaultAgent === row.id+ return (+ <div key={row.id} className="flex items-center gap-3 py-1.5">+ <AgentIcon agentId={row.id} size={18} />+ <span className="flex-1 text-[13px] text-text">{row.label}</span>+ {row.isBuiltin && (+ <Button+ variant={isDefault ? 'primary' : 'default'}+ aria-pressed={isDefault}+ onClick={() => update(setDefaultAgent(settings, row.id))}+ >+ {isDefault ? 'Default' : 'Set default'}+ </Button>+ )}+ <SegmentedPill<'enabled' | 'disabled'>+ value={enabled ? 'enabled' : 'disabled'}+ ariaLabel={`${row.label} availability`}+ options={[+ { value: 'enabled', label: 'Enabled' },+ { value: 'disabled', label: 'Disabled' }+ ]}+ onChange={(v) => update(setAgentEnabled(settings, row.id, v === 'enabled'))}+ />+ </div>+ )+ })}+ </div>+ </SearchableRow>+ </SettingsSection>+ )+}diff --git a/src/renderer/components/settings/sections/CommitSection.tsx b/src/renderer/components/settings/sections/CommitSection.tsxnew file mode 100644index 000000000..45902d228--- /dev/null+++ b/src/renderer/components/settings/sections/CommitSection.tsx@@ -0,0 +1,74 @@+import { useSettings } from '../../../state/settings'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Select } from '@renderer/ui/Select'+import { Input } from '@renderer/ui/Input'++const ROWS = {+ agent: {+ title: 'Commit agent',+ keywords: ['commit', 'message', 'ai', 'claude', 'codex', 'generate']+ },+ command: { title: 'Custom command', keywords: ['commit', 'custom', 'command'] },+ extra: { title: 'Extra prompt', keywords: ['commit', 'prompt', 'conventional', 'gitmoji'] }+}+const ENTRIES = Object.values(ROWS)++export function CommitSection({ isActive }: { isActive: boolean }): React.JSX.Element {+ const settings = useSettings((s) => s.settings)+ const update = useSettings((s) => s.update)+ return (+ <SettingsSection+ id="commit"+ title="Commit messages (AI)"+ description="Runs a local coding-agent CLI read-only on your staged diff (no built-in model)."+ isActive={isActive}+ searchEntries={ENTRIES}+ >+ <SearchableRow {...ROWS.agent}>+ <FieldRow+ label="Agent"+ control={+ <Select+ value={settings.commitAgent}+ onChange={(e) =>+ update({ commitAgent: e.target.value as 'claude' | 'codex' | 'custom' })+ }+ >+ <option value="claude">Claude Code</option>+ <option value="codex">Codex</option>+ <option value="custom">Custom command…</option>+ </Select>+ }+ />+ </SearchableRow>+ {settings.commitAgent === 'custom' && (+ <SearchableRow {...ROWS.command}>+ <FieldRow+ label="Command"+ control={+ <Input+ className="w-72"+ placeholder="mycli --flag {prompt}"+ value={settings.commitAgentCommand}+ onChange={(e) => update({ commitAgentCommand: e.target.value })}+ />+ }+ />+ </SearchableRow>+ )}+ <SearchableRow {...ROWS.extra}>+ <div className="py-2.5">+ <label className="block text-[13px] text-text">Extra prompt (optional)</label>+ <textarea+ value={settings.commitExtraPrompt}+ placeholder="e.g. Use Conventional Commits with gitmoji"+ onChange={(e) => update({ commitExtraPrompt: e.target.value })}+ className="mt-2 min-h-20 w-full rounded-md border border-border bg-bg px-2.5 py-2 text-[13px] text-text outline-none focus:border-accent"+ />+ </div>+ </SearchableRow>+ </SettingsSection>+ )+}diff --git a/src/renderer/components/settings/sections/CustomAgentsSection.tsx b/src/renderer/components/settings/sections/CustomAgentsSection.tsxnew file mode 100644index 000000000..1a97a5a62--- /dev/null+++ b/src/renderer/components/settings/sections/CustomAgentsSection.tsx@@ -0,0 +1,94 @@+import { useSettings } from '../../../state/settings'+import type { CustomAgent } from '@shared/types'+import type { PromptInjectionMode } from '@shared/agents/config'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Button } from '@renderer/ui/Button'+import { Input } from '@renderer/ui/Input'+import { Select } from '@renderer/ui/Select'++const ROWS = {+ custom: { title: 'Custom agents', keywords: ['custom', 'agent', 'cli', 'byo', 'aider'] }+}+const ENTRIES = Object.values(ROWS)++export function CustomAgentsSection({ isActive }: { isActive: boolean }): React.JSX.Element {+ const customAgents = useSettings((s) => s.settings.customAgents)+ const update = useSettings((s) => s.update)+ const patchAgent = (id: string, patch: Partial<CustomAgent>) =>+ update({ customAgents: customAgents.map((a) => (a.id === id ? { ...a, ...patch } : a)) })+ const removeAgent = (id: string) =>+ update({ customAgents: customAgents.filter((a) => a.id !== id) })+ const addAgent = () =>+ update({+ customAgents: [+ ...customAgents,+ {+ id: 'custom:' + crypto.randomUUID(),+ label: 'Custom agent',+ launchCmd: '',+ promptInjectionMode: 'argv'+ }+ ]+ })+ return (+ <SettingsSection+ id="custom-agents"+ title="Custom agents"+ description="Bring your own agent CLI. Custom agents launch in a terminal and show process / title status only (no hooks, branch, or loop)."+ isActive={isActive}+ searchEntries={ENTRIES}+ >+ <SearchableRow {...ROWS.custom}>+ <div className="space-y-4">+ {customAgents.map((agent) => (+ <div key={agent.id} className="space-y-2 rounded-md border border-border p-3">+ <FieldRow+ label="Label"+ control={+ <Input+ className="w-56"+ placeholder="e.g. Aider"+ value={agent.label}+ onChange={(e) => patchAgent(agent.id, { label: e.target.value })}+ />+ }+ />+ <FieldRow+ label="Launch command"+ control={+ <Input+ className="w-56"+ placeholder="e.g. aider"+ value={agent.launchCmd}+ onChange={(e) => patchAgent(agent.id, { launchCmd: e.target.value })}+ />+ }+ />+ <FieldRow+ label="Prompt injection"+ control={+ <Select+ value={agent.promptInjectionMode}+ onChange={(e) =>+ patchAgent(agent.id, {+ promptInjectionMode: e.target.value as PromptInjectionMode+ })+ }+ >+ <option value="argv">argv</option>+ <option value="flag-prompt">flag-prompt</option>+ <option value="stdin-after-start">stdin-after-start</option>+ </Select>+ }+ />+ <Button onClick={() => removeAgent(agent.id)}>Remove</Button>+ </div>+ ))}+ <Button onClick={addAgent}>Add agent</Button>+ </div>+ </SearchableRow>+ </SettingsSection>+ )+}diff --git a/src/renderer/components/settings/sections/NotificationsSection.tsx b/src/renderer/components/settings/sections/NotificationsSection.tsxnew file mode 100644index 000000000..837222b9c--- /dev/null+++ b/src/renderer/components/settings/sections/NotificationsSection.tsx@@ -0,0 +1,50 @@+import { useSettings } from '../../../state/settings'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Switch } from '@renderer/ui/Switch'++const ROWS = {+ notify: {+ title: 'Notify when a turn finishes in the background',+ keywords: ['notify', 'notification', 'claude', 'background', 'turn', 'done']+ }+}+const ENTRIES = Object.values(ROWS)++export function NotificationsSection({ isActive }: { isActive: boolean }): React.JSX.Element {+ const notifyOnClaudeDone = useSettings((s) => s.settings.notifyOnClaudeDone)+ const update = useSettings((s) => s.update)+ return (+ <SettingsSection+ id="notifications"+ title="Notifications"+ description="Get notified when an agent finishes while the app is in the background."+ isActive={isActive}+ searchEntries={ENTRIES}+ >+ <SearchableRow {...ROWS.notify}>+ <FieldRow+ label="Notify when a turn finishes in the background"+ control={+ <Switch+ checked={notifyOnClaudeDone}+ ariaLabel="Background notifications"+ onChange={(on) => {+ update({ notifyOnClaudeDone: on, notifyConsentAsked: true })+ // Enabling triggers the macOS notification permission prompt.+ if (on)+ void window.nodeTerminal.notify({+ title: 'Notifications enabled',+ body: "You'll be told when Claude Code finishes in the background.",+ nodeId: '',+ force: true+ })+ }}+ />+ }+ />+ </SearchableRow>+ </SettingsSection>+ )+}