spawn/cli/src
A 8564e6d984
refactor: reduce complexity in cmdConnect and setup_claude_code_config (#1191)
Extract helper functions to reduce nesting and duplication:

1. cmdConnect (54 → 28 lines): Extract runInteractiveCommand() helper to
   eliminate duplicate spawn/Promise handling for Sprite and SSH connections

2. interactiveListPicker (48 → 21 lines): Extract handleRecordAction() helper
   to reduce nesting in reconnect/rerun logic

3. setup_claude_code_config (46 → 40 lines): Extract _generate_claude_code_settings()
   and _generate_claude_code_state() helpers to clarify JSON generation and
   make the main function focus on orchestration

All changes preserve existing behavior and pass existing tests.

Agent: complexity-hunter

Co-authored-by: spawn-refactor-bot <refactor@openrouter.ai>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 05:18:40 -05:00
..
__tests__ test: fix agent-config-setup.test.ts - shell mocking for HOME variable substitution (#1195) 2026-02-15 05:16:11 -05:00
commands.ts refactor: reduce complexity in cmdConnect and setup_claude_code_config (#1191) 2026-02-15 05:18:40 -05:00
history.ts feat: add VM reconnect functionality to spawn list (#1175) 2026-02-15 00:16:53 -05:00
index.ts ux: add spawn last command to instantly rerun most recent spawn (#1171) 2026-02-14 23:27:59 -05:00
manifest.ts fix: add defense-in-depth for SPAWN_HOME path validation and manifest JSON sanitization (#984) 2026-02-13 11:37:10 -08:00
security.ts ux: improve error messages for better clarity and actionability (#1103) 2026-02-14 10:48:22 -05:00
unicode-detect.ts fix: Switch build target from node to bun to fix UTF-8 mojibake 2026-02-10 09:36:28 +00:00
update-check.ts fix: prevent command injection in update-check reExecWithArgs (#951) 2026-02-13 08:34:04 -08:00