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
refactor(core): move agent hook server + installers into src/core
enesd7619c0ee982
diff --git a/src/main/agents/hook-server.ts b/src/core/agents/hook-server.tssimilarity index 98%rename from src/main/agents/hook-server.tsrename to src/core/agents/hook-server.tsindex 3a1b18fa2..c5bb9cb88 100644--- a/src/main/agents/hook-server.ts+++ b/src/core/agents/hook-server.ts@@ -2,7 +2,7 @@ import { createServer, type IncomingMessage, type Server, type ServerResponse }import { randomUUID, timingSafeEqual } from 'crypto'import { writeFileSync, mkdirSync } from 'fs'import path from 'path'-import { app } from 'electron'+import { platform } from '../platform'import { canControlCanvas, type AgentId } from '../../shared/agents/config'import { normalizeFor, type NormalizedAgentEvent } from '../../shared/agents/normalize'@@ -54,7 +54,7 @@ class HookServer {private endpointPath = ''endpointFilePath(): string {- if (!this.endpointPath) this.endpointPath = path.join(app.getPath('userData'), 'hook-endpoint.env')+ if (!this.endpointPath) this.endpointPath = path.join(platform().userDataDir, 'hook-endpoint.env')return this.endpointPath}diff --git a/src/main/agents/hooks/claude.ts b/src/core/agents/hooks/claude.tssimilarity index 100%rename from src/main/agents/hooks/claude.tsrename to src/core/agents/hooks/claude.tsdiff --git a/src/main/agents/hooks/codex-trust.ts b/src/core/agents/hooks/codex-trust.tssimilarity index 100%rename from src/main/agents/hooks/codex-trust.tsrename to src/core/agents/hooks/codex-trust.tsdiff --git a/src/main/agents/hooks/codex.ts b/src/core/agents/hooks/codex.tssimilarity index 98%rename from src/main/agents/hooks/codex.tsrename to src/core/agents/hooks/codex.tsindex 9de321307..97917dddd 100644--- a/src/main/agents/hooks/codex.ts+++ b/src/core/agents/hooks/codex.ts@@ -26,7 +26,7 @@ import {unlinkSync} from 'fs'import { randomUUID } from 'crypto'-import { app } from 'electron'+import { platform } from '../../platform'import { buildManagedScript } from './managed-script'import {computeTrustedHash,@@ -84,7 +84,7 @@ function configTomlPath(): string {}function scriptPath(): string {- return path.join(app.getPath('userData'), 'agent-hooks', SCRIPT_FILE_NAME)+ return path.join(platform().userDataDir, 'agent-hooks', SCRIPT_FILE_NAME)}// Why: match managed entries by the `agent-hooks/codex.sh` path segment (notdiff --git a/src/main/agents/hooks/gemini.ts b/src/core/agents/hooks/gemini.tssimilarity index 100%rename from src/main/agents/hooks/gemini.tsrename to src/core/agents/hooks/gemini.tsdiff --git a/src/main/agents/hooks/index.ts b/src/core/agents/hooks/index.tssimilarity index 100%rename from src/main/agents/hooks/index.tsrename to src/core/agents/hooks/index.tsdiff --git a/src/main/agents/hooks/install-helper.test.ts b/src/core/agents/hooks/install-helper.test.tssimilarity index 100%rename from src/main/agents/hooks/install-helper.test.tsrename to src/core/agents/hooks/install-helper.test.tsdiff --git a/src/main/agents/hooks/install-helper.ts b/src/core/agents/hooks/install-helper.tssimilarity index 97%rename from src/main/agents/hooks/install-helper.tsrename to src/core/agents/hooks/install-helper.tsindex 6b26b9a4d..2f014e5b0 100644--- a/src/main/agents/hooks/install-helper.ts+++ b/src/core/agents/hooks/install-helper.ts@@ -10,7 +10,7 @@// - fail open: a missing/unparseable settings.json defaults to {} (install) / returns// early (remove); a write error is caught + warned, never thrown.import path from 'path'-import { app } from 'electron'+import { platform } from '../../platform'import { readFileSync, writeFileSync, mkdirSync, chmodSync } from 'fs'import { buildManagedScript } from './managed-script'@@ -21,7 +21,7 @@ type Settings = { hooks?: Record<string, HookDef[]>; [k: string]: unknown }export type HookSettings = Settingsfunction scriptPathFor(scriptFileName: string): string {- return path.join(app.getPath('userData'), 'agent-hooks', scriptFileName)+ return path.join(platform().userDataDir, 'agent-hooks', scriptFileName)}// The marker identifying OUR entry: the `agent-hooks/<scriptFile>` tail of the manageddiff --git a/src/main/agents/hooks/managed-script.test.ts b/src/core/agents/hooks/managed-script.test.tssimilarity index 100%rename from src/main/agents/hooks/managed-script.test.tsrename to src/core/agents/hooks/managed-script.test.tsdiff --git a/src/main/agents/hooks/managed-script.ts b/src/core/agents/hooks/managed-script.tssimilarity index 100%rename from src/main/agents/hooks/managed-script.tsrename to src/core/agents/hooks/managed-script.tsdiff --git a/src/main/claude-accounts.ts b/src/main/claude-accounts.tsindex c57159f7e..4ff154bef 100644--- a/src/main/claude-accounts.ts+++ b/src/main/claude-accounts.ts@@ -9,7 +9,7 @@ import { promisify } from 'util'import { app, ipcMain } from 'electron'import { IPC } from '../shared/ipc'import { accountConfigDir, isSupportedClaudeVersion, parseLoginCapture } from '../core/claude-accounts-core'-import { installClaudeHooksInto } from './agents/hooks/claude'+import { installClaudeHooksInto } from '../core/agents/hooks/claude'import { installCanvasSkillInto } from './canvas-control'import { findInLoginPath } from './pty-manager'import type { SshProjectManager } from './remote-ssh/ssh-project'diff --git a/src/main/index.ts b/src/main/index.tsindex 90682a802..8e589bb71 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -12,11 +12,11 @@ import { GitService } from './git-service'import { generateCommitMessage, generateGroupName, generateTerminalName } from './commit-message'import { initUpdater } from './updater'import { fetchCheck } from '../core/check'-import { hookServer } from './agents/hook-server'+import { hookServer } from '../core/agents/hook-server'import { setMainWindow, getMainWindow, sendToMain, shouldHideOnClose } from './main-window'import { initAgentStatusMirror, recordAgentEvent } from '../core/agent-status-mirror'import { retainUntilDismissed } from './notifications'-import { installManagedAgentHooks } from './agents/hooks'+import { installManagedAgentHooks } from '../core/agents/hooks'import { createSubagentTail } from './subagent-tail'import { createContextTail, type TaskNotification } from './context-tail'import { isAsyncSubagentLaunch, type NormalizedAgentEvent } from '../shared/agents/normalize'@@ -45,7 +45,7 @@ import { initClaudeUsage } from './claude-usage'import { initLicense } from './license'import { initClaudeAccounts, claudeConfigDirFor } from './claude-accounts'import { isSafeLocalTranscriptPath } from '../core/claude-accounts-core'-import { installClaudeHooksInto } from './agents/hooks/claude'+import { installClaudeHooksInto } from '../core/agents/hooks/claude'import { createPairingService } from './pairing-service'import { initRemoteHost } from './remote/host-service'import { initRemoteClient } from './remote/client-service'diff --git a/src/main/pty-manager.ts b/src/main/pty-manager.tsindex a41d9d8fd..f710242d8 100644--- a/src/main/pty-manager.ts+++ b/src/main/pty-manager.ts@@ -12,7 +12,7 @@ import {type PtyCreateResult,type Settings} from '../shared/types'-import { hookServer } from './agents/hook-server'+import { hookServer } from '../core/agents/hook-server'import {remoteHookEnvArgs,remoteTmuxHasSessionArgs,diff --git a/src/main/remote-ssh/remote-hooks.ts b/src/main/remote-ssh/remote-hooks.tsindex 7b99c1d1d..7a2e2994d 100644--- a/src/main/remote-ssh/remote-hooks.ts+++ b/src/main/remote-ssh/remote-hooks.ts@@ -5,8 +5,8 @@// agent simply runs without hooks. Takes an INJECTED runner so the flow is unit-testable// without real ssh/electron.import { childArgs, hookForwardArgs, hookForwardCancelArgs, remoteEndpointFileContents } from './control-master'-import { buildManagedScript } from '../agents/hooks/managed-script'-import { mergeManagedHook, type HookSettings } from '../agents/hooks/install-helper'+import { buildManagedScript } from '../../core/agents/hooks/managed-script'+import { mergeManagedHook, type HookSettings } from '../../core/agents/hooks/install-helper'import { posixQuote, type SshConnection } from '../../shared/ssh'export interface RemoteRunner {diff --git a/src/main/remote-ssh/ssh-project.ts b/src/main/remote-ssh/ssh-project.tsindex 78ac447e9..ddd9baccb 100644--- a/src/main/remote-ssh/ssh-project.ts+++ b/src/main/remote-ssh/ssh-project.ts@@ -19,7 +19,7 @@ import {RMT_TMUX_SOCKET} from './control-master'import { RemoteHooks } from './remote-hooks'-import { hookServer } from '../agents/hook-server'+import { hookServer } from '../../core/agents/hook-server'import { sessionName } from '../../core/tmux-naming'interface Runners {