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.

chore: pre-publish cleanup pass

enescf172e978533
diff --git a/.gitignore b/.gitignore
index f5b889711..5d0b5fa1e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,7 +14,7 @@ build/icon.png
# concurrent-session worktrees / local agent state
.claude/
-# private backend lives in its own repo (a-private-repo)
+# backend lives in its own repo
/nodebaseserver/
# local session handoff transcripts / app state
diff --git a/README.md b/README.md
index f8aaf0c56..b1128deb8 100644
--- a/README.md
+++ b/README.md
@@ -77,7 +77,8 @@ npm install # deps + rebuilds node-pty against Electron's ABI (postinstal
npm run dev # dev mode with renderer HMR
npm run build # production build into out/
npm start # preview the production build
-npm run typecheck # fastest correctness gate (no test runner yet)
+npm run typecheck # fastest correctness gate
+npm test # vitest unit + integration suite
npm run dist # local UNSIGNED .dmg into dist/ (smoke test)
```
diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md
index 3a1c3f41d..d86eb9f1a 100644
--- a/THIRD-PARTY-NOTICES.md
+++ b/THIRD-PARTY-NOTICES.md
@@ -17,6 +17,9 @@ nodeterm's license.
| DOMPurify | Apache-2.0 OR MPL-2.0 |
| zustand | MIT |
| electron-updater, electron-builder | MIT |
+| @anthropic-ai/claude-agent-sdk | © Anthropic PBC, proprietary (see the package's LICENSE.md) |
+| ws | MIT |
+| tweetnacl | Unlicense (public domain) |
Full license texts are available in each package's directory under
`node_modules/`, and from the projects' upstream repositories.
diff --git a/site/index.html b/site/index.html
index d0ea525e5..7c3b78a53 100644
--- a/site/index.html
+++ b/site/index.html
@@ -61,7 +61,7 @@
<a id="dl-arm2" href="https://github.com/eneskirca/nodeterm/releases">Apple Silicon</a>
·
<a id="dl-intel" href="https://github.com/eneskirca/nodeterm/releases">Intel</a>
- <span id="ver-meta">— free for personal use · macOS 10.12+</span>
+ <span id="ver-meta">— free for personal use · macOS 12+</span>
</p>
<div class="window">
diff --git a/src/main/agents/hooks/install-helper.test.ts b/src/main/agents/hooks/install-helper.test.ts
index 07dcc52f1..a6170c750 100644
--- a/src/main/agents/hooks/install-helper.test.ts
+++ b/src/main/agents/hooks/install-helper.test.ts
@@ -16,20 +16,20 @@ describe('mergeManagedHook', () => {
const twice = mergeManagedHook(once, cmd, ['Stop'])
expect(twice.hooks!.Stop).toEqual([{ hooks: [{ type: 'command', command: cmd }] }])
})
- it("leaves another app's agent-hooks entry alone (e.g. REF's claude-hook.sh)", () => {
- // REF's hook command also contains "agent-hooks" — a substring match would delete a
- // foreign tool's hooks the moment we install into an event it also uses (StopFailure).
- const REF = {
+ it("leaves another app's agent-hooks entry alone", () => {
+ // A foreign hook command can also contain "agent-hooks" — a substring match would delete
+ // that tool's hooks the moment we install into an event it also uses (StopFailure).
+ const foreign = {
hooks: [
{
type: 'command',
command:
- "if [ -x '/Users/x/.REF/agent-hooks/claude-hook.sh' ]; then /bin/sh '/Users/x/.REF/agent-hooks/claude-hook.sh'; fi"
+ "if [ -x '/Users/x/.someapp/agent-hooks/claude-hook.sh' ]; then /bin/sh '/Users/x/.someapp/agent-hooks/claude-hook.sh'; fi"
}
]
}
- const out = mergeManagedHook({ hooks: { StopFailure: [REF] } }, cmd, ['StopFailure'])
- expect(out.hooks!.StopFailure).toEqual([REF, { hooks: [{ type: 'command', command: cmd }] }])
+ const out = mergeManagedHook({ hooks: { StopFailure: [foreign] } }, cmd, ['StopFailure'])
+ expect(out.hooks!.StopFailure).toEqual([foreign, { hooks: [{ type: 'command', command: cmd }] }])
})
it('drops a legacy claude-signals managed entry too', () => {
const out = mergeManagedHook(
diff --git a/src/main/agents/hooks/install-helper.ts b/src/main/agents/hooks/install-helper.ts
index b476a0d41..6b26b9a4d 100644
--- a/src/main/agents/hooks/install-helper.ts
+++ b/src/main/agents/hooks/install-helper.ts
@@ -26,7 +26,7 @@ function scriptPathFor(scriptFileName: string): string {
// The marker identifying OUR entry: the `agent-hooks/<scriptFile>` tail of the managed
// command. A bare "agent-hooks" substring is NOT enough — other tools use the same dir
-// name (REF's `~/.REF/agent-hooks/claude-hook.sh`), and matching them would delete a
+// name (e.g. `~/.someapp/agent-hooks/claude-hook.sh`), and matching them would delete a
// foreign app's hooks from any event we both subscribe to.
function managedMarkerFor(command: string): string {
const m = command.match(/agent-hooks[\\/][^"'\s]+/)
diff --git a/src/main/entitlement-key.ts b/src/main/entitlement-key.ts
index b67d30629..7ac38c011 100644
--- a/src/main/entitlement-key.ts
+++ b/src/main/entitlement-key.ts
@@ -1,5 +1,5 @@
// Ed25519 PUBLIC key (SPKI PEM) used to verify entitlement tokens offline. This is the public
-// half of the server's ENTITLEMENT_PRIVATE_KEY (held only in the nodeterm-server env). It is
+// half of the backend's ENTITLEMENT_PRIVATE_KEY (held only in the server env). It is
// NOT a secret — it can only verify, not sign. If you rotate the server key, update this too.
export const ENTITLEMENT_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAOOw10RaKvicM2SA+n+uXZrIm54b0UxC45yPA41OO070=
diff --git a/src/main/remote/relay-socket.ts b/src/main/remote/relay-socket.ts
index 553b9f8e8..2cb09885c 100644
--- a/src/main/remote/relay-socket.ts
+++ b/src/main/remote/relay-socket.ts
@@ -1,13 +1,13 @@
// Relay socket + E2EE handshake + RPC/frame state machine (main process).
//
-// A single connection to the dumb relay (`nodebaseserver/src/relay`). The relay
+// A single connection to the dumb relay server (a separate repo). The relay
// forwards opaque bytes between a host and a client matched by a pairing token;
// it never decrypts. So the end-to-end-encrypted handshake and all traffic run
// HOST<->CLIENT *through* the relay — the relay is not a handshake participant.
//
// The handshake/RPC state machine, in brief:
// - The token gates entry at the relay via a `?token=<token>` QUERY PARAM on
-// the wss URL (cross-task decision; matches the relay's index.ts). It is NOT
+// the wss URL (matching what the relay expects). It is NOT
// interleaved as a data frame — every frame on the wire is opaque peer
// traffic.
// - Handshake `e2ee_hello -> e2ee_ready -> e2ee_auth -> e2ee_authenticated`:
@@ -144,7 +144,7 @@ export function connectRelay(opts: ConnectRelayOptions): RelaySocket {
function buildUrl(): string {
// Append `?token=` so the relay can read the pairing token from the query
- // string (cross-task decision). Preserve any existing query.
+ // string. Preserve any existing query.
const sep = opts.url.includes('?') ? '&' : '?'
return `${opts.url}${sep}token=${encodeURIComponent(opts.token)}`
}
diff --git a/src/main/telemetry.ts b/src/main/telemetry.ts
index a77069beb..2f9d21d65 100644
--- a/src/main/telemetry.ts
+++ b/src/main/telemetry.ts
@@ -1,4 +1,4 @@
-// Anonymous, opt-out telemetry. Runs in the main process (like check.ts) so the
+// Anonymous, opt-in telemetry (default off; Settings → Privacy). Runs in the main process (like check.ts) so the
// renderer CSP stays 'self'. Sends version/OS on launch and once a day; nothing personal,
// and the client IP is never stored server-side.
import { promises as fs, readFileSync } from 'fs'
diff --git a/src/renderer/components/CloneRepoDialog.tsx b/src/renderer/components/CloneRepoDialog.tsx
index 62cc4758f..3b993f54f 100644
--- a/src/renderer/components/CloneRepoDialog.tsx
+++ b/src/renderer/components/CloneRepoDialog.tsx
@@ -17,7 +17,7 @@ interface CloneRepoDialogProps {
}
/**
- * REF-style clone dialog: URL (with owner/repo GitHub shorthand preview) + parent
+ * Clone dialog: URL (with owner/repo GitHub shorthand preview) + parent
* folder (native picker, last-used remembered) + live progress + inline error.
* Cancel — or closing the dialog — aborts the in-flight clone; main cleans up the
* half-cloned directory it claimed.
diff --git a/src/renderer/components/SessionRow.tsx b/src/renderer/components/SessionRow.tsx
index b7d47cc6c..9f550d457 100644
--- a/src/renderer/components/SessionRow.tsx
+++ b/src/renderer/components/SessionRow.tsx
@@ -83,7 +83,7 @@ export function SessionRow({
<IconCircleCheck />
</span>
) : row.statusKind === 'done' ? (
- // REF-style completion glyph: a check icon scans better than one more dot.
+ // Completion glyph: a check icon scans better than one more dot.
<span className="ss-check" title={row.stateLabel}>
<IconCircleCheck />
</span>
diff --git a/src/renderer/state/agentStatus.ts b/src/renderer/state/agentStatus.ts
index 6cb3b669d..5720803fa 100644
--- a/src/renderer/state/agentStatus.ts
+++ b/src/renderer/state/agentStatus.ts
@@ -69,7 +69,7 @@ const KEY = 'nodeterm.agentStatus'
// Stop's POST — hold done against any non-newTurn working for this long.
export const DONE_HOLDOFF_MS = 3000
// Last-resort net for a lost Stop POST / crashed CLI: a working entry that saw no event at
-// all for this long decays to idle. Long on purpose (mirrors REF's 30 min freshness TTL):
+// all for this long decays to idle. Long on purpose:
// a single silent tool run (e.g. a long build) fires no hooks between Pre- and PostToolUse,
// so anything shorter would flip genuinely-running turns to idle.
export const STALE_WORKING_MS = 30 * 60_000
@@ -243,7 +243,7 @@ export const useAgentStatus = create<AgentStatusStore>((set) => ({
}))
/**
- * Esc/Ctrl-C interrupt inference (REF-style): Claude Code fires NO hook when the user
+ * Esc/Ctrl-C interrupt inference: Claude Code fires NO hook when the user
* cancels a turn, so a node interrupted mid-work would sit on "working" forever. Called
* from the terminal's input path on a lone Esc / Ctrl-C: wait one settle window; if the
* node is still `working` and NOT ONE hook event arrived since the keystroke (stateAt
diff --git a/test/remote/b5-e2e.test.ts b/test/remote/b5-e2e.test.ts
index 002d71ae6..12e6d1af8 100644
--- a/test/remote/b5-e2e.test.ts
+++ b/test/remote/b5-e2e.test.ts
@@ -20,7 +20,7 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import crypto from 'node:crypto'
import os from 'node:os'
import path from 'node:path'
-import { promises as fsp } from 'node:fs'
+import { existsSync, promises as fsp } from 'node:fs'
import { spawn, type ChildProcess } from 'node:child_process'
import { createServer } from 'node:net'
import { WebSocket } from 'ws'
@@ -48,6 +48,8 @@ import type {
} from '../../src/shared/types'
import type { DetachedSinks } from '../../src/main/pty-manager'
+// Companion server repo holding the REAL relay (not part of this repo) — the suite below is
+// skipped when it isn't checked out alongside as ./nodebaseserver.
const SERVER_DIR =
process.env.NODETERM_SERVER_DIR || path.resolve('nodebaseserver')
const RELAY_ENTRY = path.join(SERVER_DIR, 'src/relay/index.ts')
@@ -206,7 +208,7 @@ function node(id: string, x: number, y: number): CanvasNodeState {
// --- test --------------------------------------------------------------------
-describe('B5 remote project mirror end-to-end (real relay + real handlers + fake pty)', () => {
+describe.skipIf(!existsSync(RELAY_ENTRY))('B5 remote project mirror end-to-end (real relay + real handlers + fake pty)', () => {
let relay: ChildProcess | null = null
let baseUrl = ''
let token = ''
diff --git a/test/remote/relay-e2e.test.ts b/test/remote/relay-e2e.test.ts
index 91ade0a34..bb2bb58c8 100644
--- a/test/remote/relay-e2e.test.ts
+++ b/test/remote/relay-e2e.test.ts
@@ -4,7 +4,8 @@
// WebSockets, and asserts a terminal stream works and stays E2EE.
//
// What it exercises:
-// - the REAL relay (`nodebaseserver/src/relay/index.ts`) spawned as a child process on an
+// - the REAL relay server (from the companion server repo — see SERVER_DIR below; the whole
+// suite is skipped when it isn't checked out) spawned as a child process on an
// ephemeral port via `tsx`, trusting a test Ed25519 public key;
// - a single-use pairing token minted INLINE in the same compact format the relay verifies
// (`base64url(payloadJSON).base64url(ed25519 sig over the base64url-payload bytes)`);
@@ -41,6 +42,7 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import crypto from 'node:crypto'
import path from 'node:path'
import { spawn, type ChildProcess } from 'node:child_process'
+import { existsSync } from 'node:fs'
import { createServer } from 'node:net'
import { WebSocket } from 'ws'
@@ -52,8 +54,8 @@ import { OP, type Frame } from '../../src/main/remote/framing'
import type { PtyCreateOptions } from '../../src/shared/types'
import type { DetachedSinks } from '../../src/main/pty-manager'
-// Absolute path to the (private) nodeterm-server repo holding the REAL relay. It lives at the
-// main checkout root, NOT inside this git worktree, so resolve from there explicitly. Allow an
+// Absolute path to the companion server repo holding the REAL relay (not part of this repo —
+// the suite below is skipped when it isn't checked out alongside as ./nodebaseserver). Allow an
// env override for unusual layouts / CI.
const SERVER_DIR =
process.env.NODETERM_SERVER_DIR || path.resolve('nodebaseserver')
@@ -95,7 +97,7 @@ function getEphemeralPort(): Promise<number> {
}
// Mint a pairing token in the exact compact format the relay verifies
-// (mirrors nodebaseserver/src/lib/pairing-token.ts):
+// (mirrors the relay server's pairing-token module):
// base64url(JSON {pairingId, licenseId, iat, exp}).base64url(ed25519 sig over the b64url bytes)
function mintToken(privateKey: crypto.KeyObject, pairingId: string): string {
const now = Math.floor(Date.now() / 1000)
@@ -213,7 +215,7 @@ function makeEchoPty(): HostPtyManager {
// --- test --------------------------------------------------------------------
-describe('B4 relay end-to-end (real relay + real protocol + fake pty)', () => {
+describe.skipIf(!existsSync(RELAY_ENTRY))('B4 relay end-to-end (real relay + real protocol + fake pty)', () => {
let relay: ChildProcess | null = null
let baseUrl = ''
let token = ''