From 27d960b1ec82cfa4a524dea5f5e65ee6807e6a18 Mon Sep 17 00:00:00 2001 From: sorlros Date: Fri, 22 May 2026 13:47:20 +0900 Subject: [PATCH 1/2] feat: default real tui to embedded cli pane --- src/cli/commands/repl.ts | 18 +++++++++++++++++- src/cli/parse.ts | 3 ++- tests/ts/unit/cli/repl-tui-startup.test.ts | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/repl.ts b/src/cli/commands/repl.ts index 76c2529..b194732 100644 --- a/src/cli/commands/repl.ts +++ b/src/cli/commands/repl.ts @@ -440,6 +440,21 @@ const resolveReplMode = (args: CliArgs): ReplModeResolution => { return { useTui: false, reason: "non-TTY/CI 환경" }; }; +const resolvePresentationMode = ( + args: CliArgs, + replMode: ReplModeResolution, +): CliArgs["presentationMode"] => { + if (args.presentationMode) { + return args.presentationMode; + } + + if (replMode.useTui && args.executionMode === "real") { + return "embedded-pane"; + } + + return undefined; +}; + export const runReplCommand = async (baseArgs: CliArgs): Promise => { const executionCwd = baseArgs.cwd ?? process.cwd(); @@ -448,6 +463,7 @@ export const runReplCommand = async (baseArgs: CliArgs): Promise => { // TUI 모드 판정 const replMode = resolveReplMode(baseArgs); + const presentationMode = resolvePresentationMode(baseArgs, replMode); // TUI 모드인 경우: TUI REPL 실행 if (replMode.useTui) { @@ -468,7 +484,7 @@ export const runReplCommand = async (baseArgs: CliArgs): Promise => { cwd: executionCwd, ...(baseArgs.sessionId ? { sessionId: baseArgs.sessionId } : {}), translationModel: getTranslationModel(), - ...(baseArgs.presentationMode ? { presentationMode: baseArgs.presentationMode } : {}), + ...(presentationMode ? { presentationMode } : {}), }; if (currentModel) { diff --git a/src/cli/parse.ts b/src/cli/parse.ts index e40d8e4..ce52e8d 100644 --- a/src/cli/parse.ts +++ b/src/cli/parse.ts @@ -256,8 +256,9 @@ const CLI_USAGE_REPL = [ " - 각 프롬프트는 별도의 작업 단위로 실행됩니다", " - execution-mode는 프롬프트를 모의 실행으로 할지 실제 실행으로 할지 결정합니다", " - interactive TTY에서는 기본적으로 TUI를 사용합니다. --no-tui로 legacy text REPL로 전환할 수 있습니다", + " - real-mode TUI에서는 기본적으로 detoks TUI 안의 embedded CLI pane에 원본 CLI 출력을 표시합니다", " - --passthrough-ui를 사용하면 원본 CLI UI를 먼저 보여주고 종료 후 detoks 요약을 표시합니다", - " - --embedded-cli-ui를 사용하면 detoks TUI 안의 전용 패널에 원본 CLI 출력을 표시합니다", + " - --embedded-cli-ui는 기본 embedded 동작을 명시적으로 고정합니다", "", "옵션:", ` --adapter ${ADAPTER_HELP} 대상 어댑터(기본값: codex)`, diff --git a/tests/ts/unit/cli/repl-tui-startup.test.ts b/tests/ts/unit/cli/repl-tui-startup.test.ts index 7e7edf4..41dc3da 100644 --- a/tests/ts/unit/cli/repl-tui-startup.test.ts +++ b/tests/ts/unit/cli/repl-tui-startup.test.ts @@ -83,6 +83,24 @@ describe("runReplCommand TUI startup flow", () => { ); }); + it("defaults real-mode TUI startup to embedded native presentation", async () => { + await runReplCommand({ + mode: "repl", + adapter: "codex", + executionMode: "real", + verbose: false, + trace: false, + tui: "force", + showHelp: false, + }); + + expect(mocks.runTuiRepl).toHaveBeenCalledWith( + expect.objectContaining({ + presentationMode: "embedded-pane", + }), + ); + }); + it("passes embedded presentation mode into the TUI startup flow", async () => { await runReplCommand({ mode: "repl", From cdb3d20b555203cbff88db4216e7872ec31357d6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 May 2026 05:05:17 +0000 Subject: [PATCH 2/2] chore: release v0.2.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e67806..7aabc2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sorlros/detoks", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@sorlros/detoks", - "version": "0.2.0", + "version": "0.2.1", "hasInstallScript": true, "dependencies": { "better-sqlite3": "^12.10.0", diff --git a/package.json b/package.json index 6cc2a5e..62deaba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sorlros/detoks", - "version": "0.2.0", + "version": "0.2.1", "private": false, "type": "module", "bin": {