Lines 13-53javascript
13import { createClaudeEvents } from './claudeEvents.js';
14import busboy from 'busboy';
15import { promises as fsp, createWriteStream } from 'node:fs';
16import { join as joinPath, dirname, resolve as resolvePath } from 'node:path';
17import { fileURLToPath } from 'node:url';
18import { homedir } from 'node:os';
19import { randomBytes } from 'node:crypto';
20import { safeUploadName } from './docPath.js';
21import { safePreviewName } from './previews.js';
22import { isAllowedUploadExt, DEFAULT_UPLOAD_EXTS } from './uploadTypes.js';
23import { hooksStatus, installHooks } from './cli/claudeHooks.js';
24import { codexHooksStatus, installCodexHooks } from './cli/codexHooks.js';
25import { claudeStatePath } from './cli/state.js';
26import { scanOrphans, takeoverOrphan, defaultProjectsDir } from './orphans.js';
27import { getUsageCached } from './usage.js';
28import { readFileSync } from 'node:fs';
29import { readCache, isNewer, shouldRefresh, refreshLatestAsync } from './cli/updateCheck.js';
31const here = dirname(fileURLToPath(import.meta.url));
32const HOOKS_SRC = resolvePath(here, '../hooks'); // server/hooks (bundled scripts)
34// The installed CLI version (server/package.json) — read once. The phone compares this against the cached
35// npm "latest" to surface an update hint ("run `handmux update` on your computer"); see the /version route.
36const PKG_VERSION = (() => {
37 try { return JSON.parse(readFileSync(resolvePath(here, '../package.json'), 'utf8')).version || null; }
38 catch { return null; }
LowWeak Crypto
Package source references weak cryptographic algorithms.
src/httpApi.jsView on unpkg · L33 41// Summarize inbox-hook state across every coding agent for the phone: 'installed' if any agent is wired,
42// 'absent' if an agent is present but none wired (→ offer the one-tap enable), 'no-claude' if there's no
43// agent at all (→ hide the prompt).
44function combinedHooksStatus(home) {
45 const c = hooksStatus(home); // 'no-claude' | 'installed' | 'absent'
46 const x = codexHooksStatus(home); // 'no-codex' | 'installed' | 'absent'
47 if (c === 'installed' || x === 'installed') return 'installed';
48 if (c !== 'no-claude' || x !== 'no-codex') return 'absent';
52// Keys the mobile keyboard may send via /keys. A controlled vocabulary of named tmux keys, PLUS
53// live-modifier combinations (Ctrl/Alt + a single letter or digit) so the keyboard's Ctrl modifier