triflux 10.50.2 → 10.52.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 (263) hide show
  1. package/CLAUDE.md +57 -41
  2. package/README.ko.md +41 -45
  3. package/README.md +41 -45
  4. package/adapters/codex/skills/tfx-live/SKILL.md +25 -11
  5. package/bin/tfx-live.mjs +341 -104
  6. package/bin/triflux.mjs +147 -2624
  7. package/config/mcp-registry.json +3 -12
  8. package/cto/brief.mjs +0 -20
  9. package/cto/collect.mjs +1 -200
  10. package/cto/current.schema.json +2 -23
  11. package/cto/hygiene.mjs +2 -61
  12. package/cto/lake-root.mjs +0 -56
  13. package/cto/status.mjs +5 -187
  14. package/hooks/agy-session-hook.mjs +11 -56
  15. package/hooks/codex-session-hook.mjs +11 -101
  16. package/hub/bridge.mjs +65 -1250
  17. package/hub/cli-adapter-base.mjs +12 -90
  18. package/hub/codex-adapter.mjs +0 -1
  19. package/hub/codex-preflight.mjs +5 -28
  20. package/hub/lib/process-utils.mjs +1 -156
  21. package/hub/lib/spawn-trace.mjs +3 -2
  22. package/hub/lib/timeout-defaults.mjs +0 -1
  23. package/hub/team/agent-map.json +0 -1
  24. package/hub/team/agents-row-attach.py +120 -0
  25. package/hub/team/agents-row.mjs +200 -0
  26. package/hub/team/ansi.mjs +1 -35
  27. package/hub/team/backend.mjs +9 -145
  28. package/hub/team/claude-daemon-control.mjs +1 -2
  29. package/hub/team/claude-session-projection.mjs +5 -73
  30. package/hub/team/cli/commands/attach.mjs +1 -17
  31. package/hub/team/cli/commands/control.mjs +12 -38
  32. package/hub/team/cli/commands/debug.mjs +2 -39
  33. package/hub/team/cli/commands/focus.mjs +5 -31
  34. package/hub/team/cli/commands/interrupt.mjs +6 -25
  35. package/hub/team/cli/commands/kill.mjs +1 -30
  36. package/hub/team/cli/commands/list.mjs +0 -16
  37. package/hub/team/cli/commands/send.mjs +6 -26
  38. package/hub/team/cli/commands/start/index.mjs +42 -133
  39. package/hub/team/cli/commands/start/parse-args.mjs +15 -40
  40. package/hub/team/cli/commands/start/start-headless.mjs +138 -105
  41. package/hub/team/cli/commands/start/start-mux.mjs +2 -7
  42. package/hub/team/cli/commands/status.mjs +2 -57
  43. package/hub/team/cli/commands/stop.mjs +14 -19
  44. package/hub/team/cli/help.mjs +4 -5
  45. package/hub/team/cli/manifest.mjs +5 -1
  46. package/hub/team/cli/render.mjs +0 -12
  47. package/hub/team/cli/services/runtime-mode.mjs +27 -98
  48. package/hub/team/cli/services/state-store.mjs +5 -20
  49. package/hub/team/codex-queue.mjs +385 -0
  50. package/hub/team/handoff.mjs +3 -34
  51. package/hub/team/headless.mjs +108 -1296
  52. package/hub/team/orchestrator.mjs +4 -30
  53. package/hub/team/pane.mjs +6 -28
  54. package/hub/team/psmux.mjs +3 -34
  55. package/hub/team/remote-session.mjs +1 -2
  56. package/hub/team/session-context.mjs +1 -1
  57. package/hub/team/session.mjs +7 -91
  58. package/hub/team/tui-core.mjs +1 -1
  59. package/hub/team/tui-viewer.mjs +11 -58
  60. package/hub/team/tui.mjs +8 -306
  61. package/hub/team/uds-orchestrator.mjs +2 -580
  62. package/hub/team/wt-manager.mjs +2 -2
  63. package/hub/workers/factory.mjs +6 -84
  64. package/hub/workers/interface.mjs +1 -7
  65. package/hub/workers/lib/jsonrpc-core.mjs +11 -0
  66. package/hub/workers/lib/jsonrpc-ws-uds.mjs +5 -8
  67. package/hud/cli-policy.mjs +0 -22
  68. package/hud/constants.mjs +13 -26
  69. package/hud/hud-qos-status.mjs +42 -54
  70. package/hud/providers/gemini.mjs +125 -20
  71. package/hud/renderers.mjs +101 -122
  72. package/hud/utils.mjs +10 -6
  73. package/package.json +7 -12
  74. package/scripts/__tests__/mcp-guard-engine-http-headers.test.mjs +6 -6
  75. package/scripts/__tests__/mcp-guard-engine-policy-sync.test.mjs +1 -4
  76. package/scripts/__tests__/mcp-guard-engine-proactive-sync.test.mjs +16 -21
  77. package/scripts/__tests__/mcp-guard-engine-stdio-sync.test.mjs +1 -1
  78. package/scripts/__tests__/mcp-guard-engine-sync-http-headers.test.mjs +2 -2
  79. package/scripts/__tests__/mcp-guard-engine.test.mjs +56 -63
  80. package/scripts/__tests__/spawn-trace.test.mjs +16 -0
  81. package/scripts/check-codex-config-stable.mjs +4 -37
  82. package/scripts/claude-login-detect.mjs +0 -1
  83. package/scripts/claudemd-sync.mjs +1 -28
  84. package/scripts/lib/agent-route-policy.mjs +143 -62
  85. package/scripts/lib/cli-claude.mjs +0 -14
  86. package/scripts/lib/env-probe.mjs +2 -131
  87. package/scripts/lib/gemini-profiles.mjs +2 -69
  88. package/scripts/lib/legacy-mcp-cleanup.mjs +283 -0
  89. package/scripts/lib/machine-profile.mjs +3 -17
  90. package/scripts/lib/mcp-filter.mjs +109 -53
  91. package/scripts/lib/mcp-guard-engine.mjs +40 -98
  92. package/scripts/lib/mcp-health.mjs +2 -2
  93. package/scripts/lib/mcp-server-catalog.mjs +2 -2
  94. package/scripts/lib/psmux-info.mjs +11 -59
  95. package/scripts/lib/session-presence.mjs +2 -100
  96. package/scripts/lib/skill-template.mjs +0 -245
  97. package/scripts/pack.mjs +8 -83
  98. package/scripts/preflight-cache.mjs +5 -18
  99. package/scripts/release/check-packages-mirror.mjs +2 -8
  100. package/scripts/release/version-manifest.json +9 -1
  101. package/scripts/setup.mjs +100 -417
  102. package/scripts/test-lock.mjs +0 -1
  103. package/scripts/tfx-route-post.mjs +5 -69
  104. package/scripts/tfx-route-worker.mjs +4 -79
  105. package/scripts/tfx-route.sh +169 -1495
  106. package/scripts/wt-cli.mjs +1 -2
  107. package/skills/tfx-auto/SKILL.md +123 -741
  108. package/skills/tfx-auto/references/consensus-schema.md +161 -0
  109. package/skills/tfx-auto/references/tmux-observation.md +97 -0
  110. package/skills/tfx-doctor/SKILL.md +5 -6
  111. package/skills/tfx-lead/SKILL.md +195 -0
  112. package/skills/tfx-live/SKILL.md +25 -11
  113. package/skills/tfx-remote/SKILL.md +24 -87
  114. package/skills/tfx-research/SKILL.md +13 -20
  115. package/skills/tfx-review/SKILL.md +33 -35
  116. package/skills/tfx-setup/SKILL.md +1 -1
  117. package/skills/tfx-ship/SKILL.md +6 -27
  118. package/skills/tfx-wt/SKILL.md +34 -68
  119. package/bin/tfx-doctor-tui.mjs +0 -7
  120. package/bin/tfx-setup-tui.mjs +0 -7
  121. package/config/routing-policy.json +0 -124
  122. package/docs/assets/consensus-flow.svg +0 -125
  123. package/docs/assets/deep-vs-light.svg +0 -193
  124. package/docs/assets/demo-dark.gif +0 -0
  125. package/docs/assets/demo-light.gif +0 -0
  126. package/docs/assets/demo-psmux.gif +0 -0
  127. package/hub/adaptive-diagnostic.mjs +0 -350
  128. package/hub/adaptive-inject.mjs +0 -224
  129. package/hub/adaptive-memory.mjs +0 -277
  130. package/hub/adaptive.mjs +0 -172
  131. package/hub/assign-callbacks.mjs +0 -170
  132. package/hub/delegator/contracts.mjs +0 -38
  133. package/hub/delegator/index.mjs +0 -14
  134. package/hub/delegator/schema/delegator-tools.schema.json +0 -250
  135. package/hub/delegator/service.mjs +0 -336
  136. package/hub/delegator/tool-definitions.mjs +0 -35
  137. package/hub/dynamic-routing-engine.mjs +0 -511
  138. package/hub/hitl.mjs +0 -202
  139. package/hub/hub-lifecycle.mjs +0 -248
  140. package/hub/lib/known-errors.json +0 -72
  141. package/hub/lib/memory-store.mjs +0 -1001
  142. package/hub/lib/phase-manager.mjs +0 -493
  143. package/hub/lib/risk-tier.mjs +0 -53
  144. package/hub/lib/ssh-command.mjs +0 -231
  145. package/hub/lib/staged-file-detect.mjs +0 -43
  146. package/hub/lib/state-snapshot.mjs +0 -293
  147. package/hub/lib/tfx-route-args.mjs +0 -353
  148. package/hub/lib/trace-recorder.mjs +0 -153
  149. package/hub/lib/uuidv7.mjs +0 -45
  150. package/hub/memory-doctor.mjs +0 -640
  151. package/hub/middleware/quota-middleware.mjs +0 -70
  152. package/hub/middleware/request-logger.mjs +0 -191
  153. package/hub/paths.mjs +0 -24
  154. package/hub/pipe.mjs +0 -825
  155. package/hub/pipeline/index.mjs +0 -163
  156. package/hub/pipeline/state.mjs +0 -191
  157. package/hub/pipeline/transitions.mjs +0 -131
  158. package/hub/promote-penalties.mjs +0 -138
  159. package/hub/public/dashboard.html +0 -416
  160. package/hub/reflexion.mjs +0 -290
  161. package/hub/role-contract.mjs +0 -314
  162. package/hub/router.mjs +0 -2026
  163. package/hub/routing-snapshot.mjs +0 -261
  164. package/hub/schema.sql +0 -209
  165. package/hub/server.mjs +0 -3048
  166. package/hub/session-fingerprint.mjs +0 -418
  167. package/hub/state.mjs +0 -300
  168. package/hub/store-adapter.mjs +0 -182
  169. package/hub/store.mjs +0 -1736
  170. package/hub/team/build-worker-prompt.mjs +0 -92
  171. package/hub/team/check-mcp-hub.mjs +0 -49
  172. package/hub/team/claude-native-bridge.mjs +0 -987
  173. package/hub/team/cli/commands/start/start-in-process.mjs +0 -50
  174. package/hub/team/cli/commands/start/start-wt.mjs +0 -86
  175. package/hub/team/cli/services/hub-client.mjs +0 -264
  176. package/hub/team/cli/services/native-control.mjs +0 -145
  177. package/hub/team/codex-review.mjs +0 -520
  178. package/hub/team/conductor-mesh-bridge.mjs +0 -122
  179. package/hub/team/conductor-registry.mjs +0 -121
  180. package/hub/team/conductor.mjs +0 -1529
  181. package/hub/team/consensus-meta.mjs +0 -176
  182. package/hub/team/cto-auto-collect.mjs +0 -115
  183. package/hub/team/cto-pull.mjs +0 -31
  184. package/hub/team/daemon-pty-tmux-bridge.mjs +0 -146
  185. package/hub/team/dashboard.mjs +0 -322
  186. package/hub/team/event-log.mjs +0 -84
  187. package/hub/team/execution-mode.mjs +0 -324
  188. package/hub/team/extract-completion-payload.mjs +0 -110
  189. package/hub/team/headless-bridge-session.mjs +0 -17
  190. package/hub/team/health-probe.mjs +0 -435
  191. package/hub/team/interactive-native-launcher.mjs +0 -119
  192. package/hub/team/interactive-native-worker.mjs +0 -80
  193. package/hub/team/interactive-tui-transport.mjs +0 -479
  194. package/hub/team/launcher-template.mjs +0 -144
  195. package/hub/team/lead-control.mjs +0 -191
  196. package/hub/team/mcp-selector.mjs +0 -145
  197. package/hub/team/native-supervisor.mjs +0 -460
  198. package/hub/team/native.mjs +0 -727
  199. package/hub/team/recovery-store.mjs +0 -149
  200. package/hub/team/remote-probe.mjs +0 -292
  201. package/hub/team/remote-watcher.mjs +0 -506
  202. package/hub/team/runtime-strategy.mjs +0 -200
  203. package/hub/team/schemas/worker-completion.json +0 -39
  204. package/hub/team/sentinel-capture.mjs +0 -127
  205. package/hub/team/session-sync.mjs +0 -316
  206. package/hub/team/swarm-cli.mjs +0 -390
  207. package/hub/team/swarm-hypervisor.mjs +0 -2206
  208. package/hub/team/swarm-intent.mjs +0 -216
  209. package/hub/team/swarm-locks.mjs +0 -335
  210. package/hub/team/swarm-planner.mjs +0 -371
  211. package/hub/team/swarm-preflight.mjs +0 -366
  212. package/hub/team/swarm-reconciler.mjs +0 -242
  213. package/hub/team/synapse-cli.mjs +0 -458
  214. package/hub/team/synapse-http.mjs +0 -311
  215. package/hub/team/synapse-registry.mjs +0 -618
  216. package/hub/team/tui-remote-adapter.mjs +0 -377
  217. package/hub/team/tui-synapse.mjs +0 -223
  218. package/hub/team/worker-completion-validator.mjs +0 -79
  219. package/hub/team/worker-sandbox.mjs +0 -125
  220. package/hub/team/worktree-lifecycle.mjs +0 -639
  221. package/hub/team/wt-templates.json +0 -43
  222. package/hub/team-bridge.mjs +0 -27
  223. package/hub/tools.mjs +0 -900
  224. package/hub/workers/antigravity-route-worker.mjs +0 -179
  225. package/hub/workers/codex-app-server-worker.mjs +0 -1067
  226. package/hub/workers/delegator-mcp.mjs +0 -1098
  227. package/hub/workers/lib/jsonrpc-stdio.mjs +0 -204
  228. package/mesh/index.mjs +0 -69
  229. package/mesh/mesh-budget.mjs +0 -137
  230. package/mesh/mesh-heartbeat.mjs +0 -100
  231. package/mesh/mesh-protocol.mjs +0 -96
  232. package/mesh/mesh-queue.mjs +0 -163
  233. package/mesh/mesh-registry.mjs +0 -78
  234. package/mesh/mesh-router.mjs +0 -77
  235. package/scripts/__tests__/skill-surface.test.mjs +0 -93
  236. package/scripts/cache-doctor.mjs +0 -156
  237. package/scripts/cache-warmup.mjs +0 -630
  238. package/scripts/completions/tfx.bash +0 -74
  239. package/scripts/completions/tfx.fish +0 -57
  240. package/scripts/completions/tfx.zsh +0 -98
  241. package/scripts/demo.mjs +0 -197
  242. package/scripts/doctor-dynamic-routing.mjs +0 -87
  243. package/scripts/hub-ensure.mjs +0 -842
  244. package/scripts/hub-watchdog.mjs +0 -90
  245. package/scripts/lib/claudemd-scanner.mjs +0 -223
  246. package/scripts/lib/context.mjs +0 -67
  247. package/scripts/lib/dynamic-route-cli.mjs +0 -107
  248. package/scripts/lib/handoff.mjs +0 -187
  249. package/scripts/lib/logger.mjs +0 -122
  250. package/scripts/lib/stealth-fetch.mjs +0 -176
  251. package/scripts/notion-read.mjs +0 -686
  252. package/scripts/snapshot-codex-state.mjs +0 -37
  253. package/scripts/snapshot-gemini-state.mjs +0 -37
  254. package/scripts/sync-codex-auth.mjs +0 -71
  255. package/scripts/sync-hub-mcp-settings.mjs +0 -697
  256. package/skills/_templates/base.md +0 -4
  257. package/skills/_templates/deep.md +0 -6
  258. package/skills/shared/telemetry-segment.md +0 -6
  259. package/tui/core.mjs +0 -266
  260. package/tui/doctor.mjs +0 -375
  261. package/tui/monitor-data.mjs +0 -152
  262. package/tui/monitor.mjs +0 -318
  263. package/tui/setup.mjs +0 -506
@@ -1,57 +0,0 @@
1
- # Installation: ~/.config/fish/completions/에 복사
2
- # e.g., cp /path/to/tfx.fish ~/.config/fish/completions/tfx.fish
3
-
4
- set -l commands setup doctor mcp update list ls handoff schema hub multi swarm synapse review why codex-team notion-read nr monitor version auto help
5
- set -l hub_cmds start stop status ensure help
6
- set -l multi_cmds status stop kill attach list help
7
- set -l swarm_cmds run preflight plan list status help
8
-
9
- complete -c tfx -f
10
-
11
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "setup" -d "Setup and sync files"
12
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "doctor" -d "Diagnose CLI and issues"
13
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "mcp" -d "MCP registry management"
14
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "update" -d "Update triflux"
15
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "list" -d "List installed skills"
16
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "handoff" -d "Create handoff prompt"
17
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "schema" -d "Print CLI and Hub schema"
18
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "hub" -d "Hub process management"
19
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "multi" -d "Multi-CLI team mode"
20
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "swarm" -d "PRD worktree swarm"
21
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "synapse" -d "Show swarm registry"
22
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "review" -d "Codex diff review"
23
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "why" -d "Show X-Intent trailer"
24
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "codex-team" -d "Codex team mode"
25
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "notion-read" -d "Read Notion page"
26
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "monitor" -d "Open TUI monitor"
27
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "version" -d "Show version"
28
- complete -c tfx -n "not __fish_seen_subcommand_from $commands" -a "auto" -d "Preview tfx-auto routing"
29
-
30
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l fix -d "Auto fix issues"
31
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l reset -d "Reset caches"
32
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l audit -d "Run config audit"
33
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l diagnose -d "Create diagnostic bundle"
34
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l cleanup-stale-hubs -d "Report/cleanup stale hubs"
35
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l cleanup-stale-tmux -d "Report/cleanup stale tmux sessions"
36
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l dry-run -d "Preview cleanup"
37
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l apply -d "Apply cleanup"
38
- complete -c tfx -n "__fish_seen_subcommand_from doctor" -l json -d "JSON output"
39
-
40
- complete -c tfx -n "__fish_seen_subcommand_from setup" -l dry-run -d "Preview setup actions"
41
- complete -c tfx -n "__fish_seen_subcommand_from setup" -l enable-hub-autostart -d "Register hub autostart"
42
- complete -c tfx -n "__fish_seen_subcommand_from auto" -l cli -d "Force lane: auto/codex/antigravity/claude"
43
- complete -c tfx -n "__fish_seen_subcommand_from auto" -l mode -d "Mode: quick/deep/consensus"
44
- complete -c tfx -n "__fish_seen_subcommand_from auto" -l parallel -d "Parallelism: 1/N/swarm"
45
- complete -c tfx -n "__fish_seen_subcommand_from auto" -l json -d "JSON output"
46
-
47
- complete -c tfx -n "__fish_seen_subcommand_from hub; and not __fish_seen_subcommand_from $hub_cmds" -a "$hub_cmds"
48
- complete -c tfx -n "__fish_seen_subcommand_from multi; and not __fish_seen_subcommand_from $multi_cmds" -a "$multi_cmds"
49
- complete -c tfx -n "__fish_seen_subcommand_from swarm; and not __fish_seen_subcommand_from $swarm_cmds" -a "$swarm_cmds"
50
-
51
- complete -c tfx -n "__fish_seen_subcommand_from review" -l base -d "Base ref"
52
- complete -c tfx -n "__fish_seen_subcommand_from review" -l timeout -d "Timeout seconds"
53
- complete -c tfx -n "__fish_seen_subcommand_from review" -l shard -d "Shard mode"
54
- complete -c tfx -n "__fish_seen_subcommand_from review" -l json -d "JSON output"
55
-
56
- complete -c tfx -n "__fish_seen_subcommand_from update list ls handoff schema synapse why codex-team notion-read nr monitor version" -l help -d "Show help"
57
- complete -c tfx -n "__fish_seen_subcommand_from list ls handoff synapse review codex-team notion-read nr version" -l json -d "JSON output"
@@ -1,98 +0,0 @@
1
- #compdef tfx
2
- # Installation: fpath에 추가 후 compinit
3
- # e.g., fpath=(/path/to/dir $fpath) && compinit
4
-
5
- _tfx() {
6
- local state
7
- local -a commands hub_cmds multi_cmds swarm_cmds
8
-
9
- commands=(
10
- 'setup:Setup and sync files'
11
- 'doctor:Diagnose CLI and issues'
12
- 'mcp:MCP registry management'
13
- 'update:Update triflux'
14
- 'list:List installed skills'
15
- 'ls:Alias for list'
16
- 'handoff:Create handoff prompt'
17
- 'schema:Print CLI and Hub schema'
18
- 'hub:Hub process management'
19
- 'multi:Multi-CLI team mode'
20
- 'swarm:PRD worktree swarm'
21
- 'synapse:Show swarm registry'
22
- 'review:Codex diff review'
23
- 'why:Show X-Intent trailer'
24
- 'codex-team:Codex team mode'
25
- 'notion-read:Read Notion page'
26
- 'nr:Alias for notion-read'
27
- 'monitor:Open TUI monitor'
28
- 'version:Show version'
29
- 'auto:Preview tfx-auto routing'
30
- 'help:Show help'
31
- )
32
-
33
- hub_cmds=('start:Start hub' 'stop:Stop hub' 'status:Show hub status' 'ensure:Ensure hub is healthy' 'help:Show hub help')
34
- multi_cmds=('status:Show status' 'stop:Stop multi' 'kill:Kill multi' 'attach:Attach to multi' 'list:List sessions' 'help:Show multi help')
35
- swarm_cmds=('run:Run PRD swarm' 'preflight:Go/no-go report' 'plan:Plan only' 'list:List sessions' 'status:Alias for list' 'help:Show swarm help')
36
-
37
- _arguments -C \
38
- '1: :->cmds' \
39
- '*: :->args'
40
-
41
- case $state in
42
- cmds)
43
- _describe -t commands 'tfx commands' commands
44
- ;;
45
- args)
46
- case $words[2] in
47
- doctor)
48
- _arguments \
49
- '--fix[Auto fix issues]' \
50
- '--reset[Reset caches]' \
51
- '--audit[Run config audit]' \
52
- '--diagnose[Create diagnostic bundle]' \
53
- '--cleanup-stale-hubs[Report/cleanup stale hubs]' \
54
- '--cleanup-stale-tmux[Report/cleanup stale tmux sessions]' \
55
- '--dry-run[Preview cleanup]' \
56
- '--apply[Apply cleanup]' \
57
- '--json[JSON output]' \
58
- '--help[Show help]'
59
- ;;
60
- setup)
61
- _arguments '--dry-run[Preview setup actions]' '--enable-hub-autostart[Register hub autostart]' '--help[Show help]'
62
- ;;
63
- auto)
64
- _arguments '--cli[Force lane: auto/codex/antigravity/claude]' '--mode[Mode: quick/deep/consensus]' '--parallel[Parallelism: 1/N/swarm]' '--json[JSON output]' '--help[Show help]'
65
- ;;
66
- hub)
67
- if (( CURRENT == 3 )) && [[ $words[CURRENT] != -* ]]; then
68
- _describe -t hub_cmds 'hub commands' hub_cmds
69
- else
70
- _arguments '--port[Hub port]' '--json[JSON output]' '--help[Show help]'
71
- fi
72
- ;;
73
- multi)
74
- if (( CURRENT == 3 )) && [[ $words[CURRENT] != -* ]]; then
75
- _describe -t multi_cmds 'multi commands' multi_cmds
76
- else
77
- _arguments '--dashboard[Enable dashboard]' '--no-dashboard[Disable dashboard]' '--dashboard-layout[Dashboard layout]' '--json[JSON output]' '--help[Show help]'
78
- fi
79
- ;;
80
- swarm)
81
- if (( CURRENT == 3 )) && [[ $words[CURRENT] != -* ]]; then
82
- _describe -t swarm_cmds 'swarm commands' swarm_cmds
83
- else
84
- _arguments '--dry-run[Plan without execution]' '--json[JSON output]' '--filter[Shard filter]' '--max-restarts[Max restarts]' '--logs-dir[Logs directory]' '--help[Show help]'
85
- fi
86
- ;;
87
- review)
88
- _arguments '--base[Base ref]' '--timeout[Timeout seconds]' '--shard[Shard mode]' '--json[JSON output]' '--help[Show help]'
89
- ;;
90
- *)
91
- _arguments '--json[JSON output]' '--help[Show help]'
92
- ;;
93
- esac
94
- ;;
95
- esac
96
- }
97
-
98
- _tfx "$@"
package/scripts/demo.mjs DELETED
@@ -1,197 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import childProcess from "node:child_process";
4
- import { parseArgs } from "node:util";
5
-
6
- const SESSION_NAME = "triflux-demo";
7
-
8
- const WORKERS = [
9
- {
10
- pane: 0,
11
- agent: "codex",
12
- messages: [
13
- "[codex] Analyzing auth module...",
14
- "[codex] Refactoring JWT validation...",
15
- "[codex] Done ✓",
16
- ],
17
- },
18
- {
19
- pane: 1,
20
- agent: "antigravity",
21
- messages: [
22
- "[antigravity] Reviewing UI components...",
23
- "[antigravity] Optimizing render cycle...",
24
- "[antigravity] Done ✓",
25
- ],
26
- },
27
- {
28
- pane: 2,
29
- agent: "claude",
30
- messages: [
31
- "[claude] Security audit in progress...",
32
- "[claude] Found 0 vulnerabilities",
33
- "[claude] Done ✓",
34
- ],
35
- },
36
- ];
37
-
38
- export function checkPsmux(opts = {}) {
39
- if (opts.dryRun) return false;
40
- try {
41
- childProcess.execFileSync("psmux", ["-V"], {
42
- encoding: "utf8",
43
- stdio: "pipe",
44
- });
45
- return true;
46
- } catch {
47
- return false;
48
- }
49
- }
50
-
51
- export function createDemoSession(sessionName, opts = {}) {
52
- if (opts.dryRun) {
53
- console.log(`[dry-run] psmux new-session -d -s ${sessionName}`);
54
- console.log(`[dry-run] psmux split-window -h -t ${sessionName}`);
55
- console.log(`[dry-run] psmux split-window -h -t ${sessionName}`);
56
- return;
57
- }
58
- childProcess.execFileSync("psmux", ["new-session", "-d", "-s", sessionName], {
59
- stdio: "pipe",
60
- });
61
- childProcess.execFileSync(
62
- "psmux",
63
- ["split-window", "-h", "-t", sessionName],
64
- { stdio: "pipe" },
65
- );
66
- childProcess.execFileSync(
67
- "psmux",
68
- ["split-window", "-h", "-t", sessionName],
69
- { stdio: "pipe" },
70
- );
71
- }
72
-
73
- export function simulateWorker(pane, agentName, messages, opts = {}) {
74
- const sessionName = opts.sessionName || SESSION_NAME;
75
- for (const msg of messages) {
76
- const escapedMsg = msg.replace(/'/g, "'\\''");
77
- if (opts.dryRun) {
78
- console.log(
79
- `[dry-run] psmux send-keys -t ${sessionName}:0.${pane} "echo '${escapedMsg}'" Enter`,
80
- );
81
- } else {
82
- childProcess.execFileSync(
83
- "psmux",
84
- [
85
- "send-keys",
86
- "-t",
87
- `${sessionName}:0.${pane}`,
88
- `echo '${escapedMsg}'`,
89
- "Enter",
90
- ],
91
- { stdio: "pipe" },
92
- );
93
- }
94
- }
95
- }
96
-
97
- export function showSummary() {
98
- const lines = [
99
- "",
100
- "=== triflux demo summary ===",
101
- " codex → JWT auth refactor [done]",
102
- " antigravity → UI render optimize [done]",
103
- " claude → Security audit [done]",
104
- "============================",
105
- "",
106
- ];
107
- for (const line of lines) {
108
- console.log(line);
109
- }
110
- }
111
-
112
- export function cleanup(sessionName, opts = {}) {
113
- if (opts.dryRun) {
114
- console.log(`[dry-run] psmux detach-client -t ${sessionName}`);
115
- console.log(`[dry-run] sleep 2`);
116
- console.log(`[dry-run] psmux kill-session -t ${sessionName}`);
117
- return;
118
- }
119
- try {
120
- childProcess.execFileSync("psmux", ["detach-client", "-t", sessionName], {
121
- stdio: "pipe",
122
- });
123
- } catch {
124
- // session may have no attached clients
125
- }
126
- Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 2000);
127
- try {
128
- childProcess.execFileSync("psmux", ["kill-session", "-t", sessionName], {
129
- stdio: "pipe",
130
- });
131
- } catch {
132
- // session may already be gone
133
- }
134
- }
135
-
136
- async function wait(ms) {
137
- return new Promise((resolve) => setTimeout(resolve, ms));
138
- }
139
-
140
- async function main() {
141
- const { values: flags } = parseArgs({
142
- options: {
143
- "dry-run": { type: "boolean", default: false },
144
- keep: { type: "boolean", default: false },
145
- },
146
- strict: false,
147
- });
148
-
149
- const psmuxAvailable = checkPsmux({ dryRun: flags["dry-run"] });
150
- const dryRun = flags["dry-run"] || !psmuxAvailable;
151
-
152
- if (!psmuxAvailable && !flags["dry-run"]) {
153
- console.log("[demo] psmux not found — switching to dry-run mode");
154
- }
155
-
156
- const opts = {
157
- dryRun,
158
- keep: flags.keep,
159
- sessionName: SESSION_NAME,
160
- };
161
-
162
- createDemoSession(SESSION_NAME, opts);
163
-
164
- for (const { pane, agent, messages } of WORKERS) {
165
- simulateWorker(pane, agent, messages, opts);
166
- }
167
-
168
- if (!opts.dryRun) {
169
- await wait(2000);
170
- }
171
-
172
- showSummary();
173
-
174
- if (!opts.keep) {
175
- cleanup(SESSION_NAME, opts);
176
- }
177
- }
178
-
179
- // Only run main when executed directly (not imported as a module)
180
- // Normalize both paths to forward-slash for cross-platform comparison
181
- function isDirectExec() {
182
- if (!process.argv[1]) return false;
183
- const scriptPath = new URL(import.meta.url).pathname.replace(
184
- /^\/([A-Za-z]:)/,
185
- "$1",
186
- );
187
- const argv1 = process.argv[1].replace(/\\/g, "/");
188
- const norm = scriptPath.replace(/\\/g, "/");
189
- return argv1 === norm || argv1.endsWith(norm);
190
- }
191
-
192
- if (isDirectExec()) {
193
- main().catch((err) => {
194
- console.error("demo error:", err.message);
195
- process.exit(1);
196
- });
197
- }
@@ -1,87 +0,0 @@
1
- // scripts/doctor-dynamic-routing.mjs
2
- //
3
- // Phase 1 Wire-up 4 — `tfx doctor --dynamic-routing` diagnostic helper.
4
- // 사용자가 dynamic routing 상태 (env / policy / snapshot cache / preview decision)
5
- // 를 한 화면에 확인할 수 있도록 진단 report 를 만든다.
6
-
7
- import {
8
- createDynamicRouter,
9
- __internal__ as dynamicRoutingInternal,
10
- isDynamicRoutingEnabled,
11
- } from "../hub/dynamic-routing-engine.mjs";
12
- import { getDefaultSnapshot } from "../hub/routing-snapshot.mjs";
13
-
14
- /**
15
- * Dynamic routing 상태 진단.
16
- * @returns {Promise<{
17
- * enabled: boolean,
18
- * envFlag: string | null,
19
- * policyLoaded: boolean,
20
- * policyScenarios: string[],
21
- * policyPath: string,
22
- * snapshotCached: boolean,
23
- * snapshotAgeMs: number | null,
24
- * previewDecision: object | null,
25
- * error: string | null,
26
- * }>}
27
- */
28
- export async function diagnoseDynamicRouting() {
29
- const envFlag = process.env.TRIFLUX_DYNAMIC_ROUTING ?? null;
30
- const enabled = isDynamicRoutingEnabled(process.env);
31
- const policy = dynamicRoutingInternal.loadPolicy();
32
- const policyPath = dynamicRoutingInternal.DEFAULT_POLICY_PATH;
33
-
34
- const report = {
35
- enabled,
36
- envFlag,
37
- policyLoaded: Boolean(policy),
38
- policyScenarios: Array.isArray(policy?.scenarios)
39
- ? policy.scenarios.map((s) => s.id)
40
- : [],
41
- policyPath,
42
- snapshotCached: false,
43
- snapshotAgeMs: null,
44
- previewDecision: null,
45
- error: null,
46
- };
47
-
48
- try {
49
- const now = Date.now();
50
- const snapshot = await getDefaultSnapshot({ now });
51
- if (snapshot && typeof snapshot.observedAt === "number") {
52
- report.snapshotCached = true;
53
- report.snapshotAgeMs = now - snapshot.observedAt;
54
- }
55
-
56
- if (enabled) {
57
- const router = createDynamicRouter();
58
- const decision = await router.routeRequest(
59
- {
60
- task_id: `tfx-doctor-preview-${process.pid}-${now}`,
61
- team_size: 1,
62
- agent_hint: "codex",
63
- },
64
- { now },
65
- );
66
- report.previewDecision = {
67
- decisionId: decision?.decisionId ?? null,
68
- scenario: decision?.scenario ?? null,
69
- mode: decision?.mode ?? null,
70
- lane: decision?.lane ?? null,
71
- shards: Array.isArray(decision?.shards)
72
- ? decision.shards.map((s) => ({
73
- cli: s.cli,
74
- accountId: s.accountId ?? null,
75
- riskTier: s.riskTier ?? null,
76
- }))
77
- : [],
78
- snapshotAgeMs: decision?.snapshotAgeMs ?? null,
79
- confidence: decision?.confidence ?? null,
80
- };
81
- }
82
- } catch (err) {
83
- report.error = err?.message || String(err);
84
- }
85
-
86
- return report;
87
- }