triflux 7.0.3 → 7.0.4
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.
- package/hub/team/headless.mjs +9 -13
- package/package.json +1 -1
package/hub/team/headless.mjs
CHANGED
|
@@ -72,17 +72,12 @@ const MCP_PROFILE_HINTS = {
|
|
|
72
72
|
*/
|
|
73
73
|
export function buildHeadlessCommand(cli, prompt, resultFile, opts = {}) {
|
|
74
74
|
const { handoff = true, mcp } = opts;
|
|
75
|
-
// 에이전트 역할명("executor" 등)을 CLI 타입으로 해석
|
|
76
75
|
const resolvedCli = resolveCliType(cli);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
const fullPrompt =
|
|
81
|
-
? `${prompt}${mcpHint}\n\n${HANDOFF_INSTRUCTION}`
|
|
82
|
-
: `${prompt}${mcpHint}`;
|
|
83
|
-
// 프롬프트의 단일 인용부호를 이스케이프
|
|
76
|
+
const mcpHint = mcp && MCP_PROFILE_HINTS[mcp] ? ` [MCP: ${mcp}] ${MCP_PROFILE_HINTS[mcp]}` : "";
|
|
77
|
+
// HANDOFF 지시는 프롬프트에 삽입하지 않음 — headless 후처리(processHandoff)에서 처리
|
|
78
|
+
// psmux send-keys 줄바꿈 문제 + codex exec "---" 인자 충돌 방지
|
|
79
|
+
const fullPrompt = `${prompt}${mcpHint}`;
|
|
84
80
|
const escaped = fullPrompt.replace(/'/g, "''");
|
|
85
|
-
// Clear-Host: 실행 즉시 이전 PS 프롬프트 + 명령 텍스트를 깨끗이 지움
|
|
86
81
|
const cls = "Clear-Host; ";
|
|
87
82
|
|
|
88
83
|
switch (resolvedCli) {
|
|
@@ -149,12 +144,13 @@ export async function runHeadless(sessionName, assignments, opts = {}) {
|
|
|
149
144
|
applyTrifluxTheme(sessionName);
|
|
150
145
|
if (safeProgress) safeProgress({ type: "session_created", sessionName, panes: session.panes });
|
|
151
146
|
|
|
152
|
-
// v7.0: dashboard pane — pane 0에 TUI 뷰어를 실행
|
|
147
|
+
// v7.0: dashboard pane — pane 0에 TUI 뷰어를 send-keys로 실행
|
|
153
148
|
if (dashboard) {
|
|
154
|
-
const viewerPath = join(import.meta.dirname
|
|
155
|
-
const
|
|
149
|
+
const viewerPath = join(import.meta.dirname, "tui-viewer.mjs").replace(/\\/g, "/");
|
|
150
|
+
const resultDir = RESULT_DIR.replace(/\\/g, "/");
|
|
151
|
+
const viewerCmd = `node ${viewerPath} --session ${sessionName} --result-dir ${resultDir}`;
|
|
156
152
|
try {
|
|
157
|
-
|
|
153
|
+
psmuxExec(["send-keys", "-t", `${sessionName}:0.0`, viewerCmd, "Enter"]);
|
|
158
154
|
psmuxExec(["select-pane", "-t", `${sessionName}:0.0`, "-T", "▲ dashboard"]);
|
|
159
155
|
} catch { /* 무시 */ }
|
|
160
156
|
}
|