triflux 7.0.0 → 7.0.2

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.
@@ -38,7 +38,7 @@ function renderTmuxInstallHelp() {
38
38
  export { parseTeamArgs };
39
39
 
40
40
  export async function teamStart(args = []) {
41
- const { agents, lead, layout, teammateMode, task: rawTask, assigns, autoAttach, progressive, timeoutSec, verbose, mcpProfile } = parseTeamArgs(args);
41
+ const { agents, lead, layout, teammateMode, task: rawTask, assigns, autoAttach, progressive, timeoutSec, verbose, dashboard, mcpProfile } = parseTeamArgs(args);
42
42
  // --assign 사용 시 task를 자동 생성
43
43
  const task = rawTask || (assigns.length > 0 ? assigns.map(a => a.prompt).join(" + ") : "");
44
44
  if (!task) return printStartUsage();
@@ -72,7 +72,7 @@ export async function teamStart(args = []) {
72
72
  const state = effectiveMode === "in-process"
73
73
  ? await startInProcessTeam({ sessionId, task, lead, agents, subtasks, hubUrl })
74
74
  : effectiveMode === "headless"
75
- ? await startHeadlessTeam({ sessionId, task, lead, agents, subtasks, layout, assigns, autoAttach, progressive, timeoutSec, verbose, mcpProfile })
75
+ ? await startHeadlessTeam({ sessionId, task, lead, agents, subtasks, layout, assigns, autoAttach, progressive, timeoutSec, verbose, dashboard, mcpProfile })
76
76
  : effectiveMode === "wt"
77
77
  ? await startWtTeam({ sessionId, task, lead, agents, subtasks, layout, hubUrl })
78
78
  : await startMuxTeam({ sessionId, task, lead, agents, subtasks, layout, hubUrl, teammateMode: effectiveMode });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "type": "module",
6
6
  "bin": {
@@ -50,7 +50,8 @@ function isPsmuxInstalled() {
50
50
  }
51
51
 
52
52
  /**
53
- * tfx-route.sh 명령에서 agent, prompt 파싱한다.
53
+ * tfx-route.sh 명령에서 agent, prompt, mcp, 추가 플래그를 파싱한다.
54
+ * v3: 손실 없는 파싱 — 원본 명령의 모든 플래그를 보존.
54
55
  */
55
56
  function parseRouteCommand(cmd) {
56
57
  const MCP_PROFILES = ["implement", "analyze", "review", "docs"];
@@ -79,7 +80,17 @@ function parseRouteCommand(cmd) {
79
80
  .replace(/'"'"'/g, "'")
80
81
  .trim();
81
82
 
82
- return { agent, prompt, mcp };
83
+ // v3: 원본 명령에서 추가 플래그 추출
84
+ const flags = {};
85
+ const timeoutMatch = cmd.match(/(?:^|\s)(\d{2,4})(?:\s|$)/); // 4번째 인자 (timeout)
86
+ if (timeoutMatch) flags.timeout = parseInt(timeoutMatch[1], 10);
87
+
88
+ // 환경변수 기반 글로벌 플래그
89
+ if (process.env.TFX_DASHBOARD === "1") flags.dashboard = true;
90
+ if (process.env.TFX_VERBOSE === "1") flags.verbose = true;
91
+ if (process.env.TFX_NO_AUTO_ATTACH === "1") flags.noAutoAttach = true;
92
+
93
+ return { agent, prompt, mcp, flags };
83
94
  }
84
95
 
85
96
  function autoRoute(updatedCommand, reason) {
@@ -143,10 +154,21 @@ async function main() {
143
154
  if (parsed) {
144
155
  const safePrompt = parsed.prompt.replace(/'/g, "'\\''");
145
156
  const VALID_MCP = new Set(["implement", "analyze", "review", "docs"]);
146
- const mcpFlag = parsed.mcp && VALID_MCP.has(parsed.mcp) ? ` --mcp-profile ${parsed.mcp}` : "";
157
+ const f = parsed.flags || {};
158
+
159
+ // v3: 플래그 빌더 — 하드코딩 제거, 원본 의도 보존
160
+ const parts = ["tfx multi --teammate-mode headless"];
161
+ if (!f.noAutoAttach) parts.push("--auto-attach");
162
+ if (f.dashboard) parts.push("--dashboard");
163
+ if (f.verbose) parts.push("--verbose");
164
+ parts.push(`--assign '${parsed.agent}:${safePrompt}:${parsed.agent}'`);
165
+ if (parsed.mcp && VALID_MCP.has(parsed.mcp)) parts.push(`--mcp-profile ${parsed.mcp}`);
166
+ parts.push(`--timeout ${f.timeout || 600}`);
167
+
168
+ const builtCmd = parts.join(" ");
147
169
  autoRoute(
148
- `tfx multi --teammate-mode headless --auto-attach --assign '${parsed.agent}:${safePrompt}:${parsed.agent}'${mcpFlag} --timeout 600`,
149
- `[headless-guard] auto-route: tfx-route.sh ${parsed.agent} → headless. mcp=${parsed.mcp}`,
170
+ builtCmd,
171
+ `[headless-guard] auto-route: tfx-route.sh ${parsed.agent} → headless. mcp=${parsed.mcp} dashboard=${!!f.dashboard}`,
150
172
  );
151
173
  }
152
174
  deny(