Lines 1-27javascript
2// Plugin installer for GSD-Lite
4import { existsSync, mkdirSync, cpSync, readFileSync, writeFileSync, renameSync, rmSync, readdirSync } from 'node:fs';
5import { join, dirname } from 'node:path';
6import { homedir } from 'node:os';
7import { fileURLToPath, pathToFileURL } from 'node:url';
8import { execSync } from 'node:child_process';
9import { createRequire } from 'node:module';
HighChild Process
Package source references child process execution.
install.jsView on unpkg · L7 11const __dirname = dirname(fileURLToPath(import.meta.url));
12const _require = createRequire(import.meta.url);
13const { semverSortComparator } = _require('./hooks/lib/semver-sort.cjs');
14const { isCompositeStatusLine, registerProvider: registerCompositeProvider } = _require('./hooks/lib/statusline-composite.cjs');
15const CLAUDE_DIR = process.env.CLAUDE_CONFIG_DIR || join(homedir(), '.claude');
16const RUNTIME_DIR = join(CLAUDE_DIR, 'gsd');
17const DRY_RUN = process.argv.includes('--dry-run');
19// Single source of truth for hook files (used by copy loop and registration)
20const HOOK_FILES = ['gsd-session-init.cjs', 'gsd-auto-update.cjs', 'gsd-context-monitor.cjs', 'gsd-statusline.cjs', 'gsd-session-stop.cjs'];
22// Hook registration config: hookType → { file identifier, matcher, timeout? }
23const HOOK_REGISTRY = [
24 { hookType: 'SessionStart', identifier: 'gsd-session-init', matcher: 'startup|clear|compact', timeout: 5 },
25 { hookType: 'PostToolUse', identifier: 'gsd-context-monitor', matcher: '*' },
26 { hookType: 'Stop', identifier: 'gsd-session-stop', matcher: '*', timeout: 3 },