triflux 10.53.0 → 10.55.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.
Files changed (127) hide show
  1. package/README.ko.md +10 -16
  2. package/README.md +13 -19
  3. package/adapters/codex/skills/tfx-live/SKILL.md +3 -3
  4. package/bin/tfx-live.mjs +10 -6
  5. package/bin/triflux.mjs +174 -127
  6. package/config/mcp-registry.json +1 -1
  7. package/hooks/codex-session-hook.mjs +1 -17
  8. package/hub/cli-adapter-base.mjs +3 -424
  9. package/hub/lib/hosts-compat.mjs +18 -64
  10. package/hub/lib/private-tmp.mjs +35 -0
  11. package/hub/lib/process-utils.mjs +19 -220
  12. package/hub/lib/prompt-tmp.mjs +6 -24
  13. package/hub/lib/spawn-trace.mjs +112 -5
  14. package/hub/lib/timeout-defaults.mjs +34 -6
  15. package/hub/lib/worker-lifecycle.mjs +3 -0
  16. package/hub/platform.mjs +3 -1
  17. package/hub/team/backend.mjs +10 -3
  18. package/hub/team/cli/commands/start/index.mjs +0 -2
  19. package/hub/team/codex-queue.mjs +49 -2
  20. package/hub/team/handoff.mjs +1 -1
  21. package/hub/team/headless.mjs +41 -57
  22. package/hub/team/intervention.mjs +6 -4
  23. package/hub/team/nativeProxy.mjs +2 -48
  24. package/hub/team/pane.mjs +31 -18
  25. package/hub/team/psmux.mjs +36 -20
  26. package/hub/team/remote-session.mjs +66 -56
  27. package/hub/team/retry-state-machine.mjs +1 -1
  28. package/hub/team/session.mjs +80 -59
  29. package/hub/team/terminal-opener.mjs +5 -19
  30. package/hub/team/tui-viewer.mjs +2 -2
  31. package/hub/team/tui.mjs +0 -6
  32. package/hub/workers/factory.mjs +1 -10
  33. package/hub/workers/interface.mjs +0 -7
  34. package/hud/constants.mjs +0 -3
  35. package/hud/providers/claude.mjs +35 -15
  36. package/hud/providers/codex.mjs +169 -42
  37. package/hud/utils.mjs +0 -23
  38. package/package.json +4 -11
  39. package/scripts/check-codex-config-stable.mjs +2 -11
  40. package/scripts/config-audit.mjs +0 -2
  41. package/scripts/doctor-diagnose.mjs +25 -20
  42. package/scripts/ensure-codex-hooks.mjs +70 -24
  43. package/scripts/lib/backup-rotation.mjs +60 -0
  44. package/scripts/lib/codex-profile-config.mjs +20 -7
  45. package/scripts/lib/codex-recovery.sh +2 -3
  46. package/scripts/lib/install-blob-history.json +3196 -0
  47. package/scripts/lib/install-retire.mjs +203 -0
  48. package/scripts/lib/legacy-hook-cleanup.mjs +148 -13
  49. package/scripts/lib/legacy-mcp-cleanup.mjs +405 -104
  50. package/scripts/lib/machine-profile.mjs +2 -2
  51. package/scripts/lib/mcp-filter.mjs +1 -42
  52. package/scripts/lib/mcp-guard-engine.mjs +198 -19
  53. package/scripts/lib/mcp-manifest.mjs +0 -40
  54. package/scripts/lib/process-utils.mjs +19 -0
  55. package/scripts/lib/stable-node.mjs +35 -0
  56. package/scripts/lib/test-env.mjs +20 -0
  57. package/scripts/lib/tmr-install.mjs +183 -0
  58. package/scripts/lint-private-info.mjs +137 -0
  59. package/scripts/mcp-check.mjs +24 -18
  60. package/scripts/pack.mjs +29 -42
  61. package/scripts/release/check-packages-mirror.mjs +77 -125
  62. package/scripts/release/lib.mjs +1 -1
  63. package/scripts/release/prepare.mjs +2 -0
  64. package/scripts/release/resolve-auto-release.mjs +11 -0
  65. package/scripts/release/version-manifest.json +7 -1
  66. package/scripts/remote-spawn.mjs +226 -116
  67. package/scripts/session-stale-cleanup.mjs +124 -75
  68. package/scripts/setup.mjs +414 -377
  69. package/scripts/test-lock.mjs +62 -8
  70. package/scripts/tfx-route-post.mjs +30 -4
  71. package/scripts/tfx-route.sh +73 -25
  72. package/scripts/tmp-cleanup.mjs +16 -3
  73. package/skills/tfx-auto/SKILL.md +12 -5
  74. package/skills/tfx-lead/SKILL.md +6 -6
  75. package/skills/tfx-live/SKILL.md +3 -3
  76. package/skills/tfx-remote/SKILL.md +2 -2
  77. package/skills/tfx-research/SKILL.md +10 -7
  78. package/skills/tfx-review/SKILL.md +14 -3
  79. package/skills/tfx-ship/SKILL.md +1 -1
  80. package/CLAUDE.md +0 -194
  81. package/cto/brief.mjs +0 -73
  82. package/cto/collect.mjs +0 -490
  83. package/cto/current.schema.json +0 -148
  84. package/cto/events.mjs +0 -208
  85. package/cto/hygiene.mjs +0 -320
  86. package/cto/index.mjs +0 -46
  87. package/cto/lake-root.mjs +0 -127
  88. package/cto/status.mjs +0 -124
  89. package/docs/assets/demo-multi.gif +0 -0
  90. package/hooks/agy-session-hook.mjs +0 -155
  91. package/hooks/claude-cwd-projection-refresh.mjs +0 -11
  92. package/hooks/hook-orchestrator.mjs +0 -11
  93. package/hooks/lib/resolve-root.mjs +0 -62
  94. package/hub/codex-adapter.mjs +0 -193
  95. package/hub/codex-preflight.mjs +0 -219
  96. package/hub/lib/cto-env.mjs +0 -70
  97. package/hub/team/notify.mjs +0 -385
  98. package/hub/team/process-cleanup.mjs +0 -386
  99. package/hub/team/routing.mjs +0 -249
  100. package/hub/team/staleState.mjs +0 -403
  101. package/hub/team/worker-signal.mjs +0 -263
  102. package/hub/team/worker-signal.types.d.ts +0 -52
  103. package/hub/workers/codex-mcp.mjs +0 -853
  104. package/references/codex-plugin-cc-analysis.md +0 -701
  105. package/references/codex-plugin-cc-code-patterns.md +0 -468
  106. package/scripts/__tests__/ensure-codex-hooks.test.mjs +0 -183
  107. package/scripts/__tests__/lint-skills.test.mjs +0 -169
  108. package/scripts/__tests__/mcp-guard-engine-http-headers.test.mjs +0 -223
  109. package/scripts/__tests__/mcp-guard-engine-policy-sync.test.mjs +0 -185
  110. package/scripts/__tests__/mcp-guard-engine-proactive-sync.test.mjs +0 -206
  111. package/scripts/__tests__/mcp-guard-engine-stdio-sync.test.mjs +0 -186
  112. package/scripts/__tests__/mcp-guard-engine-sync-http-headers.test.mjs +0 -270
  113. package/scripts/__tests__/mcp-guard-engine.test.mjs +0 -376
  114. package/scripts/__tests__/release-governance.test.mjs +0 -732
  115. package/scripts/__tests__/release-publish-ancestor.test.mjs +0 -67
  116. package/scripts/__tests__/release-verify-wait.test.mjs +0 -169
  117. package/scripts/__tests__/remote-spawn-transfer.test.mjs +0 -128
  118. package/scripts/__tests__/remote-spawn.test.mjs +0 -98
  119. package/scripts/__tests__/resolve-auto-release.test.mjs +0 -216
  120. package/scripts/__tests__/setup-cleanup-stale-skills.test.mjs +0 -86
  121. package/scripts/__tests__/spawn-trace.test.mjs +0 -269
  122. package/scripts/__tests__/tfx-doctor-diagnose.test.mjs +0 -58
  123. package/scripts/claudemd-sync.mjs +0 -157
  124. package/scripts/ensure-agy-hooks.mjs +0 -163
  125. package/scripts/lib/remote-spawn-transfer.mjs +0 -226
  126. package/scripts/lib/session-presence.mjs +0 -151
  127. package/scripts/mcp-cleanup.ps1 +0 -26
package/README.ko.md CHANGED
@@ -18,10 +18,6 @@
18
18
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-374151?style=flat-square" alt="License: MIT"></a>
19
19
  </p>
20
20
 
21
- <p align="center">
22
- <img alt="triflux demo" src="docs/assets/demo-multi.gif" width="680">
23
- </p>
24
-
25
21
  triflux는 코딩 작업을 Claude, Codex, Antigravity 사이에서 나눠 맡기는 Claude Code 플러그인이자
26
22
  npm CLI다. `/tfx-auto`에 할 일을 한 번 적으면 triflux가 CLI 레인(기본은 Codex)을 고르고, 임의
27
23
  셸 명령 대신 관리된 경로로 실행한다. 필요하면 로컬 병렬 워커, Claude↔Codex 라이브 세션, 원격 호스트로 작업을 나눈다.
@@ -135,7 +131,6 @@ Codex는 이름 붙은 프로필로 실행한다. 모델 ID는 `~/.codex/<프로
135
131
  | `tfx setup` / `tfx doctor` | 파일·HUD·MCP·프로필 동기화 / 진단과 복구(`--fix`, `--json`) |
136
132
  | `tfx multi` | tmux 기반 로컬 멀티 CLI 팀 |
137
133
  | `tfx mcp` | 관리형 MCP 레지스트리: `list`, `sync`, `add`, `remove` |
138
- | `tfx cto` | 저장소 단위 권위 콘솔: `collect`, `status`, `hygiene`(dry-run) |
139
134
  | `bash ~/.claude/scripts/tfx-route.sh code-reviewer "<지시>"` | 정책에 따라 `codex exec review`로 리뷰 전달 |
140
135
  | `tfx list`, `tfx update`, `tfx version` | 설치된 스킬, 업데이트, 버전 |
141
136
  | `tfx-live` | 라이브 세션 브리지(`/tfx-live` 스킬과 같은 명령) |
@@ -146,7 +141,7 @@ Codex는 이름 붙은 프로필로 실행한다. 모델 ID는 `~/.codex/<프로
146
141
 
147
142
  **라이브 세션.** `tfx-live`는 Claude Code와 Codex TUI 세션을 조종한다. Claude 데몬 대상
148
143
  (`--short`/`--session-id`)은 UDS를 먼저 시도하고, `--session`도 주면 실패 시 tmux로 넘어간다.
149
- Codex `ask`는 `codex queue`로 메시지를 쌓고(TUI에 `[from <보낸 세션>]` 첫 줄로 보인다) 못 쓰면 이유를
144
+ Codex `ask`는 Codex 큐(app-server `thread/queue/add`)에 메시지를 쌓고(TUI에 `[from <보낸 세션>]` 첫 줄로 보인다) 못 쓰면 이유를
150
145
  남기고 tmux로 보낸다. `--transport uds --thread <id|auto>`로 UDS도 쓸 수 있다. `peer`는 두 세션 사이를
151
146
  `--rounds`만큼 중계한다. triflux의 Codex
152
147
  훅이 실행 중인 Codex 세션을 `~/.local/state/triflux/codex-sessions/`에 기록하므로
@@ -169,11 +164,6 @@ Claude Code Bash 도구의 600초 제한에 걸리지 않는다. 이후 `--job-s
169
164
  다른 경로로 넘어가지 않고 실패한다. 자세한 내용은
170
165
  [`.claude/rules/tfx-machine-profile.md`](.claude/rules/tfx-machine-profile.md).
171
166
 
172
- **CTO lake.** `tfx cto collect`로 `.triflux/lake/`의 저장소 스냅샷을 갱신하고,
173
- `tfx cto status`로 생성 시각과 경과 시간을 확인한다. `tfx cto hygiene --dry-run`는 dry-run 결과를
174
- 보고한다. 트레이와 쓰이지 않는 CTO 운영 명령은 제거하였다
175
- ([ADR-0024](docs/adr/0024-cto-explicit-queries-only.md)). 자동 수집은 기본으로 꺼져 있고 `TFX_CTO_AUTO_COLLECT=1` 로 켠다([ADR-0018](docs/_archive/adr/0018-cto-auto-behaviors-opt-in.md)).
176
-
177
167
  **원격 호스트.** `/tfx-remote`는 `~/.config/triflux/hosts.json`
178
168
  (Windows는 `%APPDATA%\triflux\hosts.json`)에서 호스트를 읽는다. 세션 시작은
179
169
  `remote-spawn.mjs`의 `--host <host> --prompt "<요청>"` 옵션을 사용한다.
@@ -184,18 +174,22 @@ Claude Code Bash 도구의 600초 제한에 걸리지 않는다. 이후 `--job-s
184
174
  ```mermaid
185
175
  graph TD
186
176
  User([Claude Code 프롬프트 / 셸]) --> Skills["/tfx-auto · /tfx-live · /tfx-remote"]
177
+ User --> Lead["/tfx-lead"]
187
178
  User --> CLI[tfx CLI]
179
+ Lead -->|"지시서, 교차 리뷰, 머지"| Live
188
180
  Skills --> Route[tfx-route.sh]
189
181
  Skills --> Live[tfx-live]
190
182
  CLI --> Team["tfx multi"]
191
183
  Route --> Codex[Codex CLI]
192
184
  Route --> Agy[Antigravity agy]
193
185
  Route --> Claude[Claude Code]
194
- Team --> Route
195
- Live -->|UDS 또는 tmux| Sessions[Claude / Codex TUI 세션]
196
- Route --> UI["HUD · claude agents 패널"]
197
- Team --> UI
198
- CLI --> Lake[(".triflux/lake (tfx cto)")]
186
+ Team -->|headless 워커| Route
187
+ Team --> Index[("결과 색인: tfx-headless/*.results.json")]
188
+ Team --> Rows["claude agents 행"]
189
+ Rows -->|Enter| Room["워커 tmux 방"]
190
+ Live -->|"codex queue, tmux 폴백"| CodexTUI[Codex TUI 세션]
191
+ Live -->|"UDS 또는 tmux"| ClaudeTUI[Claude Code 세션]
192
+ Route --> HUD[HUD]
199
193
  ```
200
194
 
201
195
  패키지 구성과 실행 경로는 [ARCHITECTURE.md](ARCHITECTURE.md), 문서 지도는
package/README.md CHANGED
@@ -18,10 +18,6 @@
18
18
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-374151?style=flat-square" alt="License: MIT"></a>
19
19
  </p>
20
20
 
21
- <p align="center">
22
- <img alt="triflux demo" src="docs/assets/demo-multi.gif" width="680">
23
- </p>
24
-
25
21
  triflux is a Claude Code plugin and npm CLI that routes coding work across Claude, Codex,
26
22
  and Antigravity. You describe the task once with `/tfx-auto`; triflux picks the CLI lane
27
23
  (Codex by default), runs it through managed routes instead of ad-hoc shell commands, and
@@ -137,7 +133,6 @@ escalation chain: [`.claude/rules/tfx-escalation-chain.md`](.claude/rules/tfx-es
137
133
  | `tfx setup` / `tfx doctor` | Sync files, HUD, MCP, profiles / diagnose and repair (`--fix`, `--json`) |
138
134
  | `tfx multi` | Local multi-CLI team in tmux |
139
135
  | `tfx mcp` | Managed MCP registry: `list`, `sync`, `add`, `remove` |
140
- | `tfx cto` | Repo-local authority console: `collect`, `status`, `hygiene` (dry-run) |
141
136
  | `bash ~/.claude/scripts/tfx-route.sh code-reviewer "<instruction>"` | Send review to Codex (`codex exec review` via policy) |
142
137
  | `tfx list`, `tfx update`, `tfx version` | Installed skills, update, version |
143
138
  | `tfx-live` | Live session bridge (same as the `/tfx-live` skill) |
@@ -148,7 +143,7 @@ escalation chain: [`.claude/rules/tfx-escalation-chain.md`](.claude/rules/tfx-es
148
143
 
149
144
  **Live sessions.** `tfx-live` drives Claude Code and Codex TUI sessions. Claude daemon targets
150
145
  (`--short`/`--session-id`) try UDS first and fall back to tmux when `--session` is also given;
151
- Codex `ask` queues the message with `codex queue` (shown in the TUI with a
146
+ Codex `ask` queues the message through the app-server `thread/queue/add` API (shown in the TUI with a
152
147
  `[from <sender>]` first line) and falls back to tmux with a reported reason; UDS stays available with
153
148
  `--transport uds --thread <id|auto>`. `peer` relays between two sessions for `--rounds`. triflux's Codex hook records running Codex
154
149
  sessions under `~/.local/state/triflux/codex-sessions/`, so `tfx-live list-sessions --cli codex|claude`
@@ -171,32 +166,31 @@ tmux pane the worker runs in.
171
166
  removes a CLI from routing; if no allowed CLI is available the route fails instead of silently
172
167
  falling back. Details: [`.claude/rules/tfx-machine-profile.md`](.claude/rules/tfx-machine-profile.md).
173
168
 
174
- **CTO lake.** Run `tfx cto collect` to refresh the repo snapshot in `.triflux/lake/`, then
175
- `tfx cto status` to inspect it with its generation time and age. `tfx cto hygiene --dry-run` reports
176
- dry-run findings. The tray and unused CTO operating commands were removed
177
- ([ADR-0024](docs/adr/0024-cto-explicit-queries-only.md)). Automatic collection stays off unless `TFX_CTO_AUTO_COLLECT=1` is set ([ADR-0018](docs/_archive/adr/0018-cto-auto-behaviors-opt-in.md)).
178
-
179
- **원격 호스트.** `/tfx-remote`는 `~/.config/triflux/hosts.json`에서 호스트를 읽는다
180
- (Windows: `%APPDATA%\triflux\hosts.json`). 세션 시작은 `remote-spawn.mjs`의
181
- `--host <host> --prompt "<요청>"` 옵션을 사용한다. [실행 옵션](skills/tfx-remote/SKILL.md)을 따른다.
169
+ **Remote hosts.** `/tfx-remote` reads hosts from `~/.config/triflux/hosts.json`
170
+ (Windows: `%APPDATA%\triflux\hosts.json`). Start a session with `remote-spawn.mjs`
171
+ `--host <host> --prompt "<request>"`. Options: [skills/tfx-remote/SKILL.md](skills/tfx-remote/SKILL.md).
182
172
 
183
173
  ## Architecture
184
174
 
185
175
  ```mermaid
186
176
  graph TD
187
177
  User([Claude Code prompt / shell]) --> Skills["/tfx-auto · /tfx-live · /tfx-remote"]
178
+ User --> Lead["/tfx-lead"]
188
179
  User --> CLI[tfx CLI]
180
+ Lead -->|"briefs, cross review, merge"| Live
189
181
  Skills --> Route[tfx-route.sh]
190
182
  Skills --> Live[tfx-live]
191
183
  CLI --> Team["tfx multi"]
192
184
  Route --> Codex[Codex CLI]
193
185
  Route --> Agy[Antigravity agy]
194
186
  Route --> Claude[Claude Code]
195
- Team --> Route
196
- Live -->|UDS or tmux| Sessions[Claude / Codex TUI sessions]
197
- Route --> UI["HUD · claude agents panel"]
198
- Team --> UI
199
- CLI --> Lake[(".triflux/lake (tfx cto)")]
187
+ Team -->|headless workers| Route
188
+ Team --> Index[("results index: tfx-headless/*.results.json")]
189
+ Team --> Rows["claude agents rows"]
190
+ Rows -->|Enter| Room["worker tmux room"]
191
+ Live -->|"codex queue, tmux fallback"| CodexTUI[Codex TUI sessions]
192
+ Live -->|"UDS or tmux"| ClaudeTUI[Claude Code sessions]
193
+ Route --> HUD[HUD]
200
194
  ```
201
195
 
202
196
  Package layout and execution paths: [ARCHITECTURE.md](ARCHITECTURE.md). Documentation map:
@@ -18,7 +18,7 @@ Codex에서는 `$tfx-live`로 호출한다. CLI의 `--cli`는 현재 호스트
18
18
  ## 전송 경로
19
19
 
20
20
  - Claude `--short` 또는 `--session-id`는 기본 `auto`로 UDS를 먼저 시도한다. `--session`이 있고 입력 미전송이 확인된 UDS 실패라면 tmux로 전환하고 `~/.claude/cache/triflux/tfx-live/bug-reports/uds-fallback-*.json`을 남긴다. 컨텍스트 가드 거부 시에는 전환하지 않는다.
21
- - Codex `ask`는 `codex queue`가 기본이다. 아래 "Codex 메시지 전송" 순서를 따른다. 기존 Codex thread의 UDS 연결은 `--transport uds --thread <id|auto>`를 명시한다.
21
+ - Codex `ask`는 Codex 큐(app-server `thread/queue/add`)가 기본이다. 아래 "Codex 메시지 전송" 순서를 따른다. 기존 Codex thread의 UDS 연결은 `--transport uds --thread <id|auto>`를 명시한다.
22
22
  - daemon 참조가 없는 Claude는 tmux가 기본이다.
23
23
  - UDS 결과는 `matchedCompletion === true`일 때만 `done: true`다. timeout이나 연결 종료는 완료가 아니다.
24
24
  - bridge 선택 순서는 `--bridge`, `$TFX_BRIDGE`, `$TFX_REPO_ROOT/hub/bridge.mjs`, 번들된 `hub/bridge.mjs`다.
@@ -48,7 +48,7 @@ tfx-live stop --cli codex --session cx1
48
48
 
49
49
  ### Codex 메시지 전송
50
50
 
51
- 1. 기본은 `codex queue --thread <UUID>`다. 입력창을 건드리지 않고, 바쁘면 쌓였다가 앞 턴이 끝난 직후 순서대로 들어간다. 유휴 TUI는 약 20초 주기로 큐를 가져간다.
51
+ 1. 기본은 app-server 실험 API `thread/queue/add`로 쌓는 것이다. 프롬프트가 프로세스 인자에 보이지 않는다. 입력창을 건드리지 않고, 바쁘면 쌓였다가 앞 턴이 끝난 직후 순서대로 들어간다. 유휴 TUI는 약 20초 주기로 큐를 가져간다. add가 없는 Codex에서만 `codex queue --thread <UUID> --message`로 보내며, 이때 프롬프트가 argv에 보이고 결과에 `queueVia: "codex-queue-argv"`와 `queueFallbackReason`이 남는다. 평소 값은 `queueVia: "app-server"`다.
52
52
  2. 첫 줄 머리말은 `[from <보낸 세션 이름>] [tfx-live req=<id>]`다. 이름은 `--from`, `$TFX_LIVE_FROM`, Claude 세션 기록, Codex `session_index` 순으로 찾고 없으면 머리말 없이 표식만 붙인다. Codex TUI는 Claude처럼 접어 보여 주지 않고 사용자 입력으로 그대로 표시한다.
53
53
  3. thread는 `--thread UUID`, `start`가 남긴 `@tfx_codex_thread`, Codex 세션 레지스트리, pane 프로세스의 `resume <UUID>` 인자, pane cwd와 같은 rollout 하나 순으로 찾는다. cwd 대응은 그 cwd의 Codex TUI가 하나일 때만 쓰고 exec 워커와 서브에이전트 thread는 뺀다. 이름으로는 보내지 않는다(`codex queue`의 이름 조회가 실패한다).
54
54
  4. tmux 직접 입력은 queue를 못 쓸 때만 쓴다: 원격 호스트, thread를 못 찾음(`start` 밖에서 `resume --last`로 띄운 세션, `start --resume-last`의 `threadId: null`, 같은 cwd의 TUI 여럿 포함), `codex queue` 오류(0.160 미만 포함). 결과에 `transport: "tmux"`, `transportRequested: "queue"`, `fallbackReason`이 남는다. 시간 초과처럼 queue가 이미 쌓았을 수도 있는 오류는 `status: "unknown"`으로 끝내고 재전송하지 않는다.
@@ -114,7 +114,7 @@ Codex `wait`는 `--session` 또는 `--thread UUID`의 rollout에서 표식이
114
114
 
115
115
  명시한 `--config-dir`은 정확히 일치하는 daemon만 선택한다. `CLAUDE_CONFIG_DIR`도 해당 env 디렉터리로 제한한다. stale endpoint 복구는 같은 source configDir 안에서만 재시도한다. attach 전 예외는 `inputSent: false`이므로 `auto`의 tmux fallback이 가능하다. attach 뒤 전송 여부가 불명확하면 `status: "unknown"`으로 보고하고 재전송하지 않는다.
116
116
 
117
- 직접 `tmux capture-pane`과 `tmux send-keys`를 쓸 때는 전송·pane 진단에 한정한다. Claude pane에 `C-c`를 보내지 않는다. 자동 세션 탐색에는 `tmr ls --json`을 사용한다.
117
+ 직접 `tmux capture-pane`과 `tmux send-keys`를 쓸 때는 전송·pane 진단에 한정한다. Claude pane에 `C-c`를 보내지 않는다. 자동 세션 탐색에는 `tmr ls --json`으로 pane 별 에이전트, 상태, 클라이언트 수, 마지막 활동을 본다. tmr 이 없으면 아래 `tfx-live list-sessions`와 `tmux ls -F '#{session_name} #{session_attached}'`를 쓴다. tmr 은 macOS(arm64) 에서 `tfx setup` 이 설치를 묻는다.
118
118
 
119
119
  ## 세션 탐색과 연결
120
120
 
package/bin/tfx-live.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  stat,
12
12
  writeFile,
13
13
  } from "node:fs/promises";
14
- import { homedir, tmpdir } from "node:os";
14
+ import { homedir } from "node:os";
15
15
  import { join as pathJoin, resolve as pathResolve } from "node:path";
16
16
  import { fileURLToPath } from "node:url";
17
17
  import { promisify } from "node:util";
@@ -20,6 +20,7 @@ import {
20
20
  readCodexSessionRecords,
21
21
  registryDir,
22
22
  } from "../hub/lib/codex-session-registry.mjs";
23
+ import { privateTmpDir } from "../hub/lib/private-tmp.mjs";
23
24
  import { resolveHardCeilingMs } from "../hub/lib/worker-lifecycle.mjs";
24
25
  import { exposeLiveSession } from "../hub/team/agents-row.mjs";
25
26
  import {
@@ -94,7 +95,7 @@ function usage(command) {
94
95
  " tfx-live start --session NAME [--name NAME] [--cli codex|claude] [--model ID] [--effort TIER] [--cwd DIR] [--remote HOST] [--resume ID] [--resume-last 1] [--ready-timeout 30] [--poll-interval 1500]",
95
96
  " tfx-live ask --session NAME[:WINDOW.PANE] --prompt TEXT [--cli codex|claude] [--if-busy wait|fail|interrupt] [--busy-timeout 60] [--timeout 60] [--remote HOST] [--settle 1500] [--poll-interval 1500]",
96
97
  " tfx-live ask --cli codex [--transport queue|tmux] (--session NAME[:WINDOW.PANE] | --thread UUID) --prompt TEXT [--from NAME] [--timeout 60] [--no-wait]",
97
- " Codex ask defaults to `codex queue` (queued, delivered when the TUI picks it up); tmux paste is the reported fallback and the path for slash commands.",
98
+ " Codex ask defaults to the app-server queue (thread/queue/add, `codex queue --message` only when add is unavailable; delivered when the TUI picks it up); tmux paste is the reported fallback and the path for slash commands.",
98
99
  " tfx-live ask --cli codex --transport uds --thread ID|auto --prompt TEXT [--codex-socket PATH|default] [--cwd DIR] [--if-busy wait|fail|steer] [--busy-timeout 60] [--timeout 60] [--max-turn SECONDS]",
99
100
  " tfx-live ask --transport uds|auto (--short SHORT | --session-id ID) --prompt TEXT [--config-dir DIR] [--bridge ABS] [--session NAME (auto fallback)] [--timeout 60]",
100
101
  " ask options: --no-wait --no-relay-tag --warn-context-pct N --max-context-pct N (0 disables; Claude 60/90, Codex 15/22).",
@@ -1932,8 +1933,9 @@ async function callBridgeVerb(bridgePath, verb, payload, timeoutMs) {
1932
1933
  let payloadFile = null;
1933
1934
  let args;
1934
1935
  if (json.length > PAYLOAD_FILE_THRESHOLD) {
1936
+ // 페이로드에 프롬프트가 들어 있어 사용자별 0700 디렉터리에 쓴다.
1935
1937
  payloadFile = pathJoin(
1936
- tmpdir(),
1938
+ privateTmpDir("tfx-live"),
1937
1939
  `codex-live-payload-${process.pid}-${Date.now()}.json`,
1938
1940
  );
1939
1941
  await writeFile(payloadFile, json, "utf8");
@@ -2723,6 +2725,10 @@ async function doAskViaQueue(adapter, opts, deps = {}) {
2723
2725
  ok: true,
2724
2726
  inputSent: true,
2725
2727
  queuedMessageId: queued.queuedMessageId,
2728
+ queueVia: queued.via,
2729
+ ...(queued.fallbackReason
2730
+ ? { queueFallbackReason: queued.fallbackReason }
2731
+ : {}),
2726
2732
  submittedAt: new Date().toISOString(),
2727
2733
  };
2728
2734
  // 표식이 없으면 rollout 에서 이 요청의 턴을 가려낼 수 없다.
@@ -4098,13 +4104,11 @@ function peerArtifactPaths(sessionA, sessionB) {
4098
4104
  const preferredDir =
4099
4105
  process.env.TFX_LIVE_ARTIFACT_DIR ??
4100
4106
  pathJoin(homedir(), ".claude", "cache", "triflux", "tfx-live", "peer-runs");
4101
- const fallbackDir = pathJoin(tmpdir(), "triflux-live");
4102
4107
  let artifactDir = preferredDir;
4103
4108
  try {
4104
4109
  mkdirSync(artifactDir, { recursive: true });
4105
4110
  } catch {
4106
- artifactDir = fallbackDir;
4107
- mkdirSync(artifactDir, { recursive: true });
4111
+ artifactDir = privateTmpDir("tfx-live");
4108
4112
  }
4109
4113
  const safe = (value) =>
4110
4114
  String(value)