triflux 7.1.4 → 7.2.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 (73) hide show
  1. package/.claude-plugin/marketplace.json +31 -31
  2. package/.claude-plugin/plugin.json +22 -23
  3. package/bin/triflux.mjs +18 -5
  4. package/hooks/keyword-rules.json +393 -361
  5. package/hub/bridge.mjs +799 -786
  6. package/hub/delegator/contracts.mjs +37 -38
  7. package/hub/delegator/schema/delegator-tools.schema.json +250 -250
  8. package/hub/delegator/service.mjs +307 -302
  9. package/hub/intent.mjs +108 -11
  10. package/hub/lib/process-utils.mjs +20 -0
  11. package/hub/pipe.mjs +589 -589
  12. package/hub/pipeline/gates/confidence.mjs +1 -1
  13. package/hub/pipeline/gates/selfcheck.mjs +2 -4
  14. package/hub/pipeline/state.mjs +191 -187
  15. package/hub/pipeline/transitions.mjs +124 -120
  16. package/hub/public/dashboard.html +355 -349
  17. package/hub/quality/deslop.mjs +5 -3
  18. package/hub/reflexion.mjs +5 -1
  19. package/hub/research.mjs +6 -1
  20. package/hub/router.mjs +791 -782
  21. package/hub/server.mjs +893 -822
  22. package/hub/store.mjs +807 -778
  23. package/hub/team/agent-map.json +10 -0
  24. package/hub/team/ansi.mjs +3 -4
  25. package/hub/team/cli/commands/control.mjs +43 -43
  26. package/hub/team/cli/commands/interrupt.mjs +36 -36
  27. package/hub/team/cli/commands/kill.mjs +3 -3
  28. package/hub/team/cli/commands/send.mjs +37 -37
  29. package/hub/team/cli/commands/start/index.mjs +18 -8
  30. package/hub/team/cli/commands/start/parse-args.mjs +3 -1
  31. package/hub/team/cli/commands/start/start-headless.mjs +4 -1
  32. package/hub/team/cli/commands/status.mjs +87 -87
  33. package/hub/team/cli/commands/stop.mjs +1 -1
  34. package/hub/team/cli/commands/task.mjs +1 -1
  35. package/hub/team/cli/index.mjs +41 -39
  36. package/hub/team/cli/manifest.mjs +29 -28
  37. package/hub/team/cli/services/hub-client.mjs +37 -0
  38. package/hub/team/cli/services/state-store.mjs +26 -12
  39. package/hub/team/dashboard.mjs +11 -4
  40. package/hub/team/handoff.mjs +12 -0
  41. package/hub/team/headless.mjs +202 -200
  42. package/hub/team/native-supervisor.mjs +386 -346
  43. package/hub/team/nativeProxy.mjs +680 -692
  44. package/hub/team/staleState.mjs +361 -369
  45. package/hub/team/tui-viewer.mjs +27 -3
  46. package/hub/team/tui.mjs +1 -0
  47. package/hub/token-mode.mjs +114 -24
  48. package/hub/workers/delegator-mcp.mjs +1059 -1057
  49. package/hud/colors.mjs +88 -0
  50. package/hud/constants.mjs +78 -0
  51. package/hud/hud-qos-status.mjs +206 -1872
  52. package/hud/providers/claude.mjs +309 -0
  53. package/hud/providers/codex.mjs +151 -0
  54. package/hud/providers/gemini.mjs +320 -0
  55. package/hud/renderers.mjs +424 -0
  56. package/hud/terminal.mjs +140 -0
  57. package/hud/utils.mjs +271 -0
  58. package/package.json +1 -2
  59. package/scripts/__tests__/keyword-detector.test.mjs +234 -234
  60. package/scripts/headless-guard-fast.sh +21 -0
  61. package/scripts/headless-guard.mjs +26 -6
  62. package/scripts/lib/keyword-rules.mjs +166 -168
  63. package/scripts/setup.mjs +720 -690
  64. package/scripts/tfx-route-post.mjs +424 -424
  65. package/scripts/tfx-route.sh +1663 -1650
  66. package/scripts/tmp-cleanup.mjs +74 -0
  67. package/skills/tfx-auto/SKILL.md +279 -278
  68. package/skills/tfx-auto-codex/SKILL.md +98 -77
  69. package/skills/tfx-codex/SKILL.md +65 -65
  70. package/skills/tfx-gemini/SKILL.md +83 -82
  71. package/skills/tfx-hub/SKILL.md +205 -136
  72. package/skills/tfx-multi/SKILL.md +11 -5
  73. package/.mcp.json +0 -8
@@ -6,8 +6,8 @@
6
6
  import { readdir, readFile, writeFile, stat } from 'node:fs/promises';
7
7
  import { join, relative } from 'node:path';
8
8
 
9
- /** @type {Array<{type: string, pattern: RegExp, severity: string, autoFixable: boolean, multiline: boolean}>} */
10
- export const SLOP_PATTERNS = [
9
+ /** @type {ReadonlyArray<{type: string, pattern: RegExp, severity: string, autoFixable: boolean, multiline: boolean}>} */
10
+ export const SLOP_PATTERNS = Object.freeze([
11
11
  {
12
12
  type: 'trivial_comment',
13
13
  pattern: /^\s*\/\/\s*(import|define|set|get|return|export)\s/i,
@@ -57,7 +57,7 @@ export const SLOP_PATTERNS = [
57
57
  autoFixable: true,
58
58
  multiline: false,
59
59
  },
60
- ];
60
+ ]);
61
61
 
62
62
  const SEVERITY_WEIGHT = { low: 2, med: 5 };
63
63
 
@@ -82,6 +82,7 @@ export function detectSlop(content, filePath = '') {
82
82
  suggestion: `${sp.type} 패턴 감지`,
83
83
  text: lines[i].trim(),
84
84
  autoFixable: sp.autoFixable,
85
+ file: filePath,
85
86
  });
86
87
  }
87
88
  }
@@ -100,6 +101,7 @@ export function detectSlop(content, filePath = '') {
100
101
  suggestion: `${sp.type} 패턴 감지`,
101
102
  text: match[0].split('\n')[0].trim(),
102
103
  autoFixable: sp.autoFixable,
104
+ file: filePath,
103
105
  });
104
106
  }
105
107
  }
package/hub/reflexion.mjs CHANGED
@@ -68,13 +68,17 @@ export function learnFromError(store, { error, solution, context = {}, success =
68
68
  return store.updateReflexionHit(existing[0].id, success);
69
69
  }
70
70
 
71
- return store.addReflexion({
71
+ const newEntry = store.addReflexion({
72
72
  error_pattern: pattern,
73
73
  error_message: error,
74
74
  context,
75
75
  solution,
76
76
  solution_code: null,
77
77
  });
78
+ if (success && newEntry) {
79
+ return store.updateReflexionHit(newEntry.id, true);
80
+ }
81
+ return newEntry;
78
82
  }
79
83
 
80
84
  /**
package/hub/research.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  // 검색 쿼리 생성 → 결과 정규화 → 보고서 빌드 → 저장
3
3
 
4
4
  import { mkdirSync, writeFileSync } from 'node:fs';
5
- import { join } from 'node:path';
5
+ import { join, resolve } from 'node:path';
6
6
  import { TFX_REPORTS_DIR } from './paths.mjs';
7
7
 
8
8
  /**
@@ -103,6 +103,11 @@ ${sourcesSection || '_출처 없음_'}
103
103
  */
104
104
  export function saveReport(topic, content, baseDir = process.cwd()) {
105
105
  const dir = join(baseDir, TFX_REPORTS_DIR);
106
+ const resolvedDir = resolve(dir);
107
+ const expectedBase = resolve(baseDir || TFX_REPORTS_DIR);
108
+ if (!resolvedDir.startsWith(expectedBase)) {
109
+ throw new Error('Invalid report directory: path traversal detected');
110
+ }
106
111
  mkdirSync(dir, { recursive: true });
107
112
 
108
113
  const ts = new Date().toISOString().replace(/[:.]/g, '-').replace('T', '_').slice(0, 19);