triflux 6.0.7 → 6.0.9
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 +53 -4
- package/package.json +1 -1
package/hub/team/headless.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// v6.0.0: Lead-direct 모드 (runHeadlessInteractive, autoAttachTerminal)
|
|
5
5
|
// 의존성: psmux.mjs (Node.js 내장 모듈만 사용)
|
|
6
6
|
import { join } from "node:path";
|
|
7
|
-
import { readFileSync, existsSync, mkdirSync } from "node:fs";
|
|
7
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
|
|
8
8
|
import { tmpdir } from "node:os";
|
|
9
9
|
import { execSync, execFileSync } from "node:child_process";
|
|
10
10
|
import {
|
|
@@ -275,6 +275,54 @@ export function applyTrifluxTheme(sessionName) {
|
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
/**
|
|
279
|
+
* Windows Terminal에 triflux 프로필을 자동 생성/갱신한다.
|
|
280
|
+
* 반투명 + 비포커스 시 더 투명 + Catppuccin 테마.
|
|
281
|
+
* @returns {boolean} 성공 여부
|
|
282
|
+
*/
|
|
283
|
+
export function ensureWtProfile() {
|
|
284
|
+
const settingsPaths = [
|
|
285
|
+
join(process.env.LOCALAPPDATA || "", "Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json"),
|
|
286
|
+
join(process.env.LOCALAPPDATA || "", "Microsoft/Windows Terminal/settings.json"),
|
|
287
|
+
];
|
|
288
|
+
|
|
289
|
+
for (const settingsPath of settingsPaths) {
|
|
290
|
+
if (!existsSync(settingsPath)) continue;
|
|
291
|
+
try {
|
|
292
|
+
const raw = readFileSync(settingsPath, "utf8");
|
|
293
|
+
// JSON with comments — 간단한 strip (// 주석만)
|
|
294
|
+
const cleaned = raw.replace(/^\s*\/\/.*$/gm, "");
|
|
295
|
+
const settings = JSON.parse(cleaned);
|
|
296
|
+
if (!settings.profiles?.list) continue;
|
|
297
|
+
|
|
298
|
+
const existing = settings.profiles.list.findIndex(p => p.name === "triflux");
|
|
299
|
+
const profile = {
|
|
300
|
+
name: "triflux",
|
|
301
|
+
commandline: "psmux",
|
|
302
|
+
icon: "\u{1F53A}", // 🔺
|
|
303
|
+
tabTitle: "triflux",
|
|
304
|
+
suppressApplicationTitle: true,
|
|
305
|
+
opacity: 50,
|
|
306
|
+
useAcrylic: true,
|
|
307
|
+
unfocusedAppearance: { opacity: 30 },
|
|
308
|
+
colorScheme: "One Half Dark",
|
|
309
|
+
font: { size: 11 },
|
|
310
|
+
hidden: true, // 프로필 목록에는 숨김 (triflux에서만 사용)
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
if (existing >= 0) {
|
|
314
|
+
settings.profiles.list[existing] = { ...settings.profiles.list[existing], ...profile };
|
|
315
|
+
} else {
|
|
316
|
+
settings.profiles.list.push(profile);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2), "utf8");
|
|
320
|
+
return true;
|
|
321
|
+
} catch { /* 파싱 실패 — 다음 경로 */ }
|
|
322
|
+
}
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
|
|
278
326
|
// ─── v6.0.0: Lead-Direct Interactive Mode ───
|
|
279
327
|
|
|
280
328
|
/**
|
|
@@ -294,14 +342,15 @@ export function autoAttachTerminal(sessionName, opts = {}) {
|
|
|
294
342
|
return false; // wt.exe 미설치 — 사용자에게 수동 attach 안내 필요
|
|
295
343
|
}
|
|
296
344
|
|
|
345
|
+
// triflux WT 프로필 확보 (투명도 + 테마)
|
|
346
|
+
ensureWtProfile();
|
|
347
|
+
|
|
297
348
|
// PowerShell 래핑 + "--" 구분자 + 포커스 비탈취
|
|
298
|
-
// pwsh.exe (PS7) 우선, 없으면 powershell.exe (PS5.1) fallback
|
|
299
349
|
const shells = ["pwsh.exe", "powershell.exe"];
|
|
300
350
|
for (const shell of shells) {
|
|
301
351
|
try {
|
|
302
|
-
// start "" /b — 포커스를 현재 창에 유지 (사용자 타이핑 보호)
|
|
303
352
|
execSync(
|
|
304
|
-
`start "" /b wt.exe nt --title triflux -- ${shell} -
|
|
353
|
+
`start "" /b wt.exe nt --profile triflux --title triflux -- ${shell} -Command "psmux attach -t ${sessionName}"`,
|
|
305
354
|
{ stdio: "ignore", shell: true, timeout: 5000 },
|
|
306
355
|
);
|
|
307
356
|
return true;
|