@triflux/core 10.0.0-alpha.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 (75) hide show
  1. package/hooks/agent-route-guard.mjs +109 -0
  2. package/hooks/cross-review-tracker.mjs +122 -0
  3. package/hooks/error-context.mjs +148 -0
  4. package/hooks/hook-manager.mjs +352 -0
  5. package/hooks/hook-orchestrator.mjs +312 -0
  6. package/hooks/hook-registry.json +213 -0
  7. package/hooks/hooks.json +89 -0
  8. package/hooks/keyword-rules.json +581 -0
  9. package/hooks/lib/resolve-root.mjs +59 -0
  10. package/hooks/mcp-config-watcher.mjs +85 -0
  11. package/hooks/pipeline-stop.mjs +76 -0
  12. package/hooks/safety-guard.mjs +106 -0
  13. package/hooks/subagent-verifier.mjs +80 -0
  14. package/hub/assign-callbacks.mjs +133 -0
  15. package/hub/bridge.mjs +799 -0
  16. package/hub/cli-adapter-base.mjs +192 -0
  17. package/hub/codex-adapter.mjs +190 -0
  18. package/hub/codex-compat.mjs +78 -0
  19. package/hub/codex-preflight.mjs +147 -0
  20. package/hub/delegator/contracts.mjs +37 -0
  21. package/hub/delegator/index.mjs +14 -0
  22. package/hub/delegator/schema/delegator-tools.schema.json +250 -0
  23. package/hub/delegator/service.mjs +307 -0
  24. package/hub/delegator/tool-definitions.mjs +35 -0
  25. package/hub/fullcycle.mjs +96 -0
  26. package/hub/gemini-adapter.mjs +179 -0
  27. package/hub/hitl.mjs +143 -0
  28. package/hub/intent.mjs +193 -0
  29. package/hub/lib/process-utils.mjs +361 -0
  30. package/hub/middleware/request-logger.mjs +81 -0
  31. package/hub/paths.mjs +30 -0
  32. package/hub/pipeline/gates/confidence.mjs +56 -0
  33. package/hub/pipeline/gates/consensus.mjs +94 -0
  34. package/hub/pipeline/gates/index.mjs +5 -0
  35. package/hub/pipeline/gates/selfcheck.mjs +82 -0
  36. package/hub/pipeline/index.mjs +318 -0
  37. package/hub/pipeline/state.mjs +191 -0
  38. package/hub/pipeline/transitions.mjs +124 -0
  39. package/hub/platform.mjs +225 -0
  40. package/hub/quality/deslop.mjs +253 -0
  41. package/hub/reflexion.mjs +372 -0
  42. package/hub/research.mjs +146 -0
  43. package/hub/router.mjs +791 -0
  44. package/hub/routing/complexity.mjs +166 -0
  45. package/hub/routing/index.mjs +117 -0
  46. package/hub/routing/q-learning.mjs +336 -0
  47. package/hub/session-fingerprint.mjs +352 -0
  48. package/hub/state.mjs +245 -0
  49. package/hub/team-bridge.mjs +25 -0
  50. package/hub/token-mode.mjs +224 -0
  51. package/hub/workers/worker-utils.mjs +104 -0
  52. package/hud/colors.mjs +88 -0
  53. package/hud/constants.mjs +81 -0
  54. package/hud/hud-qos-status.mjs +206 -0
  55. package/hud/providers/claude.mjs +309 -0
  56. package/hud/providers/codex.mjs +151 -0
  57. package/hud/providers/gemini.mjs +320 -0
  58. package/hud/renderers.mjs +424 -0
  59. package/hud/terminal.mjs +140 -0
  60. package/hud/utils.mjs +287 -0
  61. package/package.json +31 -0
  62. package/scripts/lib/claudemd-manager.mjs +325 -0
  63. package/scripts/lib/context.mjs +67 -0
  64. package/scripts/lib/cross-review-utils.mjs +51 -0
  65. package/scripts/lib/env-probe.mjs +241 -0
  66. package/scripts/lib/gemini-profiles.mjs +85 -0
  67. package/scripts/lib/hook-utils.mjs +14 -0
  68. package/scripts/lib/keyword-rules.mjs +166 -0
  69. package/scripts/lib/logger.mjs +105 -0
  70. package/scripts/lib/mcp-filter.mjs +739 -0
  71. package/scripts/lib/mcp-guard-engine.mjs +940 -0
  72. package/scripts/lib/mcp-manifest.mjs +79 -0
  73. package/scripts/lib/mcp-server-catalog.mjs +118 -0
  74. package/scripts/lib/psmux-info.mjs +119 -0
  75. package/scripts/lib/remote-spawn-transfer.mjs +196 -0
@@ -0,0 +1,213 @@
1
+ {
2
+ "$schema": "hook-registry-schema",
3
+ "version": 1,
4
+ "description": "훅 우선순위 레지스트리 — 오케스트레이터가 이 파일을 읽어 순차 실행한다. priority 낮을수록 먼저 실행.",
5
+ "defaults": {
6
+ "triflux_priority": 0,
7
+ "omc_priority": 50,
8
+ "external_priority": 100
9
+ },
10
+ "events": {
11
+ "PreToolUse": [
12
+ {
13
+ "id": "tfx-safety-guard",
14
+ "source": "triflux",
15
+ "matcher": "Bash",
16
+ "command": "node \"${PLUGIN_ROOT}/hooks/safety-guard.mjs\"",
17
+ "priority": 0,
18
+ "enabled": true,
19
+ "timeout": 3,
20
+ "blocking": true,
21
+ "description": "위험 Bash 명령 사전 차단 (rm -rf, force push 등)"
22
+ },
23
+ {
24
+ "id": "tfx-agent-route-guard",
25
+ "source": "triflux",
26
+ "matcher": "Agent",
27
+ "command": "node \"${PLUGIN_ROOT}/hooks/agent-route-guard.mjs\"",
28
+ "priority": 0,
29
+ "enabled": true,
30
+ "timeout": 3,
31
+ "blocking": false,
32
+ "description": "서브에이전트 스폰 시 triflux 컨텍스트 주입"
33
+ },
34
+ {
35
+ "id": "omc-headless-guard",
36
+ "source": "omc",
37
+ "matcher": "Bash|Agent",
38
+ "command": "bash \"${HOME}/.claude/scripts/headless-guard-fast.sh\"",
39
+ "priority": 50,
40
+ "enabled": true,
41
+ "timeout": 3,
42
+ "blocking": false,
43
+ "description": "psmux headless 가드"
44
+ },
45
+ {
46
+ "id": "omc-tfx-gate-activate",
47
+ "source": "omc",
48
+ "matcher": "Skill",
49
+ "command": "node \"${HOME}/.claude/scripts/tfx-gate-activate.mjs\"",
50
+ "priority": 50,
51
+ "enabled": true,
52
+ "timeout": 2,
53
+ "blocking": false,
54
+ "description": "tfx-multi 상태 추적 게이트"
55
+ }
56
+ ],
57
+ "PostToolUse": [
58
+ {
59
+ "id": "tfx-cross-review-tracker",
60
+ "source": "triflux",
61
+ "matcher": "Edit|Write",
62
+ "command": "node \"${PLUGIN_ROOT}/hooks/cross-review-tracker.mjs\"",
63
+ "priority": 0,
64
+ "enabled": true,
65
+ "timeout": 3,
66
+ "blocking": false,
67
+ "description": "파일 수정 추적 → 교차 리뷰 nudge"
68
+ },
69
+ {
70
+ "id": "tfx-mcp-config-watcher",
71
+ "source": "triflux",
72
+ "matcher": "Edit|Write",
73
+ "command": "node \"${PLUGIN_ROOT}/hooks/mcp-config-watcher.mjs\"",
74
+ "priority": 1,
75
+ "enabled": true,
76
+ "timeout": 3,
77
+ "blocking": false,
78
+ "description": "감시 대상 MCP 설정 변경 감지 → stdio MCP 자동 치환"
79
+ }
80
+ ],
81
+ "PostToolUseFailure": [
82
+ {
83
+ "id": "tfx-error-context",
84
+ "source": "triflux",
85
+ "matcher": "*",
86
+ "command": "node \"${PLUGIN_ROOT}/hooks/error-context.mjs\"",
87
+ "priority": 0,
88
+ "enabled": true,
89
+ "timeout": 3,
90
+ "blocking": false,
91
+ "description": "도구 실패 시 에러 힌트 자동 주입"
92
+ }
93
+ ],
94
+ "UserPromptSubmit": [
95
+ {
96
+ "id": "tfx-keyword-detector",
97
+ "source": "triflux",
98
+ "matcher": "*",
99
+ "command": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/keyword-detector.mjs\"",
100
+ "priority": 0,
101
+ "enabled": true,
102
+ "timeout": 5,
103
+ "blocking": false,
104
+ "description": "키워드 매칭 → 스킬 자동 라우팅"
105
+ }
106
+ ],
107
+ "SessionStart": [
108
+ {
109
+ "id": "tfx-setup",
110
+ "source": "triflux",
111
+ "matcher": "*",
112
+ "command": "node \"${PLUGIN_ROOT}/scripts/setup.mjs\"",
113
+ "priority": 0,
114
+ "enabled": true,
115
+ "timeout": 10,
116
+ "blocking": false,
117
+ "description": "triflux 환경 초기화"
118
+ },
119
+ {
120
+ "id": "tfx-mcp-safety-guard",
121
+ "source": "triflux",
122
+ "matcher": "*",
123
+ "command": "node \"${PLUGIN_ROOT}/scripts/mcp-safety-guard.mjs\"",
124
+ "priority": 1,
125
+ "enabled": true,
126
+ "timeout": 3,
127
+ "blocking": false,
128
+ "description": "Gemini stdio MCP 자동 감지 + 제거 (spawn EPERM 방지)"
129
+ },
130
+ {
131
+ "id": "tfx-hub-ensure",
132
+ "source": "triflux",
133
+ "matcher": "*",
134
+ "command": "node \"${PLUGIN_ROOT}/scripts/hub-ensure.mjs\"",
135
+ "priority": 2,
136
+ "enabled": true,
137
+ "timeout": 8,
138
+ "blocking": false,
139
+ "description": "tfx-hub 서비스 헬스체크 및 시작"
140
+ },
141
+ {
142
+ "id": "tfx-preflight-cache",
143
+ "source": "triflux",
144
+ "matcher": "*",
145
+ "command": "node \"${PLUGIN_ROOT}/scripts/preflight-cache.mjs\"",
146
+ "priority": 3,
147
+ "enabled": true,
148
+ "timeout": 5,
149
+ "blocking": false,
150
+ "description": "CLI/Hub 가용성 캐시 (hub-ensure 완료 후 실행)"
151
+ },
152
+ {
153
+ "id": "ext-session-vault-start",
154
+ "source": "session-vault",
155
+ "matcher": "*",
156
+ "command": "${HOME}/Desktop/Projects/cli/session-vault/scripts/start_hook.sh",
157
+ "priority": 100,
158
+ "enabled": false,
159
+ "timeout": 10,
160
+ "blocking": false,
161
+ "description": "세션 볼트 로깅 시작"
162
+ }
163
+ ],
164
+ "Stop": [
165
+ {
166
+ "id": "tfx-pipeline-stop",
167
+ "source": "triflux",
168
+ "matcher": "*",
169
+ "command": "node \"${PLUGIN_ROOT}/hooks/pipeline-stop.mjs\"",
170
+ "priority": 0,
171
+ "enabled": true,
172
+ "timeout": 5,
173
+ "blocking": true,
174
+ "description": "활성 파이프라인 감지 → 종료 차단"
175
+ },
176
+ {
177
+ "id": "ext-session-vault-export",
178
+ "source": "session-vault",
179
+ "matcher": "*",
180
+ "command": "${HOME}/Desktop/Projects/cli/session-vault/scripts/export_hook.sh",
181
+ "priority": 100,
182
+ "enabled": false,
183
+ "timeout": 30,
184
+ "blocking": false,
185
+ "description": "세션 트랜스크립트 내보내기"
186
+ },
187
+ {
188
+ "id": "ext-mcp-cleanup",
189
+ "source": "system",
190
+ "matcher": "*",
191
+ "command": "powershell -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File \"${HOME}/.claude/scripts/mcp-cleanup.ps1\"",
192
+ "priority": 100,
193
+ "enabled": true,
194
+ "timeout": 8,
195
+ "blocking": false,
196
+ "description": "MCP 고아 프로세스 정리"
197
+ }
198
+ ],
199
+ "SubagentStop": [
200
+ {
201
+ "id": "tfx-subagent-verifier",
202
+ "source": "triflux",
203
+ "matcher": "*",
204
+ "command": "node \"${PLUGIN_ROOT}/hooks/subagent-verifier.mjs\"",
205
+ "priority": 0,
206
+ "enabled": true,
207
+ "timeout": 3,
208
+ "blocking": false,
209
+ "description": "서브에이전트 결과 품질 체크"
210
+ }
211
+ ]
212
+ }
213
+ }
@@ -0,0 +1,89 @@
1
+ {
2
+ "description": "triflux lifecycle hooks v2 — hook-orchestrator 기반 순차 실행. 우선순위는 hook-registry.json에서 관리.",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "matcher": "*",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-orchestrator.mjs\"",
11
+ "timeout": 15
12
+ }
13
+ ]
14
+ }
15
+ ],
16
+ "UserPromptSubmit": [
17
+ {
18
+ "matcher": "*",
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-orchestrator.mjs\"",
23
+ "timeout": 10
24
+ }
25
+ ]
26
+ }
27
+ ],
28
+ "PreToolUse": [
29
+ {
30
+ "matcher": "Bash|Agent|Skill",
31
+ "hooks": [
32
+ {
33
+ "type": "command",
34
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-orchestrator.mjs\"",
35
+ "timeout": 10
36
+ }
37
+ ]
38
+ }
39
+ ],
40
+ "PostToolUse": [
41
+ {
42
+ "matcher": "Edit|Write",
43
+ "hooks": [
44
+ {
45
+ "type": "command",
46
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-orchestrator.mjs\"",
47
+ "timeout": 5
48
+ }
49
+ ]
50
+ }
51
+ ],
52
+ "PostToolUseFailure": [
53
+ {
54
+ "matcher": "*",
55
+ "hooks": [
56
+ {
57
+ "type": "command",
58
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-orchestrator.mjs\"",
59
+ "timeout": 5
60
+ }
61
+ ]
62
+ }
63
+ ],
64
+ "Stop": [
65
+ {
66
+ "matcher": "*",
67
+ "hooks": [
68
+ {
69
+ "type": "command",
70
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-orchestrator.mjs\"",
71
+ "timeout": 35
72
+ }
73
+ ]
74
+ }
75
+ ],
76
+ "SubagentStop": [
77
+ {
78
+ "matcher": "*",
79
+ "hooks": [
80
+ {
81
+ "type": "command",
82
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-orchestrator.mjs\"",
83
+ "timeout": 5
84
+ }
85
+ ]
86
+ }
87
+ ]
88
+ }
89
+ }