triflux 3.2.0-dev.8 → 3.3.0-dev.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.
Files changed (52) hide show
  1. package/bin/triflux.mjs +1296 -1055
  2. package/hooks/hooks.json +17 -0
  3. package/hooks/keyword-rules.json +20 -4
  4. package/hooks/pipeline-stop.mjs +54 -0
  5. package/hub/bridge.mjs +517 -318
  6. package/hub/hitl.mjs +45 -31
  7. package/hub/pipe.mjs +457 -0
  8. package/hub/pipeline/index.mjs +121 -0
  9. package/hub/pipeline/state.mjs +164 -0
  10. package/hub/pipeline/transitions.mjs +114 -0
  11. package/hub/router.mjs +422 -161
  12. package/hub/schema.sql +14 -0
  13. package/hub/server.mjs +499 -424
  14. package/hub/store.mjs +388 -314
  15. package/hub/team/cli-team-common.mjs +348 -0
  16. package/hub/team/cli-team-control.mjs +393 -0
  17. package/hub/team/cli-team-start.mjs +516 -0
  18. package/hub/team/cli-team-status.mjs +269 -0
  19. package/hub/team/cli.mjs +75 -1475
  20. package/hub/team/dashboard.mjs +1 -9
  21. package/hub/team/native.mjs +190 -130
  22. package/hub/team/nativeProxy.mjs +165 -78
  23. package/hub/team/orchestrator.mjs +15 -20
  24. package/hub/team/pane.mjs +137 -103
  25. package/hub/team/psmux.mjs +506 -0
  26. package/hub/team/session.mjs +393 -330
  27. package/hub/team/shared.mjs +13 -0
  28. package/hub/team/staleState.mjs +299 -0
  29. package/hub/tools.mjs +105 -31
  30. package/hub/workers/claude-worker.mjs +446 -0
  31. package/hub/workers/codex-mcp.mjs +414 -0
  32. package/hub/workers/factory.mjs +18 -0
  33. package/hub/workers/gemini-worker.mjs +349 -0
  34. package/hub/workers/interface.mjs +41 -0
  35. package/hud/hud-qos-status.mjs +1790 -1788
  36. package/package.json +4 -1
  37. package/scripts/__tests__/keyword-detector.test.mjs +8 -8
  38. package/scripts/keyword-detector.mjs +15 -0
  39. package/scripts/lib/keyword-rules.mjs +4 -1
  40. package/scripts/preflight-cache.mjs +72 -0
  41. package/scripts/psmux-steering-prototype.sh +368 -0
  42. package/scripts/setup.mjs +136 -71
  43. package/scripts/tfx-route-worker.mjs +161 -0
  44. package/scripts/tfx-route.sh +485 -91
  45. package/skills/tfx-auto/SKILL.md +90 -564
  46. package/skills/tfx-auto-codex/SKILL.md +1 -3
  47. package/skills/tfx-codex/SKILL.md +1 -4
  48. package/skills/tfx-doctor/SKILL.md +1 -0
  49. package/skills/tfx-gemini/SKILL.md +1 -4
  50. package/skills/tfx-multi/SKILL.md +378 -0
  51. package/skills/tfx-setup/SKILL.md +1 -4
  52. package/skills/tfx-team/SKILL.md +0 -304
package/hooks/hooks.json CHANGED
@@ -9,6 +9,11 @@
9
9
  "type": "command",
10
10
  "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/setup.mjs\"",
11
11
  "timeout": 10
12
+ },
13
+ {
14
+ "type": "command",
15
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/preflight-cache.mjs\"",
16
+ "timeout": 5
12
17
  }
13
18
  ]
14
19
  }
@@ -24,6 +29,18 @@
24
29
  }
25
30
  ]
26
31
  }
32
+ ],
33
+ "Stop": [
34
+ {
35
+ "matcher": "*",
36
+ "hooks": [
37
+ {
38
+ "type": "command",
39
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/pipeline-stop.mjs\"",
40
+ "timeout": 5
41
+ }
42
+ ]
43
+ }
27
44
  ]
28
45
  }
29
46
  }
@@ -11,7 +11,7 @@
11
11
  "skill": "tfx-cancel",
12
12
  "priority": 0,
13
13
  "supersedes": [
14
- "tfx-team",
14
+ "tfx-multi",
15
15
  "tfx-auto",
16
16
  "tfx-auto-codex",
17
17
  "tfx-codex",
@@ -22,14 +22,14 @@
22
22
  "mcp_route": null
23
23
  },
24
24
  {
25
- "id": "tfx-team",
25
+ "id": "tfx-multi",
26
26
  "patterns": [
27
27
  {
28
- "source": "(?<!\\b(?:my|the|our|omc|oh-my-claudecode)\\s)\\btfx[\\s-]?team\\b",
28
+ "source": "(?<!\\b(?:my|the|our|omc|oh-my-claudecode)\\s)\\btfx[\\s-]?multi\\b",
29
29
  "flags": "i"
30
30
  }
31
31
  ],
32
- "skill": "tfx-team",
32
+ "skill": "tfx-multi",
33
33
  "priority": 1,
34
34
  "supersedes": [],
35
35
  "exclusive": false,
@@ -277,6 +277,22 @@
277
277
  "state": null,
278
278
  "mcp_route": null
279
279
  },
280
+ {
281
+ "id": "suppress-omc-team",
282
+ "patterns": [
283
+ {
284
+ "source": "(?<!tfx[\\s-]?)(팀|\\bteam\\b)",
285
+ "flags": "i"
286
+ }
287
+ ],
288
+ "skill": null,
289
+ "action": "suppress_omc",
290
+ "priority": 20,
291
+ "supersedes": [],
292
+ "exclusive": false,
293
+ "state": null,
294
+ "mcp_route": null
295
+ },
280
296
  {
281
297
  "id": "confluence-route",
282
298
  "patterns": [
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+ // hooks/pipeline-stop.mjs — 파이프라인 진행 중 세션 중단 시 지속 프롬프트 주입
3
+ //
4
+ // Claude Code의 Stop 이벤트에서 실행.
5
+ // 비터미널 단계의 파이프라인이 있으면 "작업 계속" 프롬프트를 반환한다.
6
+
7
+ import { existsSync } from 'node:fs';
8
+ import { join } from 'node:path';
9
+ import { homedir } from 'node:os';
10
+
11
+ const HUB_DB_PATH = join(homedir(), '.claude', 'cache', 'tfx-hub', 'state.db');
12
+ const TERMINAL = new Set(['complete', 'failed']);
13
+
14
+ async function getPipelineStopPrompt() {
15
+ if (!existsSync(HUB_DB_PATH)) return null;
16
+
17
+ try {
18
+ const { default: Database } = await import('better-sqlite3');
19
+ const { ensurePipelineTable, listPipelineStates } = await import(
20
+ join(process.env.CLAUDE_PLUGIN_ROOT || '.', 'hub', 'pipeline', 'state.mjs')
21
+ );
22
+
23
+ const db = new Database(HUB_DB_PATH, { readonly: true });
24
+ ensurePipelineTable(db);
25
+ const states = listPipelineStates(db);
26
+ db.close();
27
+
28
+ // 비터미널 단계의 활성 파이프라인 찾기
29
+ const active = states.filter((s) => !TERMINAL.has(s.phase));
30
+ if (active.length === 0) return null;
31
+
32
+ const lines = active.map((s) =>
33
+ `- 팀 ${s.team_name}: ${s.phase} 단계 (fix: ${s.fix_attempt}/${s.fix_max}, ralph: ${s.ralph_iteration}/${s.ralph_max})`
34
+ );
35
+
36
+ return `[tfx-multi 파이프라인 진행 중]
37
+ 활성 파이프라인이 있습니다:
38
+ ${lines.join('\n')}
39
+
40
+ 파이프라인을 이어서 진행하려면 /tfx-multi status 로 상태를 확인하세요.`;
41
+ } catch {
42
+ return null;
43
+ }
44
+ }
45
+
46
+ try {
47
+ const prompt = await getPipelineStopPrompt();
48
+ if (prompt) {
49
+ // hook 출력으로 지속 프롬프트 전달
50
+ console.log(prompt);
51
+ }
52
+ } catch {
53
+ // stop 훅 실패는 무시
54
+ }