@cliphijack/santaclaude 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/santaclaude.js +8 -1
package/package.json
CHANGED
package/santaclaude.js
CHANGED
|
@@ -66,7 +66,8 @@ function listWindows(session) {
|
|
|
66
66
|
}
|
|
67
67
|
// 각 루돌프(탭) 화면 캡처 — 웹 미러용 (마지막 ~30줄)
|
|
68
68
|
function captureWindow(session, name) {
|
|
69
|
-
|
|
69
|
+
// -e: ANSI 색상 보존(웹에서 터미널 색 재현), -S -40: 최근 40줄
|
|
70
|
+
try { return execFileSync('tmux', ['capture-pane', '-t', session + ':' + name, '-p', '-e', '-S', '-40'], { encoding: 'utf8' }).replace(/\n+$/, '').slice(-8000); }
|
|
70
71
|
catch (e) { return ''; }
|
|
71
72
|
}
|
|
72
73
|
function captureAll(session) {
|
|
@@ -116,6 +117,12 @@ async function run(conf) {
|
|
|
116
117
|
} else if (cmd.action === 'kill') {
|
|
117
118
|
execFileSync('tmux', ['kill-window', '-t', session + ':' + cmd.name]);
|
|
118
119
|
console.log(` 💤 루돌프 "${session}:${cmd.name}" 탭 닫음`);
|
|
120
|
+
} else if (cmd.action === 'input') {
|
|
121
|
+
// 웹에서 친 입력을 해당 탭(루돌프)에 주입 — 양방향 웹 터미널
|
|
122
|
+
const w = (cmd.name && windowExists(session, cmd.name)) ? (session + ':' + cmd.name) : pane;
|
|
123
|
+
execFileSync('tmux', ['send-keys', '-t', w, '-l', String(cmd.text || '')]);
|
|
124
|
+
setTimeout(() => { try { execFileSync('tmux', ['send-keys', '-t', w, 'Enter']); } catch (e) {} }, 300);
|
|
125
|
+
console.log(` ⌨️ 입력 → ${w}: ${String(cmd.text || '').slice(0, 50)}`);
|
|
119
126
|
}
|
|
120
127
|
} catch (e) { console.warn(` ⚠️ 제어 실패(${cmd.action} ${cmd.name}): ${e.message}`); }
|
|
121
128
|
}
|