triflux 10.3.3 → 10.4.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 (130) hide show
  1. package/CLAUDE.md +193 -0
  2. package/LICENSE +21 -21
  3. package/hooks/hook-registry.json +256 -256
  4. package/hub/adaptive-inject.mjs +1 -1
  5. package/hub/assign-callbacks.mjs +120 -120
  6. package/hub/delegator/index.mjs +14 -14
  7. package/hub/delegator/tool-definitions.mjs +35 -35
  8. package/hub/hitl.mjs +143 -143
  9. package/hub/lib/path-utils.mjs +167 -0
  10. package/hub/router.mjs +791 -791
  11. package/hub/session-fingerprint.mjs +1 -1
  12. package/hub/team/cli/commands/attach.mjs +37 -37
  13. package/hub/team/cli/commands/debug.mjs +74 -74
  14. package/hub/team/cli/commands/focus.mjs +53 -53
  15. package/hub/team/cli/commands/list.mjs +24 -24
  16. package/hub/team/cli/commands/start/start-in-process.mjs +40 -40
  17. package/hub/team/cli/commands/start/start-mux.mjs +73 -73
  18. package/hub/team/cli/commands/start/start-wt.mjs +69 -69
  19. package/hub/team/cli/commands/tasks.mjs +13 -13
  20. package/hub/team/cli/render.mjs +30 -30
  21. package/hub/team/cli/services/attach-fallback.mjs +54 -54
  22. package/hub/team/cli/services/member-selector.mjs +30 -30
  23. package/hub/team/cli/services/native-control.mjs +116 -116
  24. package/hub/team/cli/services/task-model.mjs +30 -30
  25. package/hub/team/notify.mjs +1 -1
  26. package/hub/team/orchestrator.mjs +161 -161
  27. package/hub/team/runtime-strategy.mjs +74 -0
  28. package/hub/team/session.mjs +611 -611
  29. package/hub/team/shared.mjs +13 -13
  30. package/hub/team/worktree-lifecycle.mjs +61 -2
  31. package/hub/tray.mjs +368 -368
  32. package/hub/workers/codex-mcp.mjs +507 -507
  33. package/hub/workers/factory.mjs +21 -21
  34. package/hud/hud-qos-status.mjs +17 -3
  35. package/hud/mission-board.mjs +53 -0
  36. package/hud/providers/claude.mjs +95 -22
  37. package/hud/renderers.mjs +39 -5
  38. package/package.json +21 -55
  39. package/references/hosts.json +33 -0
  40. package/scripts/completions/tfx.bash +47 -47
  41. package/scripts/completions/tfx.fish +44 -44
  42. package/scripts/completions/tfx.zsh +83 -83
  43. package/scripts/demo.mjs +169 -0
  44. package/scripts/headless-guard.mjs +16 -4
  45. package/scripts/hub-ensure.mjs +120 -120
  46. package/scripts/keyword-detector.mjs +272 -272
  47. package/scripts/keyword-rules-expander.mjs +521 -521
  48. package/scripts/lib/mcp-server-catalog.mjs +118 -118
  49. package/scripts/lib/skill-state.mjs +220 -0
  50. package/scripts/notion-read.mjs +553 -553
  51. package/scripts/test-tfx-route-no-claude-native.mjs +57 -57
  52. package/scripts/tfx-batch-stats.mjs +96 -96
  53. package/skills/.omc/state/agent-replay-8f0e10a9-9693-4410-96f5-a6b07e8ed995.jsonl +1 -0
  54. package/skills/.omc/state/idle-notif-cooldown.json +3 -0
  55. package/skills/.omc/state/last-tool-error.json +7 -0
  56. package/skills/.omc/state/subagent-tracking.json +7 -0
  57. package/skills/tfx-remote-spawn/references/hosts.json +16 -0
  58. package/skills/tfx-workspace/async-tests/run-tests.sh +203 -0
  59. package/skills/tfx-workspace/evals/evals.json +79 -0
  60. package/skills/tfx-workspace/iteration-1/benchmark.json +162 -0
  61. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/eval_metadata.json +11 -0
  62. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/grading.json +9 -0
  63. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/outputs/analysis.md +154 -0
  64. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/timing.json +5 -0
  65. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/grading.json +9 -0
  66. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/outputs/analysis.md +126 -0
  67. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/timing.json +5 -0
  68. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/eval_metadata.json +11 -0
  69. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/grading.json +9 -0
  70. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/outputs/analysis.md +119 -0
  71. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/timing.json +5 -0
  72. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/grading.json +9 -0
  73. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/outputs/analysis.md +115 -0
  74. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/timing.json +5 -0
  75. package/skills/tfx-workspace/iteration-1/hub-start-sequence/eval_metadata.json +10 -0
  76. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/grading.json +8 -0
  77. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/outputs/analysis.md +86 -0
  78. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/timing.json +5 -0
  79. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/grading.json +8 -0
  80. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/outputs/analysis.md +81 -0
  81. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/timing.json +5 -0
  82. package/skills/tfx-workspace/iteration-1/multi-team-creation/eval_metadata.json +12 -0
  83. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/grading.json +10 -0
  84. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/outputs/analysis.md +316 -0
  85. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/timing.json +5 -0
  86. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/grading.json +10 -0
  87. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/outputs/analysis.md +352 -0
  88. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/timing.json +5 -0
  89. package/skills/tfx-workspace/iteration-1/review.html +1325 -0
  90. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/eval_metadata.json +12 -0
  91. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/grading.json +10 -0
  92. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/outputs/analysis.md +97 -0
  93. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/timing.json +5 -0
  94. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/grading.json +10 -0
  95. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/outputs/analysis.md +94 -0
  96. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/timing.json +5 -0
  97. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/eval_metadata.json +12 -0
  98. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/grading.json +10 -0
  99. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/outputs/analysis.md +209 -0
  100. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/timing.json +5 -0
  101. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/grading.json +10 -0
  102. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/outputs/analysis.md +193 -0
  103. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/timing.json +5 -0
  104. package/skills/tfx-workspace/iteration-2/benchmark.json +62 -0
  105. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/eval_metadata.json +13 -0
  106. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/grading.json +11 -0
  107. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/outputs/analysis.md +382 -0
  108. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/timing.json +5 -0
  109. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/grading.json +11 -0
  110. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/outputs/analysis.md +333 -0
  111. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/timing.json +5 -0
  112. package/skills/tfx-workspace/iteration-2/review.html +1325 -0
  113. package/skills/tfx-workspace/skill-snapshot/tfx-auto/SKILL.md +217 -0
  114. package/skills/tfx-workspace/skill-snapshot/tfx-auto-codex/SKILL.md +77 -0
  115. package/skills/tfx-workspace/skill-snapshot/tfx-codex/SKILL.md +65 -0
  116. package/skills/tfx-workspace/skill-snapshot/tfx-doctor/SKILL.md +94 -0
  117. package/skills/tfx-workspace/skill-snapshot/tfx-gemini/SKILL.md +82 -0
  118. package/skills/tfx-workspace/skill-snapshot/tfx-hub/SKILL.md +133 -0
  119. package/skills/tfx-workspace/skill-snapshot/tfx-multi/SKILL.md +426 -0
  120. package/skills/tfx-workspace/skill-snapshot/tfx-setup/SKILL.md +101 -0
  121. package/.claude-plugin/marketplace.json +0 -34
  122. package/.claude-plugin/plugin.json +0 -22
  123. package/config/mcp-registry.json +0 -29
  124. package/tui/codex-profile.mjs +0 -402
  125. package/tui/core.mjs +0 -236
  126. package/tui/doctor.mjs +0 -328
  127. package/tui/gemini-profile.mjs +0 -254
  128. package/tui/monitor-data.mjs +0 -148
  129. package/tui/monitor.mjs +0 -295
  130. package/tui/setup.mjs +0 -442
@@ -1,13 +1,13 @@
1
- // hub/team/shared.mjs — 팀 모듈 공유 유틸리티
2
- // cli.mjs, dashboard.mjs 등에서 중복되던 상수/함수를 통합
3
-
4
- // ── ANSI 색상 상수 ──
5
- export const AMBER = "\x1b[38;5;214m";
6
- export const GREEN = "\x1b[38;5;82m";
7
- export const RED = "\x1b[38;5;196m";
8
- export const GRAY = "\x1b[38;5;245m";
9
- export const DIM = "\x1b[2m";
10
- export const BOLD = "\x1b[1m";
11
- export const RESET = "\x1b[0m";
12
- export const WHITE = "\x1b[97m";
13
- export const YELLOW = "\x1b[33m";
1
+ // hub/team/shared.mjs — 팀 모듈 공유 유틸리티
2
+ // cli.mjs, dashboard.mjs 등에서 중복되던 상수/함수를 통합
3
+
4
+ // ── ANSI 색상 상수 ──
5
+ export const AMBER = "\x1b[38;5;214m";
6
+ export const GREEN = "\x1b[38;5;82m";
7
+ export const RED = "\x1b[38;5;196m";
8
+ export const GRAY = "\x1b[38;5;245m";
9
+ export const DIM = "\x1b[2m";
10
+ export const BOLD = "\x1b[1m";
11
+ export const RESET = "\x1b[0m";
12
+ export const WHITE = "\x1b[97m";
13
+ export const YELLOW = "\x1b[33m";
@@ -4,8 +4,8 @@
4
4
  // Remote support: host option → SSH-based git operations via remote-session.mjs.
5
5
 
6
6
  import { execFile } from 'node:child_process';
7
- import { resolve, normalize } from 'node:path';
8
- import { mkdir, rm, access } from 'node:fs/promises';
7
+ import { resolve, normalize, join } from 'node:path';
8
+ import { mkdir, rm, access, readdir } from 'node:fs/promises';
9
9
  import { remoteGit, validateHost } from './remote-session.mjs';
10
10
 
11
11
  const SWARM_ROOT = '.codex-swarm';
@@ -92,6 +92,10 @@ export async function ensureWorktree({ slug, runId, rootDir = process.cwd(), bas
92
92
  await git(['worktree', 'add', wtDir, branchName], rootDir);
93
93
  }
94
94
 
95
+ // #34 L2: worktree에 복사된 .claude-plugin 제거 (하네스가 PLUGIN_ROOT를 오인하는 것 방지)
96
+ const pluginDir = join(wtDir, '.claude-plugin');
97
+ try { await rm(pluginDir, { recursive: true, force: true }); } catch { /* absent → ok */ }
98
+
95
99
  return { worktreePath: normPath(wtDir), branchName, remote: false };
96
100
  }
97
101
 
@@ -192,6 +196,61 @@ export async function pruneWorktree({ worktreePath, branchName, rootDir = proces
192
196
  }
193
197
  }
194
198
 
199
+ /**
200
+ * #34 L3: Detect and remove orphan worktree directories.
201
+ * Compares .codex-swarm/wt-* directories against `git worktree list`.
202
+ * Directories not registered as worktrees are removed.
203
+ *
204
+ * @param {object} [opts]
205
+ * @param {string} [opts.rootDir=process.cwd()]
206
+ * @returns {Promise<string[]>} removed directory names
207
+ */
208
+ export async function pruneOrphanWorktrees({ rootDir = process.cwd() } = {}) {
209
+ const swarmDir = resolve(rootDir, SWARM_ROOT);
210
+ const removed = [];
211
+
212
+ let entries;
213
+ try {
214
+ entries = await readdir(swarmDir);
215
+ } catch {
216
+ return removed; // .codex-swarm/ doesn't exist → nothing to clean
217
+ }
218
+
219
+ const wtDirs = entries.filter(e => e.startsWith('wt-'));
220
+ if (wtDirs.length === 0) return removed;
221
+
222
+ // Get registered worktree paths from git
223
+ let registeredPaths;
224
+ try {
225
+ const raw = await git(['worktree', 'list', '--porcelain'], rootDir);
226
+ registeredPaths = new Set(
227
+ raw.split('\n')
228
+ .filter(l => l.startsWith('worktree '))
229
+ .map(l => normPath(l.slice('worktree '.length))),
230
+ );
231
+ } catch {
232
+ return removed; // git worktree list failed → don't remove anything
233
+ }
234
+
235
+ for (const dir of wtDirs) {
236
+ const fullPath = resolve(swarmDir, dir);
237
+ const normalized = normPath(fullPath);
238
+ if (!registeredPaths.has(normalized)) {
239
+ try {
240
+ await rm(fullPath, { recursive: true, force: true });
241
+ removed.push(dir);
242
+ } catch { /* best-effort */ }
243
+ }
244
+ }
245
+
246
+ // Prune stale git references
247
+ if (removed.length > 0) {
248
+ try { await git(['worktree', 'prune'], rootDir); } catch { /* best-effort */ }
249
+ }
250
+
251
+ return removed;
252
+ }
253
+
195
254
  /**
196
255
  * Fetch a remote shard's branch to the local repo via SSH.
197
256
  * Workaround for hosts that cannot push to GitHub (e.g. Ultra4).