triflux 9.7.13 → 9.8.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.ko.md +2 -0
- package/README.md +2 -0
- package/bin/triflux.mjs +297 -47
- package/hooks/hook-registry.json +4 -4
- package/hub/fullcycle.mjs +96 -0
- package/hub/paths.mjs +30 -28
- package/hub/pipeline/index.mjs +318 -318
- package/hub/schema.sql +146 -146
- package/hub/team/cli/commands/kill.mjs +37 -37
- package/hub/team/cli/commands/stop.mjs +31 -31
- package/hub/team/cli/commands/task.mjs +30 -30
- package/hub/team/cli/services/hub-client.mjs +208 -208
- package/hub/team/cli/services/native-control.mjs +118 -118
- package/hub/team/cli/services/runtime-mode.mjs +62 -62
- package/hub/team/cli/services/state-store.mjs +48 -48
- package/hub/team/dashboard.mjs +274 -274
- package/hub/team/native.mjs +649 -649
- package/hub/team/psmux.mjs +68 -13
- package/hub/tools.mjs +554 -554
- package/hub/workers/claude-worker.mjs +423 -423
- package/hub/workers/codex-mcp.mjs +410 -410
- package/hub/workers/gemini-worker.mjs +429 -429
- package/hub/workers/interface.mjs +40 -40
- package/package.json +1 -1
- package/scripts/__tests__/remote-spawn-transfer.test.mjs +1 -1
- package/scripts/cache-warmup.mjs +1 -0
- package/scripts/claude-logged.ps1 +54 -0
- package/scripts/demo-tui.mjs +59 -0
- package/scripts/headless-guard.mjs +4 -7
- package/scripts/hub-ensure.mjs +120 -120
- package/scripts/lib/psmux-info.mjs +119 -0
- package/scripts/lib/remote-spawn-transfer.mjs +1 -1
- package/scripts/setup.mjs +150 -6
- package/scripts/tfx-route-post.mjs +90 -13
- package/scripts/token-snapshot.mjs +575 -575
- package/skills/.omc/state/agent-replay-8f0e10a9-9693-4410-96f5-a6b07e8ed995.jsonl +1 -0
- package/skills/.omc/state/idle-notif-cooldown.json +3 -0
- package/skills/.omc/state/last-tool-error.json +7 -0
- package/skills/.omc/state/subagent-tracking.json +7 -0
- package/skills/tfx-codex-swarm/SKILL.md +40 -5
- package/skills/tfx-codex-swarm/mcp-daemon/register-autostart.ps1 +32 -0
- package/skills/tfx-doctor/SKILL.md +3 -0
- package/skills/tfx-fullcycle/SKILL.md +79 -4
- package/skills/tfx-hub/SKILL.md +3 -1
- package/skills/tfx-psmux-rules/SKILL.md +53 -31
- package/skills/tfx-remote-spawn/references/hosts.json +16 -16
- package/skills/tfx-setup/SKILL.md +9 -0
- package/tui/doctor.mjs +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"t":0,"agent":"adb34b0","agent_type":"general-purpose","event":"agent_stop","success":true}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tool_name": "Bash",
|
|
3
|
+
"tool_input_preview": "{\"command\":\"ls -la \\\"C:/Users/tellang/Desktop/Projects/triflux/skills/tfx-deslop/\\\" 2>/dev/null; echo \\\"===\\\"; ls -la \\\"C:/Users/tellang/Desktop/Projects/triflux/skills/tfx-codebase-search/\\\" 2>/dev/n...",
|
|
4
|
+
"error": "Exit code 2\n===",
|
|
5
|
+
"timestamp": "2026-03-29T03:40:35.913Z",
|
|
6
|
+
"retry_count": 1
|
|
7
|
+
}
|
|
@@ -431,6 +431,9 @@ wt.exe -w 0 -p triflux --title "swarm-dashboard" bash -c '
|
|
|
431
431
|
for s in $(psmux list-sessions -F "#{session_name}" 2>/dev/null | grep codex-swarm); do
|
|
432
432
|
echo " [$s] $(psmux capture-pane -t "$s" -p | tail -1)"
|
|
433
433
|
done
|
|
434
|
+
echo ""
|
|
435
|
+
echo "Attach: psmux attach -t <session-name>"
|
|
436
|
+
echo "Close: detach first (Ctrl+B,D), then close pane. NEVER close pane directly!"
|
|
434
437
|
sleep 10
|
|
435
438
|
done
|
|
436
439
|
'
|
|
@@ -536,13 +539,21 @@ Step 1 진입 전에 사전 검사한다. 미설치 시 스캔을 시작하기
|
|
|
536
539
|
```bash
|
|
537
540
|
command -v psmux >/dev/null 2>&1 || {
|
|
538
541
|
echo "ERROR: psmux가 설치되어 있지 않습니다."
|
|
539
|
-
echo "
|
|
542
|
+
echo "설치 방법 (택 1):"
|
|
543
|
+
echo " winget install marlocarlo.psmux"
|
|
544
|
+
echo " scoop install psmux"
|
|
545
|
+
echo " choco install psmux"
|
|
546
|
+
echo " cargo install psmux"
|
|
540
547
|
exit 1
|
|
541
548
|
}
|
|
542
549
|
```
|
|
543
550
|
|
|
544
551
|
Step 1 진입 전에 사전 검사한다. 미설치 시 즉시 중단한다.
|
|
545
552
|
|
|
553
|
+
> 설치만 확인하지 말고 `tfx doctor --json`으로 **버전/capability preflight**를 함께 확인한다.
|
|
554
|
+
> 최소 확인 항목: `new-session`, `attach-session`, `kill-session`, `capture-pane`
|
|
555
|
+
> (`detach-client` 지원 여부도 같이 확인하면 attach/detach hardening 상태까지 파악 가능)
|
|
556
|
+
|
|
546
557
|
> 두 사전 검사(codex, psmux)를 하나의 preflight 블록으로 묶어 Step 1 전에 실행하는 것을 권장한다.
|
|
547
558
|
|
|
548
559
|
```bash
|
|
@@ -572,6 +583,10 @@ fi
|
|
|
572
583
|
|
|
573
584
|
## 정리
|
|
574
585
|
|
|
586
|
+
> **중요: WT split pane에 attach된 psmux 세션을 직접 kill하면 WT가 크래시한다.**
|
|
587
|
+
> WT 1.24의 ConPTY close 레이스 버그 ([#17871](https://github.com/microsoft/terminal/issues/17871)).
|
|
588
|
+
> 반드시 detach → WT pane 닫기 → kill 순서를 지켜야 한다.
|
|
589
|
+
|
|
575
590
|
전체 스웜 종료 시:
|
|
576
591
|
|
|
577
592
|
> **WT 프리징 방지**: `kill-session` 전에 반드시 각 세션에 `exit`을 보내
|
|
@@ -579,20 +594,40 @@ fi
|
|
|
579
594
|
> 강제 kill하면 WT가 응답 없음 상태로 전환될 수 있다.
|
|
580
595
|
|
|
581
596
|
```bash
|
|
582
|
-
# 1)
|
|
597
|
+
# 1) detach — 모든 swarm 세션에서 WT detach (ConPTY 안전 해제)
|
|
598
|
+
for s in $(psmux list-sessions -F '#{session_name}' 2>/dev/null | grep codex-swarm); do
|
|
599
|
+
psmux detach-client -t "$s" 2>/dev/null
|
|
600
|
+
done
|
|
601
|
+
|
|
602
|
+
# 2) WT가 pane을 정리할 시간 확보
|
|
603
|
+
sleep 2
|
|
604
|
+
|
|
605
|
+
# 3) graceful exit — 각 세션에 exit 전송
|
|
583
606
|
for s in $(psmux list-sessions -F '#{session_name}' 2>/dev/null | grep codex-swarm); do
|
|
584
607
|
psmux send-keys -t "$s" "exit" Enter 2>/dev/null || true
|
|
585
608
|
done
|
|
586
609
|
|
|
587
|
-
#
|
|
610
|
+
# 4) 프로세스 종료 대기
|
|
588
611
|
sleep 2
|
|
589
612
|
|
|
590
|
-
#
|
|
613
|
+
# 5) 잔여 세션 강제 종료
|
|
591
614
|
for s in $(psmux list-sessions -F '#{session_name}' 2>/dev/null | grep codex-swarm); do
|
|
592
615
|
psmux kill-session -t "$s" 2>/dev/null || true
|
|
593
616
|
done
|
|
594
617
|
|
|
595
|
-
#
|
|
618
|
+
# 6) worktree 정리 (머지 완료된 것만)
|
|
596
619
|
git worktree prune
|
|
597
620
|
rm -rf .codex-swarm/
|
|
598
621
|
```
|
|
622
|
+
|
|
623
|
+
### 개별 세션 닫기 (WT pane에서)
|
|
624
|
+
|
|
625
|
+
WT split pane을 직접 닫지 말 것. 대신:
|
|
626
|
+
```bash
|
|
627
|
+
# pane 안에서:
|
|
628
|
+
psmux detach # 또는 Ctrl+B, D
|
|
629
|
+
# detach 후 WT pane이 자동으로 닫힘 (안전)
|
|
630
|
+
|
|
631
|
+
# 세션 자체를 종료하려면 detach 후:
|
|
632
|
+
psmux kill-session -t codex-swarm-{id}
|
|
633
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Register MCP daemon auto-start via Task Scheduler
|
|
2
|
+
# Runs start-daemons.ps1 at user logon so daemons survive WT crashes/reboots
|
|
3
|
+
# Usage: powershell -ExecutionPolicy Bypass -File register-autostart.ps1
|
|
4
|
+
|
|
5
|
+
$taskName = "OMX-MCP-Daemons"
|
|
6
|
+
$scriptPath = Join-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) "start-daemons.ps1"
|
|
7
|
+
|
|
8
|
+
# Remove existing task if any
|
|
9
|
+
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction SilentlyContinue
|
|
10
|
+
|
|
11
|
+
$action = New-ScheduledTaskAction `
|
|
12
|
+
-Execute "powershell.exe" `
|
|
13
|
+
-Argument "-ExecutionPolicy Bypass -WindowStyle Hidden -File `"$scriptPath`""
|
|
14
|
+
|
|
15
|
+
$trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
|
|
16
|
+
|
|
17
|
+
$settings = New-ScheduledTaskSettingsSet `
|
|
18
|
+
-AllowStartIfOnBatteries `
|
|
19
|
+
-DontStopIfGoingOnBatteries `
|
|
20
|
+
-StartWhenAvailable `
|
|
21
|
+
-ExecutionTimeLimit (New-TimeSpan -Minutes 5)
|
|
22
|
+
|
|
23
|
+
Register-ScheduledTask `
|
|
24
|
+
-TaskName $taskName `
|
|
25
|
+
-Action $action `
|
|
26
|
+
-Trigger $trigger `
|
|
27
|
+
-Settings $settings `
|
|
28
|
+
-Description "Start OMX MCP singleton daemons (supergateway on ports 9001-9005)" `
|
|
29
|
+
-RunLevel Limited
|
|
30
|
+
|
|
31
|
+
Write-Host "[OK] Task '$taskName' registered. Daemons will auto-start at logon."
|
|
32
|
+
Write-Host " Manual run: schtasks /Run /TN $taskName"
|
|
@@ -146,6 +146,9 @@ options:
|
|
|
146
146
|
- tfx-route.sh 설치 상태
|
|
147
147
|
- HUD 설치 및 설정 상태
|
|
148
148
|
- Codex/Gemini/Claude CLI 경로 (크로스 셸)
|
|
149
|
+
- **psmux 버전 / capability preflight**
|
|
150
|
+
- `new-session`, `attach-session`, `kill-session`, `capture-pane`, `detach-client`
|
|
151
|
+
- 권장 버전 이상인지 여부
|
|
149
152
|
- Codex Profiles (필수 프로파일 존재 여부)
|
|
150
153
|
- 스킬 설치 상태
|
|
151
154
|
- 플러그인 등록 상태
|
|
@@ -17,6 +17,55 @@ argument-hint: "<구현할 기능 전체 설명>"
|
|
|
17
17
|
|
|
18
18
|
> 5-Phase 파이프라인: Expansion → Planning → Execution → QA → Validation.
|
|
19
19
|
> OMC autopilot + Superpowers TDD + MetaGPT SOP 영감. 처음부터 끝까지 자율 실행.
|
|
20
|
+
> 실행 전 컨텍스트 grounding, deep-interview 산출물 재사용, phase-state/resume 계약을 포함한다.
|
|
21
|
+
|
|
22
|
+
## PRE-CONTEXT GATE
|
|
23
|
+
|
|
24
|
+
Phase 1 시작 전 아래 intake를 먼저 수행한다.
|
|
25
|
+
|
|
26
|
+
1. task slug를 생성한다.
|
|
27
|
+
2. 최근 관련 컨텍스트/산출물을 탐색한다.
|
|
28
|
+
3. 현재 작업용 스냅샷을 생성한다.
|
|
29
|
+
4. ambiguity가 높으면 `/deep-interview` 또는 기존 인터뷰 산출물 재사용을 우선 고려한다.
|
|
30
|
+
|
|
31
|
+
**필수 스냅샷 필드**
|
|
32
|
+
- task statement
|
|
33
|
+
- desired outcome
|
|
34
|
+
- known facts / evidence
|
|
35
|
+
- constraints
|
|
36
|
+
- unknowns / open questions
|
|
37
|
+
- likely codebase touchpoints
|
|
38
|
+
|
|
39
|
+
**권장 저장 경로**
|
|
40
|
+
- `.tfx/fullcycle/{run-id}/context-snapshot.md`
|
|
41
|
+
|
|
42
|
+
## STATE & ARTIFACT CONTRACT
|
|
43
|
+
|
|
44
|
+
`tfx-fullcycle`은 phase별로 산출물과 상태를 남긴다.
|
|
45
|
+
|
|
46
|
+
**기본 아티팩트 디렉토리**
|
|
47
|
+
- `.tfx/fullcycle/{run-id}/`
|
|
48
|
+
|
|
49
|
+
**최소 산출물**
|
|
50
|
+
- `context-snapshot.md`
|
|
51
|
+
- `expanded-spec.md`
|
|
52
|
+
- `implementation-plan.md`
|
|
53
|
+
- `execution-summary.md`
|
|
54
|
+
- `qa-findings.md`
|
|
55
|
+
- `validation-decision.md`
|
|
56
|
+
- `state.json`
|
|
57
|
+
|
|
58
|
+
**phase-state 필드**
|
|
59
|
+
- current phase
|
|
60
|
+
- started_at
|
|
61
|
+
- last_successful_phase
|
|
62
|
+
- retry_count
|
|
63
|
+
- failure_reason
|
|
64
|
+
|
|
65
|
+
**resume 규칙**
|
|
66
|
+
- 재실행 시 전체를 처음부터 다시 돌리지 않는다.
|
|
67
|
+
- `state.json`을 읽고 마지막 미완료 phase부터 resume한다.
|
|
68
|
+
- QA / Validation 재시도는 해당 phase만 다시 실행한다.
|
|
20
69
|
|
|
21
70
|
## HARD RULES
|
|
22
71
|
|
|
@@ -48,10 +97,13 @@ argument-hint: "<구현할 기능 전체 설명>"
|
|
|
48
97
|
|
|
49
98
|
**Claude가 직접 실행한다.** Agent 호출 없이 Claude 자신이 아키텍트 역할을 수행한다.
|
|
50
99
|
|
|
51
|
-
1.
|
|
52
|
-
2.
|
|
53
|
-
3.
|
|
54
|
-
4.
|
|
100
|
+
1. `.tfx/plans/interview-*.md` 산출물이 있으면 관련 문서를 먼저 탐색한다.
|
|
101
|
+
2. 인터뷰 산출물이 충분히 명확하면 raw prompt에서 다시 시작하지 말고 해당 문서를 Expansion 입력으로 재사용한다.
|
|
102
|
+
3. 인터뷰 산출물이 없거나 부족하면 사용자 요청에서 구현 범위, 영향 파일, 엣지 케이스, 암묵적 요구사항을 분석한다.
|
|
103
|
+
4. 검증 가능한 acceptance criteria 목록을 도출한다.
|
|
104
|
+
5. 모호한 점이 남아 있으면 AskUserQuestion 또는 `/deep-interview`로 명확화한다.
|
|
105
|
+
6. 출력: `{expanded_requirements}`, `{acceptance_criteria}`
|
|
106
|
+
7. 산출물 저장: `.tfx/fullcycle/{run-id}/expanded-spec.md`
|
|
55
107
|
|
|
56
108
|
### Phase 2: Planning
|
|
57
109
|
|
|
@@ -83,6 +135,9 @@ Bash("tfx multi --teammate-mode headless --auto-attach --dashboard \
|
|
|
83
135
|
- Consensus Score < 70 → 3자 결과를 교차 공유 후 Round 2 재합의
|
|
84
136
|
- Round 2 후에도 < 60 → AskUserQuestion으로 불일치 항목 제시 + 방향 결정 요청
|
|
85
137
|
|
|
138
|
+
**산출물 저장**
|
|
139
|
+
- `.tfx/fullcycle/{run-id}/implementation-plan.md`
|
|
140
|
+
|
|
86
141
|
### Phase 3: Execution
|
|
87
142
|
|
|
88
143
|
태스크를 라우팅 규칙에 따라 병렬 실행한다. 독립 태스크는 같은 응답에서 동시 호출한다.
|
|
@@ -112,6 +167,9 @@ Bash("tfx multi --teammate-mode headless --auto-attach --dashboard \
|
|
|
112
167
|
|
|
113
168
|
각 태스크 완료 시 테스트 통과 여부를 확인하고 다음 태스크로 진행한다.
|
|
114
169
|
|
|
170
|
+
**산출물 저장**
|
|
171
|
+
- 변경 파일 목록과 태스크별 결과를 `.tfx/fullcycle/{run-id}/execution-summary.md`에 기록한다.
|
|
172
|
+
|
|
115
173
|
### Phase 4: QA
|
|
116
174
|
|
|
117
175
|
**아래 2개 도구를 반드시 같은 응답에서 동시에 호출하라.**
|
|
@@ -139,6 +197,13 @@ Bash("tfx multi --teammate-mode headless --auto-attach --dashboard \
|
|
|
139
197
|
--timeout 600")
|
|
140
198
|
```
|
|
141
199
|
|
|
200
|
+
**QA 반복 규칙**
|
|
201
|
+
- 동일한 실패 / 동일한 에러가 3회 반복되면 무한 루프를 중단한다.
|
|
202
|
+
- 이 경우 `.tfx/fullcycle/{run-id}/qa-findings.md`에 근본 이슈 보고서를 남기고 사용자 판단을 요청한다.
|
|
203
|
+
|
|
204
|
+
**산출물 저장**
|
|
205
|
+
- `.tfx/fullcycle/{run-id}/qa-findings.md`
|
|
206
|
+
|
|
142
207
|
### Phase 5: Validation
|
|
143
208
|
|
|
144
209
|
Phase 4의 3자 결과에 Consensus 프로토콜을 적용한다.
|
|
@@ -148,6 +213,9 @@ Phase 4의 3자 결과에 Consensus 프로토콜을 적용한다.
|
|
|
148
213
|
- Score < 70 → 미합의 항목 수정 → Phase 4 재실행 (최대 2회)
|
|
149
214
|
- 2회 재실행 후에도 < 70 → AskUserQuestion으로 현황 보고 + 사용자 판단 요청
|
|
150
215
|
|
|
216
|
+
**산출물 저장**
|
|
217
|
+
- `.tfx/fullcycle/{run-id}/validation-decision.md`
|
|
218
|
+
|
|
151
219
|
### Final: 완료 보고
|
|
152
220
|
|
|
153
221
|
```markdown
|
|
@@ -180,6 +248,12 @@ Phase 4의 3자 결과에 Consensus 프로토콜을 적용한다.
|
|
|
180
248
|
- {항목}: {각 CLI 입장}
|
|
181
249
|
```
|
|
182
250
|
|
|
251
|
+
## CLEANUP & CANCEL RULES
|
|
252
|
+
|
|
253
|
+
- 성공 시 `state.json`을 complete 상태로 기록하고 orphan state가 남지 않도록 정리한다.
|
|
254
|
+
- 취소/비정상 종료 시에도 마지막 phase, failure_reason, 재개 힌트를 남겨 다음 실행에서 resume 가능해야 한다.
|
|
255
|
+
- cleanup은 상태를 무조건 삭제하는 것이 아니라, 성공/취소 여부가 판별되도록 메타데이터를 남긴 뒤 정리한다.
|
|
256
|
+
|
|
183
257
|
## ERROR RECOVERY
|
|
184
258
|
|
|
185
259
|
| 상황 | 대응 |
|
|
@@ -188,6 +262,7 @@ Phase 4의 3자 결과에 Consensus 프로토콜을 적용한다.
|
|
|
188
262
|
| Consensus 2회 연속 실패 | AskUserQuestion으로 미합의 항목 제시 + 사용자 판단 요청 |
|
|
189
263
|
| 특정 Phase 결과 누락 | 해당 Phase만 단독 재실행 |
|
|
190
264
|
| 빌드/테스트 실패 | Codex에 실패 로그 전달하여 수정 지시 |
|
|
265
|
+
| 동일 QA 에러 3회 반복 | 루프 중단 + 근본 이슈 보고서 작성 + 사용자 판단 요청 |
|
|
191
266
|
|
|
192
267
|
## TOKEN BUDGET
|
|
193
268
|
|
package/skills/tfx-hub/SKILL.md
CHANGED
|
@@ -91,7 +91,9 @@ Bash("curl -s http://127.0.0.1:27888/status 2>/dev/null || echo '{\"error\":\"hu
|
|
|
91
91
|
허브 시작 후 각 CLI에 MCP 서버로 등록:
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
# Codex
|
|
94
|
+
# Codex (수동 opt-in 예시)
|
|
95
|
+
# triflux는 config.json을 자동 관리하며, standalone Codex 노이즈 방지를 위해
|
|
96
|
+
# 사전 등록은 disabled로 두고 `tfx hub start` 이후에만 enabled로 전환한다.
|
|
95
97
|
codex mcp add tfx-hub --url http://127.0.0.1:27888/mcp
|
|
96
98
|
|
|
97
99
|
# Gemini (settings.json)
|
|
@@ -153,55 +153,41 @@ Get-Content 'C:\path\prompts\prompt.md' -Raw | codex
|
|
|
153
153
|
|
|
154
154
|
---
|
|
155
155
|
|
|
156
|
-
## RULE 5: WT
|
|
156
|
+
## RULE 5: WT 패인 정리 — CRITICAL (크래시/프리징 방지)
|
|
157
157
|
|
|
158
|
-
> **이 규칙을 위반하면 Windows Terminal이
|
|
159
|
-
>
|
|
160
|
-
>
|
|
158
|
+
> **이 규칙을 위반하면 Windows Terminal이 크래시/프리징된다.**
|
|
159
|
+
> 원인: WT 1.24의 ConPTY close 레이스 버그 ([microsoft/terminal#17871](https://github.com/microsoft/terminal/issues/17871)).
|
|
160
|
+
> `kill-session`은 물론 `send-keys "exit"`도 ConPTY 파이프 끊김 → 동일 레이스 가능.
|
|
161
|
+
> **유일한 안전 경로: detach-client로 WT와 ConPTY 연결을 먼저 분리.**
|
|
161
162
|
|
|
162
|
-
###
|
|
163
|
-
|
|
164
|
-
WT 패인이 `psmux attach-session`으로 세션에 연결된 상태에서
|
|
165
|
-
`psmux kill-session`을 직접 호출하면 WT의 PTY 핸들이 dangling 상태가 되어
|
|
166
|
-
**전체 WT 프로세스가 응답 불능**이 된다.
|
|
167
|
-
|
|
168
|
-
### MUST — 3단계 정리 (순서 반드시 준수)
|
|
163
|
+
### MUST — 3단계 정리 (detach-first, 순서 반드시 준수)
|
|
169
164
|
|
|
170
165
|
```bash
|
|
171
|
-
# 1)
|
|
166
|
+
# 1) WT 클라이언트를 세션에서 detach (ConPTY 연결 안전 분리)
|
|
172
167
|
for s in $(psmux list-sessions -F '#{session_name}' 2>/dev/null | grep "$PREFIX"); do
|
|
173
|
-
psmux
|
|
168
|
+
psmux detach-client -t "$s" 2>/dev/null || true
|
|
174
169
|
done
|
|
175
170
|
|
|
176
|
-
# 2) WT
|
|
171
|
+
# 2) WT가 detach된 pane을 정리할 시간 확보
|
|
177
172
|
sleep 2
|
|
178
173
|
|
|
179
|
-
# 3)
|
|
174
|
+
# 3) detach된 세션을 안전하게 kill (WT와 무관)
|
|
180
175
|
for s in $(psmux list-sessions -F '#{session_name}' 2>/dev/null | grep "$PREFIX"); do
|
|
181
176
|
psmux kill-session -t "$s" 2>/dev/null || true
|
|
182
177
|
done
|
|
183
178
|
```
|
|
184
179
|
|
|
185
|
-
### MUST NOT — 아래 패턴은 전부
|
|
180
|
+
### MUST NOT — 아래 패턴은 전부 크래시/프리징 유발
|
|
186
181
|
|
|
187
182
|
```bash
|
|
188
|
-
# WRONG 1 —
|
|
189
|
-
psmux kill-session -t "$
|
|
183
|
+
# WRONG 1 — detach 없이 바로 kill
|
|
184
|
+
psmux kill-session -t "$s"
|
|
190
185
|
|
|
191
|
-
# WRONG 2 —
|
|
186
|
+
# WRONG 2 — exit도 ConPTY 파이프 끊김 → 같은 레이스
|
|
192
187
|
psmux send-keys -t "$s" "exit" Enter
|
|
193
|
-
psmux kill-session -t "$s" # ← WT가 아직 PTY를 잡고 있음
|
|
194
|
-
|
|
195
|
-
# WRONG 3 — detach 직후 kill
|
|
196
|
-
psmux send-keys -t "$s" "psmux detach" Enter
|
|
197
|
-
psmux kill-session -t "$s" # ← detach 완료 전에 kill → 프리징
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### WT 패인 직접 닫기 (세션이 아닌 WT 쪽에서 정리)
|
|
201
188
|
|
|
202
|
-
|
|
203
|
-
#
|
|
204
|
-
wt.exe -w 0 close-pane # 현재 포커스된 패인 닫기
|
|
189
|
+
# WRONG 3 — WT split pane 직접 닫기 (Ctrl+Shift+W 금지)
|
|
190
|
+
# 대신: pane 안에서 psmux detach (또는 Ctrl+B, D) → pane이 자동으로 닫힘
|
|
205
191
|
```
|
|
206
192
|
|
|
207
193
|
---
|
|
@@ -220,7 +206,43 @@ psmux는 환경마다 설치 위치가 다르다. `hub/team/psmux.mjs`의 `PSMUX
|
|
|
220
206
|
|
|
221
207
|
---
|
|
222
208
|
|
|
223
|
-
## RULE 5-2:
|
|
209
|
+
## RULE 5-2: 설치 / 업데이트 preflight
|
|
210
|
+
|
|
211
|
+
`psmux`는 단순히 PATH에 있다고 끝이 아니다. Triflux는 아래 capability를 전제로 한다.
|
|
212
|
+
|
|
213
|
+
- `new-session`
|
|
214
|
+
- `attach-session`
|
|
215
|
+
- `kill-session`
|
|
216
|
+
- `capture-pane`
|
|
217
|
+
- `detach-client` (있으면 attach/detach cleanup hardening에 활용)
|
|
218
|
+
|
|
219
|
+
설치/업데이트가 의심될 때는 먼저:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
tfx doctor --json
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
공식 설치/업데이트 기준:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# install
|
|
229
|
+
winget install marlocarlo.psmux
|
|
230
|
+
scoop install psmux
|
|
231
|
+
choco install psmux
|
|
232
|
+
cargo install psmux
|
|
233
|
+
|
|
234
|
+
# update
|
|
235
|
+
winget upgrade marlocarlo.psmux
|
|
236
|
+
scoop update psmux
|
|
237
|
+
choco upgrade psmux
|
|
238
|
+
cargo install psmux --force
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**금지:** 문서/스크립트에서 `npm install -g psmux`를 표준 설치 경로처럼 안내하지 않는다.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## RULE 5-3: WT 명령 치트시트
|
|
224
246
|
|
|
225
247
|
### 패인 분할
|
|
226
248
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hosts": {
|
|
3
|
-
"ultra4": {
|
|
4
|
-
"description": "Windows 데스크탑 (SSAFY)",
|
|
5
|
-
"aliases": ["울트라", "데스크탑"],
|
|
6
|
-
"default_dir": "~/Desktop/Projects"
|
|
7
|
-
},
|
|
8
|
-
"m2": {
|
|
9
|
-
"description": "MacBook Pro",
|
|
10
|
-
"aliases": ["맥북", "맥"],
|
|
11
|
-
"default_dir": "~/projects"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"default_host": "ultra4",
|
|
15
|
-
"triggers": ["원격에서", "다른 머신에서", "다른 컴퓨터에서"]
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"hosts": {
|
|
3
|
+
"ultra4": {
|
|
4
|
+
"description": "Windows 데스크탑 (SSAFY)",
|
|
5
|
+
"aliases": ["울트라", "데스크탑"],
|
|
6
|
+
"default_dir": "~/Desktop/Projects"
|
|
7
|
+
},
|
|
8
|
+
"m2": {
|
|
9
|
+
"description": "MacBook Pro",
|
|
10
|
+
"aliases": ["맥북", "맥"],
|
|
11
|
+
"default_dir": "~/projects"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"default_host": "ultra4",
|
|
15
|
+
"triggers": ["원격에서", "다른 머신에서", "다른 컴퓨터에서"]
|
|
16
|
+
}
|
|
@@ -132,6 +132,15 @@ Bash("triflux setup")
|
|
|
132
132
|
|
|
133
133
|
#### 단계 4: CLI 진단
|
|
134
134
|
|
|
135
|
+
`triflux doctor --json`에는 psmux 설치 여부뿐 아니라 **버전/capability preflight**도 포함된다.
|
|
136
|
+
특히 Windows에서는 아래 capability가 모두 있어야 headless 멀티모델 오케스트레이션을 안전하게 쓸 수 있다:
|
|
137
|
+
|
|
138
|
+
- `new-session`
|
|
139
|
+
- `attach-session`
|
|
140
|
+
- `kill-session`
|
|
141
|
+
- `capture-pane`
|
|
142
|
+
- `detach-client` 지원 여부도 함께 확인 (attach/detach hardening 참고)
|
|
143
|
+
|
|
135
144
|
`triflux doctor --json`을 Bash로 실행하여 CLI 존재 여부 확인.
|
|
136
145
|
결과를 테이블로 표시.
|
|
137
146
|
|
package/tui/doctor.mjs
CHANGED
|
@@ -28,6 +28,7 @@ const CACHE_FILES = [
|
|
|
28
28
|
{ name: "mcp-inventory.json", desc: "MCP 인벤토리" },
|
|
29
29
|
{ name: "cli-issues.jsonl", desc: "CLI 이슈 로그" },
|
|
30
30
|
{ name: "triflux-update-check.json", desc: "업데이트 체크" },
|
|
31
|
+
{ name: "tfx-preflight.json", desc: "Preflight 캐시 (CLI/Hub 가용성)" },
|
|
31
32
|
];
|
|
32
33
|
|
|
33
34
|
// ── Run triflux doctor --json ──
|