From cf6dfae6ad311991ce0914370c04e60c284874b2 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 1 Jul 2026 22:42:38 -0400 Subject: refactor(ai-term): split into sessions, display, and EAT-backend layers ai-term.el had grown to ~1,215 lines mixing project/tmux session discovery, window display policy, the EAT terminal backend, and the public commands, so a change to any one risked coupling to the others. I extracted three layers, following the calendar-sync split shape: ai-term-sessions.el (discovery, tmux naming and parsing, launch command, picker ordering), ai-term-display.el (display-buffer actions and rule, toggle state, server-window routing), and ai-term-backend-eat.el (terminal create/reattach, pty send, EAT keymap). The backend file is named for its backend so a future one lands as a sibling. ai-term.el stays the public face (options, commands, keymap, shutdown), every name unchanged, so existing (require 'ai-term) callers and all 30 test files work as before. The extracted layers forward-declare the face's defcustoms rather than requiring it, keeping the graph acyclic. I dropped the unused cl-lib and host-environment requires and added the three modules to the header-contract list. --- tests/test-init-module-headers.el | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/test-init-module-headers.el') diff --git a/tests/test-init-module-headers.el b/tests/test-init-module-headers.el index f395fd71..fc956084 100644 --- a/tests/test-init-module-headers.el +++ b/tests/test-init-module-headers.el @@ -97,6 +97,9 @@ "hugo-config" ;; Batch 8 — Domain / integration / optional modules (Layer 2-4) "ai-term" + "ai-term-sessions" + "ai-term-display" + "ai-term-backend-eat" "browser-config" "calendar-sync" "calendar-sync-ics" -- cgit v1.2.3