triflux 5.2.0 → 6.0.1

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.
@@ -148,34 +148,58 @@ status는 "completed"만 사용. 실패 여부는 `metadata.result`로 구분.
148
148
  3. 실패 시 `forceCleanupTeam(teamName)` → 그래도 실패 시 `rm -rf ~/.claude/teams/{teamName}/` 안내
149
149
  4. 종합 보고서 출력
150
150
 
151
- ### Phase 3-mux: psmux 헤드리스 모드
151
+ ### Phase 3-direct: Lead-Direct Headless 실행 (v6.0.0, 기본)
152
152
 
153
- `--tmux`/`--psmux` pane 기반 헤드리스 실행. Agent 래퍼 없이 Lead가 직접 CLI를 제어하여 토큰 76-89% 절감.
153
+ CLI 워커(Codex/Gemini/Claude)를 Agent 래퍼 없이 Lead가 headless.mjs로 직접 실행.
154
+ Windows Terminal에 psmux 세션이 자동 팝업되어 사용자가 실시간으로 CLI 출력을 확인.
154
155
 
155
- **핵심 프리미티브** (`hub/team/psmux.mjs`):
156
- - `createPsmuxSession(name, {layout, paneCount})`세션 + pane 분할
157
- - `dispatchCommand(session, paneName, cmd)` `{token, paneId, logPath}`
158
- - `waitForCompletion(session, paneName, token, timeoutSec)` `{matched, exitCode, sessionDead?}`
159
- - 완료 마커: `__TRIFLUX_DONE__:token:exitCode` (PowerShell 래핑)
160
- - pane 이름: `"lead"` index 0, `"worker-N"` index N (대소문자 무관)
156
+ **핵심 기능:**
157
+ - `progressive: true` (기본) — pane이 하나씩 split-window로 추가 (실시간 스플릿)
158
+ - `autoAttach: true` 세션 생성 즉시 Windows Terminal 자동 팝업
159
+ - `progressIntervalSec` N초마다 pane 스냅샷을 onProgress로 전달
160
+ - `applyTrifluxTheme()` status bar + pane border 테마 자동 적용
161
+ - 피드백 재실행 같은 pane에 후속 명령 dispatch (세션 유지)
161
162
 
162
- **헤드리스 오케스트레이션** (`hub/team/headless.mjs`):
163
- ```
164
- import { runHeadlessWithCleanup } from "hub/team/headless.mjs";
165
- const { results } = runHeadlessWithCleanup([
163
+ **Lead 오케스트레이션 패턴:**
164
+
165
+ ```javascript
166
+ // headless.mjs의 runHeadlessInteractive()를 Bash 내에서 호출
167
+ // Lead는 Bash의 결과를 직접 파싱 — Agent 래퍼 불필요
168
+ const handle = await runHeadlessInteractive("tfx-session", [
166
169
  { cli: "codex", prompt: "코드 리뷰", role: "reviewer" },
167
170
  { cli: "gemini", prompt: "문서 작성", role: "writer" },
168
- ], { timeoutSec: 300 });
171
+ { cli: "claude", prompt: "테스트 실행", role: "tester" },
172
+ ], {
173
+ timeoutSec: 300,
174
+ autoAttach: true, // WT 자동 팝업
175
+ progressive: true, // 실시간 스플릿 (기본)
176
+ progressIntervalSec: 10, // 10초마다 진행 스냅샷
177
+ });
178
+ // handle: { results, dispatch(), capture(), snapshots(), waitFor(), kill() }
179
+ ```
180
+
181
+ **결정 로직:**
182
+ ```
183
+ Phase 3 선택:
184
+ assignments.every(a => a.cli !== 'claude')
185
+ → Phase 3-direct (headless, 전부 CLI)
186
+ assignments.some(a => a.cli === 'claude') AND Claude 워커가 Read/Edit 필요
187
+ → Claude 워커: Agent(subagent_type), CLI 워커: Phase 3-direct
188
+ fallback (psmux 미설치)
189
+ → Phase 3 Native Teams (기존 slim wrapper)
169
190
  ```
170
191
 
171
192
  **CLI 헤드리스 명령 패턴:**
172
193
  | CLI | 명령 | 출력 |
173
194
  |-----|-------|------|
174
195
  | Codex | `codex exec 'prompt' -o result.txt --color never` | 파일 |
175
- | Gemini | `gemini -p 'prompt' -o text > result.txt` | 리다이렉트 |
176
- | Claude | `claude -p 'prompt' --output-format text > result.txt` | 리다이렉트 |
196
+ | Gemini | `gemini -p 'prompt' -o text > result.txt 2>result.txt.err` | 리다이렉트 |
197
+ | Claude | `claude -p 'prompt' --output-format text > result.txt 2>&1` | 리다이렉트 |
177
198
 
178
199
  **E4 크래시 복구:** `waitForCompletion`이 세션 사망 시 `{sessionDead: true}` 반환 (throw 대신).
200
+ **elevation 불필요:** psmux IPC는 TCP 기반. 비-elevated 환경에서 정상 실행. (v5.2.0 검증 완료)
201
+ **시각적 확인:** Windows Terminal 자동 팝업 + pane 타이틀 `codex (reviewer)` + triflux 테마.
202
+ **실수로 닫아도:** psmux 세션은 독립적. `psmux attach -t 세션이름`으로 재연결.
179
203
 
180
204
  **레거시 인터랙티브 모드:** `Bash("node {PKG_ROOT}/bin/triflux.mjs multi --no-attach --agents {agents} \\\"{task}\\\"")`
181
205