triflux 4.2.3 → 4.2.6

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 (81) hide show
  1. package/bin/tfx-doctor.mjs +1 -1
  2. package/bin/tfx-setup.mjs +1 -1
  3. package/bin/triflux.mjs +2 -14
  4. package/hub/server.mjs +3 -2
  5. package/hub/team/native.mjs +58 -47
  6. package/hub/workers/delegator-mcp.mjs +17 -5
  7. package/package.json +62 -62
  8. package/scripts/lib/mcp-filter.mjs +34 -8
  9. package/scripts/setup.mjs +21 -16
  10. package/scripts/tfx-route.sh +14 -8
  11. package/scripts/token-snapshot.mjs +561 -561
  12. package/skills/tfx-auto/SKILL.md +1 -1
  13. package/skills/tfx-codex/SKILL.md +1 -1
  14. package/skills/tfx-gemini/SKILL.md +1 -1
  15. package/skills/tfx-hub/SKILL.md +4 -1
  16. package/skills/tfx-multi/SKILL.md +177 -378
  17. package/skills/tfx-multi/references/agent-wrapper-rules.md +81 -0
  18. package/skills/tfx-multi/references/thorough-pipeline.md +66 -0
  19. package/skills/tfx-workspace/evals/evals.json +79 -0
  20. package/skills/tfx-workspace/iteration-1/benchmark.json +162 -0
  21. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/eval_metadata.json +11 -0
  22. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/grading.json +9 -0
  23. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/outputs/analysis.md +154 -0
  24. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/timing.json +5 -0
  25. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/grading.json +9 -0
  26. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/outputs/analysis.md +126 -0
  27. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/timing.json +5 -0
  28. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/eval_metadata.json +11 -0
  29. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/grading.json +9 -0
  30. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/outputs/analysis.md +119 -0
  31. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/timing.json +5 -0
  32. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/grading.json +9 -0
  33. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/outputs/analysis.md +115 -0
  34. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/timing.json +5 -0
  35. package/skills/tfx-workspace/iteration-1/hub-start-sequence/eval_metadata.json +10 -0
  36. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/grading.json +8 -0
  37. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/outputs/analysis.md +86 -0
  38. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/timing.json +5 -0
  39. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/grading.json +8 -0
  40. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/outputs/analysis.md +81 -0
  41. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/timing.json +5 -0
  42. package/skills/tfx-workspace/iteration-1/multi-team-creation/eval_metadata.json +12 -0
  43. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/grading.json +10 -0
  44. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/outputs/analysis.md +316 -0
  45. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/timing.json +5 -0
  46. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/grading.json +10 -0
  47. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/outputs/analysis.md +352 -0
  48. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/timing.json +5 -0
  49. package/skills/tfx-workspace/iteration-1/review.html +1325 -0
  50. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/eval_metadata.json +12 -0
  51. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/grading.json +10 -0
  52. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/outputs/analysis.md +97 -0
  53. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/timing.json +5 -0
  54. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/grading.json +10 -0
  55. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/outputs/analysis.md +94 -0
  56. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/timing.json +5 -0
  57. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/eval_metadata.json +12 -0
  58. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/grading.json +10 -0
  59. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/outputs/analysis.md +209 -0
  60. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/timing.json +5 -0
  61. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/grading.json +10 -0
  62. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/outputs/analysis.md +193 -0
  63. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/timing.json +5 -0
  64. package/skills/tfx-workspace/iteration-2/benchmark.json +62 -0
  65. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/eval_metadata.json +13 -0
  66. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/grading.json +11 -0
  67. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/outputs/analysis.md +382 -0
  68. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/timing.json +5 -0
  69. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/grading.json +11 -0
  70. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/outputs/analysis.md +333 -0
  71. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/timing.json +5 -0
  72. package/skills/tfx-workspace/iteration-2/review.html +1325 -0
  73. package/skills/tfx-workspace/skill-snapshot/tfx-auto/SKILL.md +217 -0
  74. package/skills/tfx-workspace/skill-snapshot/tfx-auto-codex/SKILL.md +77 -0
  75. package/skills/tfx-workspace/skill-snapshot/tfx-codex/SKILL.md +65 -0
  76. package/skills/tfx-workspace/skill-snapshot/tfx-doctor/SKILL.md +94 -0
  77. package/skills/tfx-workspace/skill-snapshot/tfx-gemini/SKILL.md +82 -0
  78. package/skills/tfx-workspace/skill-snapshot/tfx-hub/SKILL.md +133 -0
  79. package/skills/tfx-workspace/skill-snapshot/tfx-multi/SKILL.md +426 -0
  80. package/skills/tfx-workspace/skill-snapshot/tfx-setup/SKILL.md +101 -0
  81. package/scripts/psmux-steering-prototype.sh +0 -368
@@ -1,368 +0,0 @@
1
- #!/usr/bin/env bash
2
- # psmux-steering-prototype.sh
3
- # Windows psmux 환경에서 lead/codex-worker/gemini-worker pane을 만들고
4
- # send-keys + pipe-pane 기반으로 실시간 CLI 스티어링을 실험하는 프로토타입.
5
-
6
- set -euo pipefail
7
-
8
- PSMUX_BIN="${PSMUX_BIN:-psmux}"
9
- SESSION_NAME="${PSMUX_SESSION_NAME:-triflux-steering}"
10
- WINDOW_NAME="${PSMUX_WINDOW_NAME:-control}"
11
- PANE_LEAD="lead"
12
- PANE_CODEX="codex-worker"
13
- PANE_GEMINI="gemini-worker"
14
- SHELL_COMMAND="${PSMUX_SHELL_COMMAND:-powershell.exe -NoLogo}"
15
- CAPTURE_ROOT="${PSMUX_CAPTURE_ROOT:-${TMPDIR:-/tmp}/psmux-steering}"
16
- CAPTURE_DIR="${CAPTURE_ROOT}/${SESSION_NAME}"
17
- CAPTURE_HELPER_PATH="${CAPTURE_ROOT}/pipe-pane-capture.ps1"
18
- COMPLETION_PREFIX="__TRIFLUX_DONE__:"
19
- POLL_INTERVAL_SEC="${PSMUX_POLL_INTERVAL_SEC:-1}"
20
-
21
- usage() {
22
- cat <<'EOF'
23
- Usage:
24
- scripts/psmux-steering-prototype.sh start
25
- scripts/psmux-steering-prototype.sh demo
26
- scripts/psmux-steering-prototype.sh attach
27
- scripts/psmux-steering-prototype.sh send <pane-name> <command text>
28
- scripts/psmux-steering-prototype.sh send-no-enter <pane-name> <text>
29
- scripts/psmux-steering-prototype.sh steer-ps <pane-name> <powershell command>
30
- scripts/psmux-steering-prototype.sh wait <pane-name> <regex> [timeout-sec]
31
- scripts/psmux-steering-prototype.sh logs
32
- scripts/psmux-steering-prototype.sh cleanup
33
-
34
- Pane names:
35
- lead | codex-worker | gemini-worker
36
-
37
- Environment overrides:
38
- PSMUX_BIN
39
- PSMUX_SESSION_NAME
40
- PSMUX_WINDOW_NAME
41
- PSMUX_SHELL_COMMAND
42
- PSMUX_CAPTURE_ROOT
43
- PSMUX_POLL_INTERVAL_SEC
44
- EOF
45
- }
46
-
47
- log() {
48
- printf '[psmux-steering] %s\n' "$*"
49
- }
50
-
51
- die() {
52
- printf '[psmux-steering] ERROR: %s\n' "$*" >&2
53
- exit 1
54
- }
55
-
56
- require_psmux() {
57
- command -v "$PSMUX_BIN" >/dev/null 2>&1 || die "Cannot find '$PSMUX_BIN' in PATH."
58
- }
59
-
60
- session_target() {
61
- printf '%s:%s' "$SESSION_NAME" "$WINDOW_NAME"
62
- }
63
-
64
- pane_target_from_index() {
65
- local pane_index="$1"
66
- printf '%s.%s' "$(session_target)" "$pane_index"
67
- }
68
-
69
- log_file_for() {
70
- local pane_name="$1"
71
- printf '%s/%s.log' "$CAPTURE_DIR" "$pane_name"
72
- }
73
-
74
- to_windows_path() {
75
- local path_value="$1"
76
-
77
- if command -v cygpath >/dev/null 2>&1; then
78
- cygpath -aw "$path_value"
79
- return 0
80
- fi
81
-
82
- printf '%s\n' "$path_value"
83
- }
84
-
85
- ensure_capture_helper() {
86
- mkdir -p "$CAPTURE_ROOT"
87
-
88
- cat >"$CAPTURE_HELPER_PATH" <<'EOF'
89
- param(
90
- [Parameter(Mandatory = $true)][string]$Path
91
- )
92
-
93
- $parent = Split-Path -Parent $Path
94
- if ($parent) {
95
- New-Item -ItemType Directory -Force -Path $parent | Out-Null
96
- }
97
-
98
- $reader = [Console]::In
99
- while (($line = $reader.ReadLine()) -ne $null) {
100
- Add-Content -LiteralPath $Path -Value $line -Encoding utf8
101
- }
102
- EOF
103
- }
104
-
105
- session_exists() {
106
- "$PSMUX_BIN" has-session -t "$SESSION_NAME" >/dev/null 2>&1
107
- }
108
-
109
- resolve_pane_target() {
110
- local pane_name="$1"
111
- local pane_index
112
-
113
- pane_index="$("$PSMUX_BIN" list-panes -t "$(session_target)" -F '#{pane_index} #{pane_title}' \
114
- | awk -v wanted="$pane_name" '$2 == wanted { print $1; exit }')"
115
-
116
- [[ -n "$pane_index" ]] || return 1
117
- pane_target_from_index "$pane_index"
118
- }
119
-
120
- require_pane_target() {
121
- local pane_name="$1"
122
- local pane_target
123
-
124
- pane_target="$(resolve_pane_target "$pane_name")"
125
- [[ -n "$pane_target" ]] || die "Pane '$pane_name' not found in session '$SESSION_NAME'."
126
- printf '%s\n' "$pane_target"
127
- }
128
-
129
- set_pane_title() {
130
- local pane_target="$1"
131
- local pane_name="$2"
132
-
133
- "$PSMUX_BIN" select-pane -t "$pane_target" -T "$pane_name" >/dev/null
134
- }
135
-
136
- start_capture_for_pane() {
137
- local pane_name="$1"
138
- local pane_target log_file helper_windows_path log_windows_path
139
-
140
- pane_target="$(require_pane_target "$pane_name")"
141
- log_file="$(log_file_for "$pane_name")"
142
- ensure_capture_helper
143
- helper_windows_path="$(to_windows_path "$CAPTURE_HELPER_PATH")"
144
- log_windows_path="$(to_windows_path "$log_file")"
145
-
146
- mkdir -p "$CAPTURE_DIR"
147
- : >"$log_file"
148
-
149
- "$PSMUX_BIN" pipe-pane -t "$pane_target" >/dev/null 2>&1 || true
150
- "$PSMUX_BIN" pipe-pane -t "$pane_target" powershell.exe -NoLogo -NoProfile -File "$helper_windows_path" "$log_windows_path" >/dev/null
151
- refresh_snapshot_for_pane "$pane_name"
152
- }
153
-
154
- start_capture_for_all_panes() {
155
- start_capture_for_pane "$PANE_LEAD"
156
- start_capture_for_pane "$PANE_CODEX"
157
- start_capture_for_pane "$PANE_GEMINI"
158
- }
159
-
160
- stop_capture_for_pane() {
161
- local pane_name="$1"
162
- local pane_target
163
-
164
- pane_target="$(resolve_pane_target "$pane_name" || true)"
165
- [[ -n "$pane_target" ]] || return 0
166
- "$PSMUX_BIN" pipe-pane -t "$pane_target" >/dev/null 2>&1 || true
167
- }
168
-
169
- refresh_snapshot_for_pane() {
170
- local pane_name="$1"
171
- local pane_target log_file
172
-
173
- pane_target="$(require_pane_target "$pane_name")"
174
- log_file="$(log_file_for "$pane_name")"
175
- mkdir -p "$CAPTURE_DIR"
176
-
177
- # Detached Windows sessions may not flush pipe-pane reliably yet.
178
- # Overwriting the log with a fresh capture-pane snapshot keeps
179
- # completion detection deterministic for the prototype.
180
- "$PSMUX_BIN" capture-pane -t "$pane_target" -p >"$log_file"
181
- }
182
-
183
- send_keys_to_pane() {
184
- local pane_name="$1"
185
- local text="$2"
186
- local submit="${3:-1}"
187
- local pane_target
188
-
189
- pane_target="$(require_pane_target "$pane_name")"
190
- "$PSMUX_BIN" send-keys -t "$pane_target" -l "$text"
191
- if [[ "$submit" != "0" ]]; then
192
- "$PSMUX_BIN" send-keys -t "$pane_target" C-m
193
- fi
194
- }
195
-
196
- dispatch_powershell_command() {
197
- local pane_name="$1"
198
- local command_text="$2"
199
- local token wrapped
200
-
201
- token="${pane_name}-$(date +%s)-$RANDOM"
202
- wrapped="${command_text}; \$trifluxExit = if (\$null -ne \$LASTEXITCODE) { [int]\$LASTEXITCODE } else { 0 }; Write-Output \"${COMPLETION_PREFIX}${token}:\$trifluxExit\""
203
-
204
- send_keys_to_pane "$pane_name" "$wrapped" 1
205
- printf '%s\n' "$token"
206
- }
207
-
208
- wait_for_pattern() {
209
- local pane_name="$1"
210
- local pattern="$2"
211
- local timeout_sec="${3:-300}"
212
- local log_file deadline
213
-
214
- log_file="$(log_file_for "$pane_name")"
215
- [[ -f "$log_file" ]] || die "Log file for pane '$pane_name' does not exist. Start capture first."
216
-
217
- deadline=$((SECONDS + timeout_sec))
218
- while (( SECONDS <= deadline )); do
219
- refresh_snapshot_for_pane "$pane_name"
220
- if grep -Eq -- "$pattern" "$log_file"; then
221
- return 0
222
- fi
223
- sleep "$POLL_INTERVAL_SEC"
224
- done
225
-
226
- return 1
227
- }
228
-
229
- wait_for_completion_token() {
230
- local pane_name="$1"
231
- local token="$2"
232
- local timeout_sec="${3:-300}"
233
- local pattern
234
-
235
- pattern="${COMPLETION_PREFIX}${token}:[0-9]+"
236
- wait_for_pattern "$pane_name" "$pattern" "$timeout_sec"
237
- }
238
-
239
- print_log_locations() {
240
- mkdir -p "$CAPTURE_DIR"
241
- printf '%s\t%s\n' "$PANE_LEAD" "$(log_file_for "$PANE_LEAD")"
242
- printf '%s\t%s\n' "$PANE_CODEX" "$(log_file_for "$PANE_CODEX")"
243
- printf '%s\t%s\n' "$PANE_GEMINI" "$(log_file_for "$PANE_GEMINI")"
244
- }
245
-
246
- create_session_layout() {
247
- local lead_index codex_index gemini_index
248
-
249
- require_psmux
250
-
251
- if session_exists; then
252
- die "Session '$SESSION_NAME' already exists. Run cleanup first or set PSMUX_SESSION_NAME."
253
- fi
254
-
255
- mkdir -p "$CAPTURE_DIR"
256
-
257
- lead_index="$("$PSMUX_BIN" new-session -d -P -F '#{pane_index}' -s "$SESSION_NAME" -n "$WINDOW_NAME" -- $SHELL_COMMAND)"
258
- codex_index="$("$PSMUX_BIN" split-window -h -P -F '#{pane_index}' -t "$(session_target)" -- $SHELL_COMMAND)"
259
- gemini_index="$("$PSMUX_BIN" split-window -v -P -F '#{pane_index}' -t "$(pane_target_from_index "$codex_index")" -- $SHELL_COMMAND)"
260
-
261
- set_pane_title "$(pane_target_from_index "$lead_index")" "$PANE_LEAD"
262
- set_pane_title "$(pane_target_from_index "$codex_index")" "$PANE_CODEX"
263
- set_pane_title "$(pane_target_from_index "$gemini_index")" "$PANE_GEMINI"
264
-
265
- "$PSMUX_BIN" select-layout -t "$(session_target)" tiled >/dev/null
266
- "$PSMUX_BIN" select-pane -t "$(pane_target_from_index "$lead_index")" >/dev/null
267
-
268
- start_capture_for_all_panes
269
- }
270
-
271
- show_start_summary() {
272
- log "Session created: $SESSION_NAME"
273
- log "Window: $WINDOW_NAME"
274
- log "Attach with: $PSMUX_BIN attach -t $SESSION_NAME"
275
- print_log_locations
276
- }
277
-
278
- run_demo() {
279
- local lead_token codex_token gemini_token
280
-
281
- create_session_layout
282
-
283
- lead_token="$(dispatch_powershell_command "$PANE_LEAD" 'Write-Host "lead pane ready"')"
284
- codex_token="$(dispatch_powershell_command "$PANE_CODEX" 'Write-Host "codex-worker pane ready"')"
285
- gemini_token="$(dispatch_powershell_command "$PANE_GEMINI" 'Write-Host "gemini-worker pane ready"')"
286
-
287
- wait_for_completion_token "$PANE_LEAD" "$lead_token" 30 || die "Lead pane demo command timed out."
288
- wait_for_completion_token "$PANE_CODEX" "$codex_token" 30 || die "Codex pane demo command timed out."
289
- wait_for_completion_token "$PANE_GEMINI" "$gemini_token" 30 || die "Gemini pane demo command timed out."
290
-
291
- show_start_summary
292
- }
293
-
294
- cleanup() {
295
- stop_capture_for_pane "$PANE_LEAD"
296
- stop_capture_for_pane "$PANE_CODEX"
297
- stop_capture_for_pane "$PANE_GEMINI"
298
-
299
- if session_exists; then
300
- "$PSMUX_BIN" kill-session -t "$SESSION_NAME" >/dev/null 2>&1 || true
301
- fi
302
- }
303
-
304
- main() {
305
- local action="${1:-demo}"
306
-
307
- case "$action" in
308
- start)
309
- create_session_layout
310
- show_start_summary
311
- ;;
312
- demo)
313
- run_demo
314
- ;;
315
- attach)
316
- require_psmux
317
- "$PSMUX_BIN" attach -t "$SESSION_NAME"
318
- ;;
319
- send)
320
- [[ $# -ge 3 ]] || die "Usage: $0 send <pane-name> <command text>"
321
- shift
322
- local pane_name="$1"
323
- shift
324
- send_keys_to_pane "$pane_name" "$*" 1
325
- ;;
326
- send-no-enter)
327
- [[ $# -ge 3 ]] || die "Usage: $0 send-no-enter <pane-name> <text>"
328
- shift
329
- local pane_name="$1"
330
- shift
331
- send_keys_to_pane "$pane_name" "$*" 0
332
- ;;
333
- steer-ps)
334
- [[ $# -ge 3 ]] || die "Usage: $0 steer-ps <pane-name> <powershell command>"
335
- shift
336
- local pane_name="$1"
337
- shift
338
- dispatch_powershell_command "$pane_name" "$*"
339
- ;;
340
- wait)
341
- [[ $# -ge 3 ]] || die "Usage: $0 wait <pane-name> <regex> [timeout-sec]"
342
- shift
343
- local pane_name="$1"
344
- local pattern="$2"
345
- local timeout_sec="${3:-300}"
346
- if wait_for_pattern "$pane_name" "$pattern" "$timeout_sec"; then
347
- log "Matched pattern for pane '$pane_name': $pattern"
348
- else
349
- die "Timed out waiting for pane '$pane_name' pattern: $pattern"
350
- fi
351
- ;;
352
- logs)
353
- print_log_locations
354
- ;;
355
- cleanup)
356
- cleanup
357
- ;;
358
- -h|--help|help)
359
- usage
360
- ;;
361
- *)
362
- usage
363
- die "Unknown action: $action"
364
- ;;
365
- esac
366
- }
367
-
368
- main "$@"