Skip to content

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.

Merge branch 'main' into feat/agent-abstraction

enes087472b88c95
diff --cc src/main/index.ts
index d547d171f,570b594a2..ef3bdae5d
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@@ -10,12 -10,10 +10,13 @@@ import { SettingsStore } from './settin
import { GitService } from './git-service'
import { generateCommitMessage, generateTerminalName } from './commit-message'
import { initUpdater } from './updater'
- import { fetchAnnouncements } from './announcements'
+ import { fetchCheck } from './check'
-import { initClaudeHooks } from './claude-hooks'
+import { hookServer } from './agents/hook-server'
+import { installManagedAgentHooks } from './agents/hooks'
+import { createSubagentTail } from './subagent-tail'
+import { createContextTail } from './context-tail'
import { initBridge } from './bridge'
+ import { initTelemetry } from './telemetry'
import { initClaudeUsage } from './claude-usage'
const settingsStore = new SettingsStore()
@@@ -234,40 -233,10 +236,41 @@@ app.whenReady().then(async () =>
const win = createWindow()
mainWin = win
initUpdater(win)
- initClaudeHooks(win)
+
+ // Agent hooks: install the managed hook script into each agent's config, then start the
+ // local HTTP server that receives hook posts and forwards normalized events to the renderer.
+ // A raw listener drives the transcript-tailing features (context meter + subagent transcript),
+ // which need the raw transcript_path the NormalizedAgentEvent intentionally drops.
+ const subagentTail = createSubagentTail(win)
+ const contextTail = createContextTail(win)
+ installManagedAgentHooks()
+ hookServer.setListener((e) => {
+ if (!win.isDestroyed()) win.webContents.send(IPC.agentStatus, e)
+ })
+ hookServer.setRawListener((agentId, _nodeId, payload) => {
+ if (agentId !== 'claude') return
+ const p = payload as {
+ hook_event_name?: string
+ session_id?: string
+ transcript_path?: string
+ tool_name?: string
+ tool_use_id?: string
+ }
+ // Context-window meter: tail the session transcript (any event carrying both fields).
+ if (p.session_id && p.transcript_path) contextTail.track(p.session_id, p.transcript_path)
+ if (p.hook_event_name === 'SessionEnd' && p.session_id) contextTail.untrack(p.session_id)
+ // Subagent live transcript: track on PreToolUse / finish on PostToolUse for subagent tools.
+ const SUBAGENT_TOOLS = new Set(['Agent', 'Task'])
+ if (p.tool_use_id && p.tool_name && SUBAGENT_TOOLS.has(p.tool_name)) {
+ if (p.hook_event_name === 'PreToolUse') subagentTail.track(p.tool_use_id, p.transcript_path)
+ else if (p.hook_event_name === 'PostToolUse') subagentTail.finish(p.tool_use_id)
+ }
+ })
+ await hookServer.start()
+
initBridge(win, ptyManager)
initClaudeUsage(win)
+ initTelemetry(() => settingsStore.get())
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
diff --cc src/renderer/components/SettingsPanel.tsx
index e706f36cd,9bc4d2c3e..374d4d3e2
--- a/src/renderer/components/SettingsPanel.tsx
+++ b/src/renderer/components/SettingsPanel.tsx
@@@ -155,57 -135,19 +155,70 @@@ export function SettingsPanel({ onClos
</label>
</section>
+ <section>
+ <h3>Custom agents</h3>
+ <p className="set-note">
+ Bring your own agent CLI. Custom agents launch in a terminal and show process /
+ title status only (no hooks, branch, or loop).
+ </p>
+ {customAgents.map((agent) => (
+ <div key={agent.id} className="set-agent">
+ <label className="set-row">
+ <span>Label</span>
+ <input
+ type="text"
+ placeholder="e.g. Aider"
+ value={agent.label}
+ onChange={(e) => patchAgent(agent.id, { label: e.target.value })}
+ />
+ </label>
+ <label className="set-row">
+ <span>Launch command</span>
+ <input
+ type="text"
+ placeholder="e.g. aider"
+ value={agent.launchCmd}
+ onChange={(e) => patchAgent(agent.id, { launchCmd: e.target.value })}
+ />
+ </label>
+ <label className="set-row">
+ <span>Prompt injection</span>
+ <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>
+ </label>
+ <button className="set-btn" onClick={() => removeAgent(agent.id)}>
+ Remove
+ </button>
+ </div>
+ ))}
+ <button className="set-btn" onClick={addAgent}>
+ Add agent
+ </button>
+ </section>
+
+ <section>
+ <h3>Privacy</h3>
+ <label className="set-row">
+ <span>Send anonymous usage data (version/OS)</span>
+ <input
+ type="checkbox"
+ checked={settings.telemetryEnabled}
+ onChange={(e) => update({ telemetryEnabled: e.target.checked })}
+ />
+ </label>
+ <p className="set-note">No personal data. Used only to see which versions are in use.</p>
+ </section>
+
<section>
<h3>Appearance</h3>
<div className="set-row">
diff --cc src/shared/types.ts
index 7b6341af5,fdda4bfac..89b9a41a2
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@@ -207,8 -186,8 +207,10 @@@ export interface Settings
notifyOnClaudeDone: boolean
/** Whether the one-time notification consent prompt has been shown. */
notifyConsentAsked: boolean
+ /** User-defined agents (BYO CLI) appended to the Add menus. */
+ customAgents: CustomAgent[]
+ /** Send anonymous usage data (version/OS) to the telemetry backend. Opt-out (default on). */
+ telemetryEnabled: boolean
}
export const DEFAULT_SETTINGS: Settings = {
@@@ -229,7 -208,7 +231,8 @@@
seenShortcuts: false,
notifyOnClaudeDone: true,
notifyConsentAsked: false,
- customAgents: []
++ customAgents: [],
+ telemetryEnabled: true
}
export interface SettingsApi {