triflux 10.49.0 → 10.50.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.
- package/CLAUDE.md +1 -2
- package/README.ko.md +4 -7
- package/README.md +4 -7
- package/adapters/codex/skills/tfx-live/SKILL.md +129 -0
- package/bin/tfx-live.mjs +446 -68
- package/bin/triflux.mjs +181 -1507
- package/config/mcp-registry.json +10 -8
- package/hooks/agy-session-hook.mjs +1 -1
- package/hooks/claude-cwd-projection-refresh.mjs +7 -79
- package/hooks/codex-session-hook.mjs +3 -8
- package/hooks/hook-orchestrator.mjs +8 -648
- package/hooks/lib/resolve-root.mjs +1 -1
- package/hub/bridge.mjs +290 -51
- package/hub/team/claude-daemon-control.mjs +54 -6
- package/hub/team/claude-transcript.mjs +240 -0
- package/hub/team/cli/commands/start/index.mjs +17 -3
- package/hub/team/cli/commands/start/parse-args.mjs +1 -0
- package/hub/team/session-context.mjs +203 -0
- package/hub/team/uds-orchestrator.mjs +63 -1
- package/hub/team/worktree-lifecycle.mjs +0 -1
- package/hud/constants.mjs +10 -0
- package/hud/hud-qos-status.mjs +23 -4
- package/hud/providers/gemini.mjs +4 -1
- package/hud/renderers.mjs +10 -6
- package/package.json +5 -2
- package/references/codex-plugin-cc-analysis.md +5 -10
- package/references/codex-plugin-cc-code-patterns.md +3 -3
- package/scripts/__tests__/mcp-guard-engine-policy-sync.test.mjs +4 -19
- package/scripts/__tests__/mcp-guard-engine-proactive-sync.test.mjs +8 -34
- package/scripts/__tests__/mcp-guard-engine-stdio-sync.test.mjs +24 -9
- package/scripts/__tests__/mcp-guard-engine-sync-http-headers.test.mjs +0 -2
- package/scripts/__tests__/mcp-guard-engine.test.mjs +1 -58
- package/scripts/__tests__/setup-cleanup-stale-skills.test.mjs +68 -212
- package/scripts/__tests__/skill-surface.test.mjs +2 -53
- package/scripts/__tests__/smoke.test.mjs +0 -8
- package/scripts/completions/tfx.bash +1 -7
- package/scripts/completions/tfx.fish +1 -4
- package/scripts/completions/tfx.zsh +1 -10
- package/scripts/config-audit.mjs +0 -55
- package/scripts/doctor-diagnose.mjs +1 -1
- package/scripts/install-commit-hook.mjs +56 -0
- package/scripts/lib/doctor-env-checks.mjs +0 -85
- package/scripts/lib/legacy-hook-cleanup.mjs +230 -0
- package/scripts/lib/legacy-mcp-cleanup.mjs +772 -0
- package/scripts/lib/mcp-guard-engine.mjs +44 -271
- package/scripts/lib/mcp-manifest.mjs +2 -2
- package/scripts/lib/session-presence.mjs +249 -0
- package/scripts/pack.mjs +4 -0
- package/scripts/preflight-cache.mjs +19 -6
- package/scripts/release/check-packages-mirror.mjs +8 -0
- package/scripts/remote-spawn.mjs +56 -1
- package/scripts/run.cjs +1 -1
- package/scripts/session-stale-cleanup.mjs +2 -3
- package/scripts/setup.mjs +320 -713
- package/scripts/sync-hub-mcp-settings.mjs +0 -280
- package/scripts/tfx-route.sh +8 -0
- package/skills/tfx-doctor/SKILL.md +14 -199
- package/skills/tfx-live/SKILL.md +73 -206
- package/skills/tfx-remote/SKILL.md +20 -10
- package/skills/tfx-research/SKILL.md +5 -2
- package/skills/tfx-setup/SKILL.md +14 -574
- package/skills/tfx-setup/skill.json +2 -2
- package/skills/tfx-wt/SKILL.md +6 -8
- package/skills/tfx-wt/skill.json +1 -1
- package/tui/setup.mjs +0 -130
- package/hooks/agent-route-guard.mjs +0 -113
- package/hooks/cross-review-tracker.mjs +0 -135
- package/hooks/cto-north-star-brief.mjs +0 -133
- package/hooks/error-context.mjs +0 -185
- package/hooks/hook-adaptive-collector.mjs +0 -88
- package/hooks/hook-manager.mjs +0 -426
- package/hooks/hook-registry.json +0 -367
- package/hooks/hooks.json +0 -149
- package/hooks/keyword-rules.json +0 -676
- package/hooks/mcp-config-watcher.mjs +0 -84
- package/hooks/permission-safe-allow.mjs +0 -267
- package/hooks/pipeline-stop.mjs +0 -435
- package/hooks/post-tool-tips.mjs +0 -306
- package/hooks/pre-compact-snapshot.mjs +0 -181
- package/hooks/safety-guard.mjs +0 -466
- package/hooks/session-end-cleanup.mjs +0 -360
- package/hooks/session-start-fast.mjs +0 -579
- package/hooks/session-start-lake.mjs +0 -81
- package/hooks/subagent-tracker.mjs +0 -281
- package/hooks/subagent-verifier.mjs +0 -85
- package/scripts/__tests__/install-mcp-gateway-startup.test.mjs +0 -367
- package/scripts/__tests__/keyword-detector.test.mjs +0 -368
- package/scripts/__tests__/mcp-gateway-health-check.test.mjs +0 -261
- package/scripts/__tests__/mcp-gateway-wrapper-check.test.mjs +0 -54
- package/scripts/__tests__/mcp-guard-engine-watch-http-headers.test.mjs +0 -137
- package/scripts/__tests__/session-start-fast.test.mjs +0 -36
- package/scripts/codex-gateway-preflight.mjs +0 -208
- package/scripts/codex-mcp-gateway-sync.mjs +0 -275
- package/scripts/cross-review-gate.mjs +0 -162
- package/scripts/cross-review-tracker.mjs +0 -251
- package/scripts/install-mcp-gateway-startup.mjs +0 -503
- package/scripts/keyword-detector.mjs +0 -485
- package/scripts/keyword-rules-expander.mjs +0 -538
- package/scripts/lib/cross-review-utils.mjs +0 -59
- package/scripts/lib/hook-utils.mjs +0 -16
- package/scripts/lib/keyword-rules.mjs +0 -296
- package/scripts/lib/mcp-gateway-health-check.mjs +0 -224
- package/scripts/lib/mcp-gateway-servers.mjs +0 -70
- package/scripts/lib/mcp-gateway-wrapper-check.mjs +0 -35
- package/scripts/mcp-gateway-config.mjs +0 -222
- package/scripts/mcp-gateway-ensure.mjs +0 -135
- package/scripts/mcp-gateway-integration-test.mjs +0 -262
- package/scripts/mcp-gateway-start.mjs +0 -304
- package/scripts/mcp-gateway-start.ps1 +0 -140
- package/scripts/mcp-gateway-verify.mjs +0 -79
- package/scripts/mcp-safety-guard.mjs +0 -97
- package/scripts/tfx-gate-activate.mjs +0 -98
- package/skills/merge-worktree/SKILL.md +0 -144
- package/skills/merge-worktree/skill.json +0 -5
- package/skills/star-prompt/SKILL.md +0 -220
- package/skills/star-prompt/skill.json +0 -4
- package/skills/tfx-interview/SKILL.md +0 -371
- package/skills/tfx-interview/skill.json +0 -6
- package/skills/tfx-plan/SKILL.md +0 -197
- package/skills/tfx-plan/skill.json +0 -6
- package/skills/tfx-profile/SKILL.md +0 -249
- package/skills/tfx-profile/skill.json +0 -5
package/CLAUDE.md
CHANGED
|
@@ -110,7 +110,7 @@ Codex를 SSH 너머로 직접 실행하지 않는다. `config.toml` 충돌과 TT
|
|
|
110
110
|
|
|
111
111
|
### SSH 패턴
|
|
112
112
|
|
|
113
|
-
`hosts.json`의 `os` 필드로 대상 셸을 판단한다.
|
|
113
|
+
`hosts.json`의 `os` 필드로 대상 셸을 판단한다.
|
|
114
114
|
|
|
115
115
|
| 대상 OS | 셸 | 패턴 |
|
|
116
116
|
|---------|-----|------|
|
|
@@ -157,7 +157,6 @@ Codex를 SSH 너머로 직접 실행하지 않는다. `config.toml` 충돌과 TT
|
|
|
157
157
|
- Claude 작성 코드 → Codex 리뷰
|
|
158
158
|
- Codex 작성 코드 → Claude 리뷰
|
|
159
159
|
- 동일 모델이 스스로 승인하지 않는다.
|
|
160
|
-
- git 커밋 전에 미검증 파일을 감지하면 알린다.
|
|
161
160
|
</cross-review>
|
|
162
161
|
|
|
163
162
|
<session-context>
|
package/README.ko.md
CHANGED
|
@@ -65,7 +65,6 @@ claude plugin install triflux@triflux
|
|
|
65
65
|
| `/tfx-remote` | SSH 너머 원격 Claude Code 세션. `setup`, `spawn`, `list`, `attach`, `send`, `resume`, `probe`, `kill`. |
|
|
66
66
|
| `/tfx-setup` | 대화형 설정. 파일 동기화, HUD, Codex 프로필, MCP, 훅 우선순위. |
|
|
67
67
|
| `/tfx-doctor` | 진단과 복구. Hub 시작·중지·상태 확인도 여기서 한다. |
|
|
68
|
-
| `/tfx-profile` | Codex 프로필 관리. |
|
|
69
68
|
| `/tfx-ship` | triflux 릴리즈 절차(메인테이너용). |
|
|
70
69
|
| `/tfx-wt` | Windows Terminal 탭·패인 조작. `tfx setup`은 Windows에만 설치한다. |
|
|
71
70
|
|
|
@@ -74,13 +73,12 @@ claude plugin install triflux@triflux
|
|
|
74
73
|
| 스킬 | 용도 |
|
|
75
74
|
| --- | --- |
|
|
76
75
|
| `tfx-harness` | 메타 라우팅. 요청에 맞는 스킬이나 경로를 실행 없이 하나 골라 준다. |
|
|
77
|
-
| `tfx-plan` | 여러 모델이 합의한 구현 계획(`--quick`은 가벼운 버전). |
|
|
78
76
|
| `tfx-review` | 코드 리뷰 판정(`--quick`은 가벼운 버전). |
|
|
79
77
|
| `tfx-research` | 출처를 교차 확인하는 웹 리서치(`--quick`, `--auto`, `--depth`). |
|
|
80
|
-
| `tfx-interview` | 요구사항 인터뷰. `--format goal`은 아이디어를 Claude Code `/goal` 블록으로 바꾼다. |
|
|
81
78
|
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
실행 계획은 superpowers `writing-plans`, 요구사항은 host `deep-interview`, 목표 변환은
|
|
80
|
+
Claude Code 기본 `/goal`을 쓴다. 다중모델 계획·실행은 `/tfx-auto --mode deep`으로 진행하고,
|
|
81
|
+
Codex 프로필은 `~/.codex/<프로필>.config.toml`에서 직접 관리한다.
|
|
84
82
|
|
|
85
83
|
## `/tfx-auto` 플래그
|
|
86
84
|
|
|
@@ -125,14 +123,13 @@ Codex는 이름 붙은 프로필로 실행한다. 모델 ID는 `~/.codex/<프로
|
|
|
125
123
|
|
|
126
124
|
| 명령 | 용도 |
|
|
127
125
|
| --- | --- |
|
|
128
|
-
| `tfx setup` / `tfx doctor` |
|
|
126
|
+
| `tfx setup` / `tfx doctor` | 파일·HUD·MCP·프로필 동기화 / 진단과 복구(`--fix`, `--json`) |
|
|
129
127
|
| `tfx auto` | `tfx-auto` 라우팅 판정 미리 보기 |
|
|
130
128
|
| `tfx multi` | tmux + Hub 기반 로컬 멀티 CLI 팀 |
|
|
131
129
|
| `tfx swarm` | PRD 기반 worktree 격리 실행: `plan`, `preflight`, `run`, `list` |
|
|
132
130
|
| `tfx synapse` | 스웜 세션 레지스트리와 lease |
|
|
133
131
|
| `tfx hub` | 로컬 Hub: `start`, `stop`, `status`, `ensure` |
|
|
134
132
|
| `tfx mcp` | 관리형 MCP 레지스트리: `list`, `sync`, `add`, `remove` |
|
|
135
|
-
| `tfx hooks` | 훅 오케스트레이터: scan, diff, apply, status |
|
|
136
133
|
| `tfx handoff` | 현재 맥락을 다른 세션이나 호스트로 넘길 프롬프트로 묶음 |
|
|
137
134
|
| `tfx cto` | 저장소 단위 권위 콘솔: `collect`, `status`, `dashboard`, `hygiene`, `steward`, `event` |
|
|
138
135
|
| `tfx review` / `tfx codex-team` | Codex git diff 리뷰 / Codex 주도 팀 모드 |
|
package/README.md
CHANGED
|
@@ -66,7 +66,6 @@ Skills you invoke directly:
|
|
|
66
66
|
| `/tfx-remote` | Remote Claude Code sessions over SSH: `setup`, `spawn`, `list`, `attach`, `send`, `resume`, `probe`, `kill`. |
|
|
67
67
|
| `/tfx-setup` | Interactive setup: file sync, HUD, Codex profiles, MCP, hook priority. |
|
|
68
68
|
| `/tfx-doctor` | Diagnose and repair; also starts, stops, and checks the Hub. |
|
|
69
|
-
| `/tfx-profile` | Manage Codex profiles. |
|
|
70
69
|
| `/tfx-ship` | triflux release flow (maintainers). |
|
|
71
70
|
| `/tfx-wt` | Windows Terminal tabs and panes. `tfx setup` installs it on Windows only. |
|
|
72
71
|
|
|
@@ -75,13 +74,12 @@ Internal lanes (marked `internal: true`; other skills and the router call them,
|
|
|
75
74
|
| Skill | Use |
|
|
76
75
|
| --- | --- |
|
|
77
76
|
| `tfx-harness` | Meta routing: returns which skill or path fits a request, without running it. |
|
|
78
|
-
| `tfx-plan` | Multi-model implementation plan (`--quick` for a lighter pass). |
|
|
79
77
|
| `tfx-review` | Code review verdict (`--quick` for a lighter pass). |
|
|
80
78
|
| `tfx-research` | Web research with cross-checked sources (`--quick`, `--auto`, `--depth`). |
|
|
81
|
-
| `tfx-interview` | Requirements interview; `--format goal` turns an idea into a Claude Code `/goal` block. |
|
|
82
79
|
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
Use superpowers `writing-plans` for implementation plans, host `deep-interview` for requirements,
|
|
81
|
+
and Claude Code’s built-in `/goal` for goals. Use `/tfx-auto --mode deep` for multi-model planning
|
|
82
|
+
and execution. Manage Codex profiles directly in `~/.codex/<profile>.config.toml`.
|
|
85
83
|
|
|
86
84
|
## `/tfx-auto` flags
|
|
87
85
|
|
|
@@ -126,14 +124,13 @@ escalation chain: [`.claude/rules/tfx-escalation-chain.md`](.claude/rules/tfx-es
|
|
|
126
124
|
|
|
127
125
|
| Command | Use |
|
|
128
126
|
| --- | --- |
|
|
129
|
-
| `tfx setup` / `tfx doctor` | Sync files,
|
|
127
|
+
| `tfx setup` / `tfx doctor` | Sync files, HUD, MCP, profiles / diagnose and repair (`--fix`, `--json`) |
|
|
130
128
|
| `tfx auto` | Preview the `tfx-auto` routing decision |
|
|
131
129
|
| `tfx multi` | Local multi-CLI team in tmux + Hub |
|
|
132
130
|
| `tfx swarm` | PRD-based, worktree-isolated work: `plan`, `preflight`, `run`, `list` |
|
|
133
131
|
| `tfx synapse` | Swarm session registry and leases |
|
|
134
132
|
| `tfx hub` | Local Hub: `start`, `stop`, `status`, `ensure` |
|
|
135
133
|
| `tfx mcp` | Managed MCP registry: `list`, `sync`, `add`, `remove` |
|
|
136
|
-
| `tfx hooks` | Hook orchestrator: scan, diff, apply, status |
|
|
137
134
|
| `tfx handoff` | Serialize the current context for another session or host |
|
|
138
135
|
| `tfx cto` | Repo-local authority console: `collect`, `status`, `dashboard`, `hygiene`, `steward`, `event` |
|
|
139
136
|
| `tfx review` / `tfx codex-team` | Codex git-diff review / Codex-led team mode |
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tfx-live
|
|
3
|
+
description: >
|
|
4
|
+
Claude·Codex 세션을 실시간으로 생성·질의·대기·압축·종료하거나,
|
|
5
|
+
tmux/daemon UDS 연결과 peer 중계를 운영할 때 사용한다.
|
|
6
|
+
argument-hint: "<start|ask|wait|compact|stop|rename|interrupt|probe|list-sessions|peer|converse|goal-driven|orchestrate> ..."
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# tfx-live
|
|
10
|
+
|
|
11
|
+
## Codex 호스트 계약
|
|
12
|
+
|
|
13
|
+
Codex에서는 `$tfx-live`로 호출한다. CLI의 `--cli`는 현재 호스트가 아니라 대상 세션을 선택한다.
|
|
14
|
+
|
|
15
|
+
`tfx-live`는 Claude Code와 Codex 세션을 tmux 또는 daemon UDS로 제어한다.
|
|
16
|
+
`tfx-live --help`와 `tfx-live <동사> --help`로 사용법을 확인한다.
|
|
17
|
+
|
|
18
|
+
## 전송 경로
|
|
19
|
+
|
|
20
|
+
- Claude `--short` 또는 `--session-id`는 기본 `auto`로 UDS를 먼저 시도한다. `--session`이 있고 입력 미전송이 확인된 UDS 실패라면 tmux로 전환하고 `~/.claude/cache/triflux/tfx-live/bug-reports/uds-fallback-*.json`을 남긴다. 컨텍스트 가드 거부 시에는 전환하지 않는다.
|
|
21
|
+
- Codex와 daemon 참조가 없는 Claude는 tmux가 기본이다. 기존 Codex thread의 UDS 연결은 `--transport uds --thread <id|auto>`를 명시한다.
|
|
22
|
+
- UDS 결과는 `matchedCompletion === true`일 때만 `done: true`다. timeout이나 연결 종료는 완료가 아니다.
|
|
23
|
+
- bridge 선택 순서는 `--bridge`, `$TFX_BRIDGE`, `$TFX_REPO_ROOT/hub/bridge.mjs`, 번들된 `hub/bridge.mjs`다.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
tfx-live start --cli codex --session cx1 --cwd ~/Projects --name "10.8 구현 검토"
|
|
27
|
+
tfx-live ask --cli codex --session cx1 --prompt "현재 변경사항을 요약해줘" --timeout 120
|
|
28
|
+
tfx-live stop --cli codex --session cx1
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
새 세션 이름은 `<월>.<일> <주제>`로 짓는다. `start --name`을 생략하면 자동으로 만들고 `nameGenerated: true`를 보고한다. `--resume` 또는 `--resume-last`는 `--name`을 명시한 경우에만 이름을 적용한다. 승계 세션에는 기존 이름 뒤에 ` 2`, 이후 ` 3`을 붙인다. 이름 적용을 요청한 경우 결과의 `nameApplied: false`는 적용 실패를 뜻한다. 기존 Codex UDS thread는 `tfx-live rename --cli codex --transport uds --thread ID --name "<이름>"`으로 이름을 바꾼다.
|
|
32
|
+
|
|
33
|
+
## 리드 운영
|
|
34
|
+
|
|
35
|
+
세션을 띄운 리드가 생성, 컨텍스트 관리, 수동 compact, 종료를 책임진다. 작업 연속성과 소유권을 먼저 판단하고 컨텍스트 비율은 개입 시점으로 쓴다. `--resume`은 이전 사용량을 유지하므로 재개 직후 compact 필요 여부를 확인한다.
|
|
36
|
+
|
|
37
|
+
| 동작 | 적용 조건과 실행 |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| compact | 같은 목표와 담당이 이어지고 파일과 git에서 상태를 복구할 수 있을 때. Claude는 `tfx-live compact` 또는 `/compact <보존 지침>`, Codex는 `/compact` 뒤 리드가 파일 경로와 검증 명령을 다시 전달한다. agy는 수동 compact가 없어 handoff한다. |
|
|
40
|
+
| clear | 무관한 작업으로 전환하거나 같은 문제를 두 번 넘게 고쳐도 실패할 때, 스펙에서 구현으로 또는 작성자에서 리뷰어로 바뀔 때. 미완료 상태를 정리한 뒤 Claude는 `/rename`과 `/clear`, Codex는 작업 종료 뒤 `/new <이름>`, agy는 `/clear`를 쓴다. |
|
|
41
|
+
| handoff | 담당·CLI·모델·소유자가 바뀌거나 긴 작업이 창을 넘길 때. 인계 파일에 목표, 완료 조건, 체크아웃과 변경 상태, 확정 결정, 증거 경로, PASS/FAIL/SKIP, 미완료 작업과 프로세스, 다음 행동과 소유자, `predecessorSessionId`를 적는다. 승계 세션이 경로를 확인하면 이전 세션을 닫는다. |
|
|
42
|
+
| close | 결과와 인계를 확인한 즉시 닫는다. Claude 백그라운드는 `claude stop <id>`, tmux는 `tfx-live stop --session`, Claude 팀원은 shutdown, Codex 서브에이전트는 `close_agent`, agy 서브에이전트는 `/agents` 패널의 K를 쓴다. |
|
|
43
|
+
|
|
44
|
+
두 번째 compact 전에는 handoff가 맞는지 점검한다. compact 횟수는 고정하지 않는다.
|
|
45
|
+
|
|
46
|
+
### 컨텍스트 판단
|
|
47
|
+
|
|
48
|
+
분모는 공식 모델 창이고 실행 한도가 더 작으면 그 한도 아래에서 운영한다. 아래 비율은 공식 권고가 아닌 **[추론] 운영값**이다. 모델 문서가 바뀌면 한도도 갱신한다.
|
|
49
|
+
|
|
50
|
+
| CLI | 준비와 경고 | compact | 신규 배정 중지·handoff | 전송 거부 |
|
|
51
|
+
| --- | ---: | ---: | ---: | ---: |
|
|
52
|
+
| Claude Code 1M 모델 | 60% | 75% | 85% | 90% |
|
|
53
|
+
| Codex | 15% | 18% | 20% | 22% |
|
|
54
|
+
| agy | 12% | 없음 | 15% | 18% |
|
|
55
|
+
|
|
56
|
+
Claude는 85% 도달 시 바로 handoff를 지시한다. agy 행은 운영 지침이며 `tfx-live` 전송 대상이 아니다. `model_context_window`와 `model_auto_compact_token_limit`은 올리지 않는다.
|
|
57
|
+
|
|
58
|
+
결과에는 `estimatedContextTokens`, `contextLimitTokens`, `contextLimitSource`, `contextPct`가 포함된다. Claude 실행 한도는 `executionContextLimitTokens`로 별도 보고하며 `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`이면 200,000이다. 판정에는 공식 창과 실행 한도 중 작은 값을 쓴다. 한도를 모르면 비율은 `null`로 두고 경고만 한다. 사용량이 없는 `probe`는 `context: null`이다. 컨텍스트를 확인하려면 직접 `tfx-live probe`를 실행한다. `interrupt`, 자동 `ask`의 daemon probe, `stop --short`는 transcript를 읽지 않는다.
|
|
59
|
+
|
|
60
|
+
`ask`의 `--warn-context-pct`와 `--max-context-pct`는 경고·거부 비율을 덮어쓰며 0이면 해당 가드를 끈다. 기본값은 표의 경고·전송 거부 열이다. 거부 결과는 `status: "failed"`, `done: false`, `context-limit`와 컨텍스트 필드를 돌려준다. 자세한 근거와 실측은 [컨텍스트 정책 연구](../../docs/research/tfx-live-context-policy-2026-10.md)에 둔다.
|
|
61
|
+
|
|
62
|
+
### 수동 compact와 종료
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
tfx-live compact --cli claude --session cl1 --instructions "변경 파일과 검증 명령을 보존하라" --timeout 120
|
|
66
|
+
tfx-live stop --cli claude --short <8hex>
|
|
67
|
+
tfx-live stop --cli claude --session-id <id>
|
|
68
|
+
tfx-live stop --session cl1
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`compact`는 로컬 Claude tmux `--session`에서 `/compact <instructions>`를 중계 표식 없이 보낸다. 기본 `--if-busy fail`이며 바쁜 세션에는 전송하지 않는다. 새 `compact_boundary`를 확인하면 `compacted: true`, `preTokens`, `postTokens`를 반환한다. 시간 안에 없으면 `compacted: false, timedOut: true`다. UDS compact는 지원하지 않는다.
|
|
72
|
+
|
|
73
|
+
`stop --short`와 `stop --session-id`는 `claude stop <id>`를 호출하고 `stopped: true, conversationKept: true`를 반환한다. `claude attach`로 대화를 재개할 수 있다. `/exit`, `←`, Ctrl+Z는 백그라운드 세션의 연결만 끊는다. macOS의 `sysctl -n kern.memorystatus_vm_pressure_level`이 2 이상이면 새 세션을 띄우기 전 정리한다. 원격 배정 전에는 `tfx-remote probe <host>`의 `ready`와 `warnings`를 확인한다.
|
|
74
|
+
|
|
75
|
+
## 요청과 완료 확인
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
tfx-live ask --cli claude --transport uds --short <8hex> --prompt "진행 상황을 보고해줘" --no-wait
|
|
79
|
+
tfx-live wait --cli claude --short <8hex> --request-id <requestId> --timeout 120 --poll-interval 500
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`ask --no-wait`는 `status: "submitted"`, `inputSent: true`, `done: false`, `submittedAt`, `target`, `requestId`를 반환한다. `ask`, `peer`, `converse`, `goal-driven`은 `[tfx-live req=<requestId>]`를 프롬프트 앞에 붙인다. `--no-relay-tag`로 제거하면 `wait --request-id`가 해당 요청을 찾을 수 없다.
|
|
83
|
+
|
|
84
|
+
`wait`는 Claude transcript에서 표식을 user 메시지, `queue-operation`의 `enqueue` content, queued command attachment에서 찾는다. 표식이 소비된 턴이 끝난 뒤 마지막 assistant 텍스트를 응답으로 쓴다. 표식 없는 `wait`는 최신 user turn을 본다. `isSidechain`과 합성 API 오류 메시지는 정상 응답에서 제외한다. 요청을 소비한 턴에서 합성 오류가 나타나면 오류 문구와 `status: "failed"`를 반환한다. daemon의 `idle`만으로 완료를 단정하지 않는다. timeout은 `status: "working"`, `timedOut: true`, `done: false`다. Codex UDS `wait`는 지원하지 않는다.
|
|
85
|
+
|
|
86
|
+
명시한 `--config-dir`은 정확히 일치하는 daemon만 선택한다. `CLAUDE_CONFIG_DIR`도 해당 env 디렉터리로 제한한다. stale endpoint 복구는 같은 source configDir 안에서만 재시도한다. attach 전 예외는 `inputSent: false`이므로 `auto`의 tmux fallback이 가능하다. attach 뒤 전송 여부가 불명확하면 `status: "unknown"`으로 보고하고 재전송하지 않는다.
|
|
87
|
+
|
|
88
|
+
직접 `tmux capture-pane`과 `tmux send-keys`를 쓸 때는 전송·pane 진단에 한정한다. Claude pane에 `C-c`를 보내지 않는다. 자동 세션 탐색에는 `tmr ls --json`을 사용한다.
|
|
89
|
+
|
|
90
|
+
## 세션 탐색과 연결
|
|
91
|
+
|
|
92
|
+
`tfx-live probe`는 Claude daemon을 찾는다. `tfx-live list-sessions --cli codex [--cwd DIR]`는 기존 Codex tmux pane을 찾고 `target`, `cwd`, `command`, `threadId`, `name` 등을 보고한다. `--cwd`는 pane 경로와 정확히 일치해야 한다. `tfx-live list-sessions --cli claude [--cwd DIR]`는 살아 있는 Claude pane만 찾는다. `--remote`와 `--transport uds`는 Claude tmux 탐색에 쓸 수 없다.
|
|
93
|
+
|
|
94
|
+
`ask`와 tmux `interrupt`는 세션명, `name:window`, `name:window.pane`을 받는다. `start`와 tmux `stop --session`은 세션명만 받는다. `stop`은 pane·window 대상과 `%12`, `@3` 같은 ID를 거부한다. `--remote HOST`는 대상을 그대로 원격에 전달한다.
|
|
95
|
+
|
|
96
|
+
`ask`는 pane의 작업 상태와 Codex `model: loading`을 확인한다. tmux의 `--if-busy wait|fail|interrupt` 기본값은 `wait`다. `--busy-timeout` 기본값은 `--timeout`이고 `--poll-interval`은 밀리초다. timeout이면 프롬프트를 보내지 않는다. `interrupt`는 Escape 후 idle을 기다린다. 기존 입력 초안이 있으면 붙여넣기와 합쳐질 수 있으므로 전송 전 pane을 확인한다.
|
|
97
|
+
|
|
98
|
+
### Codex UDS 스레드
|
|
99
|
+
|
|
100
|
+
공유 daemon 소켓 기본값은 `$CODEX_HOME/app-server-control/app-server-control.sock`이며 `CODEX_HOME`이 없으면 `~/.codex` 아래를 쓴다. `--codex-socket PATH|default`로 기존 소켓을 선택한다. 없으면 `codex app-server daemon start`로 시작한다.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
tfx-live list-sessions --cli codex --transport uds --cwd ~/Projects/my-worktree
|
|
104
|
+
tfx-live ask --cli codex --transport uds --thread auto --cwd ~/Projects/my-worktree --prompt "현재 변경사항을 요약해줘" --if-busy wait --timeout 120
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`--thread auto`는 선택 조건에 맞는 로드된 thread가 정확히 하나일 때만 쓴다. 여러 개면 목록에서 ID를 골라 `--thread ID`를 지정한다. UDS의 `--if-busy wait|fail|steer` 기본값은 `wait`다. `thread/resume`으로 알림을 구독한 뒤 `turn/start`를 호출하고 반환된 turn ID의 완료만 인정한다. 완료 응답은 `final_answer`를 우선하고 중간 commentary는 따로 반환한다. `--max-turn`은 활동 연장 상한을 지정한다. Codex UDS `interrupt`는 지원하지 않으므로 tmux pane이 있으면 `interrupt --session <target>`을 쓴다.
|
|
108
|
+
|
|
109
|
+
## peer와 orchestrate
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
tfx-live peer --cli-a codex --cli-b claude --session-a cx-peer --session-b cl-peer --cwd ~/Projects --mode freeform --seed "변경을 함께 검토해줘" --rounds 2 --timeout 180
|
|
113
|
+
tfx-live peer --cli-a codex --transport-a uds --thread-a <id|auto> --cli-b claude --transport-b uds --short-b <8hex> --cwd ~/Projects/my-worktree --mode freeform --seed "변경을 검토해줘"
|
|
114
|
+
tfx-live orchestrate --task "이 변경의 위험을 한 줄로" --mode peer
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`peer`는 이전 응답을 반대쪽의 다음 프롬프트로 전달한다. 기존 tmux pane은 `--attach-a`·`--attach-b`로 연결하며 종료하지 않는다. UDS 쪽도 기존 세션으로 취급한다. `--if-busy-a`·`--if-busy-b`로 각 쪽의 정책을 정한다. 소유한 세션을 실제 종료한 경우에만 `stoppedA`·`stoppedB`가 참이다.
|
|
118
|
+
|
|
119
|
+
`orchestrate`의 `--mode`는 `peer|codex-led|claude-led`다. Claude 쪽은 살아 있는 daemon이 필요하다. Codex는 기본 `exec` 경로 또는 실험적 `--codex-transport app-server-uds`를 쓴다. `--codex-socket PATH|default`는 기존 app-server daemon에 연결하고 새 임시 thread를 만든다.
|
|
120
|
+
|
|
121
|
+
## 진단
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
tfx-live --help
|
|
125
|
+
tfx-live probe
|
|
126
|
+
tfx-live list-sessions --cli codex
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`auto`가 tmux로 전환되면 `~/.claude/cache/triflux/tfx-live/bug-reports/uds-fallback-*.json`을 확인한다. 테스트에서는 `$TFX_LIVE_BUG_REPORT_DIR`로 위치를 바꿀 수 있다.
|