@akiojin/gwt 2.3.0 → 2.4.0

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 (52) hide show
  1. package/README.ja.md +5 -3
  2. package/README.md +5 -3
  3. package/dist/claude.d.ts +1 -0
  4. package/dist/claude.d.ts.map +1 -1
  5. package/dist/claude.js +6 -3
  6. package/dist/claude.js.map +1 -1
  7. package/dist/cli/ui/components/App.d.ts +3 -1
  8. package/dist/cli/ui/components/App.d.ts.map +1 -1
  9. package/dist/cli/ui/components/App.js +40 -2
  10. package/dist/cli/ui/components/App.js.map +1 -1
  11. package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts +1 -1
  12. package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts.map +1 -1
  13. package/dist/cli/ui/components/screens/AIToolSelectorScreen.js.map +1 -1
  14. package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts +18 -0
  15. package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts.map +1 -0
  16. package/dist/cli/ui/components/screens/ModelSelectorScreen.js +201 -0
  17. package/dist/cli/ui/components/screens/ModelSelectorScreen.js.map +1 -0
  18. package/dist/cli/ui/types.d.ts +11 -1
  19. package/dist/cli/ui/types.d.ts.map +1 -1
  20. package/dist/cli/ui/utils/modelOptions.d.ts +6 -0
  21. package/dist/cli/ui/utils/modelOptions.d.ts.map +1 -0
  22. package/dist/cli/ui/utils/modelOptions.js +111 -0
  23. package/dist/cli/ui/utils/modelOptions.js.map +1 -0
  24. package/dist/codex.d.ts +6 -0
  25. package/dist/codex.d.ts.map +1 -1
  26. package/dist/codex.js +11 -4
  27. package/dist/codex.js.map +1 -1
  28. package/dist/gemini.d.ts +1 -0
  29. package/dist/gemini.d.ts.map +1 -1
  30. package/dist/gemini.js +6 -3
  31. package/dist/gemini.js.map +1 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +33 -11
  34. package/dist/index.js.map +1 -1
  35. package/dist/qwen.d.ts +1 -0
  36. package/dist/qwen.d.ts.map +1 -1
  37. package/dist/qwen.js +6 -3
  38. package/dist/qwen.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/claude.ts +8 -3
  41. package/src/cli/ui/__tests__/components/ModelSelectorScreen.initial.test.tsx +81 -0
  42. package/src/cli/ui/__tests__/components/common/LoadingIndicator.test.tsx +28 -14
  43. package/src/cli/ui/components/App.tsx +74 -4
  44. package/src/cli/ui/components/screens/AIToolSelectorScreen.tsx +1 -2
  45. package/src/cli/ui/components/screens/ModelSelectorScreen.tsx +320 -0
  46. package/src/cli/ui/types.ts +13 -0
  47. package/src/cli/ui/utils/modelOptions.test.ts +36 -0
  48. package/src/cli/ui/utils/modelOptions.ts +122 -0
  49. package/src/codex.ts +23 -4
  50. package/src/gemini.ts +8 -3
  51. package/src/index.ts +60 -10
  52. package/src/qwen.ts +8 -3
package/src/index.ts CHANGED
@@ -10,7 +10,11 @@ import {
10
10
  GitError,
11
11
  } from "./git.js";
12
12
  import { launchClaudeCode } from "./claude.js";
13
- import { launchCodexCLI, CodexError } from "./codex.js";
13
+ import {
14
+ launchCodexCLI,
15
+ CodexError,
16
+ type CodexReasoningEffort,
17
+ } from "./codex.js";
14
18
  import { launchGeminiCLI, GeminiError } from "./gemini.js";
15
19
  import { launchQwenCLI, QwenError } from "./qwen.js";
16
20
  import {
@@ -292,11 +296,17 @@ export async function handleAIToolWorkflow(
292
296
  tool,
293
297
  mode,
294
298
  skipPermissions,
299
+ model,
300
+ inferenceLevel,
295
301
  } = selectionResult;
296
302
 
297
303
  const branchLabel = displayName ?? branch;
304
+ const modelInfo =
305
+ model || inferenceLevel
306
+ ? `, model=${model ?? "default"}${inferenceLevel ? `/${inferenceLevel}` : ""}`
307
+ : "";
298
308
  printInfo(
299
- `Selected: ${branchLabel} with ${tool} (${mode} mode, skipPermissions: ${skipPermissions})`,
309
+ `Selected: ${branchLabel} with ${tool} (${mode} mode${modelInfo}, skipPermissions: ${skipPermissions})`,
300
310
  );
301
311
 
302
312
  try {
@@ -528,7 +538,12 @@ export async function handleAIToolWorkflow(
528
538
  // Builtin tools use their dedicated launch functions
529
539
  // Custom tools use the generic launchCustomAITool function
530
540
  if (tool === "claude-code") {
531
- await launchClaudeCode(worktreePath, {
541
+ const launchOptions: {
542
+ mode?: "normal" | "continue" | "resume";
543
+ skipPermissions?: boolean;
544
+ envOverrides?: Record<string, string>;
545
+ model?: string;
546
+ } = {
532
547
  mode:
533
548
  mode === "resume"
534
549
  ? "resume"
@@ -537,9 +552,19 @@ export async function handleAIToolWorkflow(
537
552
  : "normal",
538
553
  skipPermissions,
539
554
  envOverrides: sharedEnv,
540
- });
555
+ };
556
+ if (model) {
557
+ launchOptions.model = model;
558
+ }
559
+ await launchClaudeCode(worktreePath, launchOptions);
541
560
  } else if (tool === "codex-cli") {
542
- await launchCodexCLI(worktreePath, {
561
+ const launchOptions: {
562
+ mode?: "normal" | "continue" | "resume";
563
+ bypassApprovals?: boolean;
564
+ envOverrides?: Record<string, string>;
565
+ model?: string;
566
+ reasoningEffort?: CodexReasoningEffort;
567
+ } = {
543
568
  mode:
544
569
  mode === "resume"
545
570
  ? "resume"
@@ -548,9 +573,21 @@ export async function handleAIToolWorkflow(
548
573
  : "normal",
549
574
  bypassApprovals: skipPermissions,
550
575
  envOverrides: sharedEnv,
551
- });
576
+ };
577
+ if (model) {
578
+ launchOptions.model = model;
579
+ }
580
+ if (inferenceLevel) {
581
+ launchOptions.reasoningEffort = inferenceLevel as CodexReasoningEffort;
582
+ }
583
+ await launchCodexCLI(worktreePath, launchOptions);
552
584
  } else if (tool === "gemini-cli") {
553
- await launchGeminiCLI(worktreePath, {
585
+ const launchOptions: {
586
+ mode?: "normal" | "continue" | "resume";
587
+ skipPermissions?: boolean;
588
+ envOverrides?: Record<string, string>;
589
+ model?: string;
590
+ } = {
554
591
  mode:
555
592
  mode === "resume"
556
593
  ? "resume"
@@ -559,9 +596,18 @@ export async function handleAIToolWorkflow(
559
596
  : "normal",
560
597
  skipPermissions,
561
598
  envOverrides: sharedEnv,
562
- });
599
+ };
600
+ if (model) {
601
+ launchOptions.model = model;
602
+ }
603
+ await launchGeminiCLI(worktreePath, launchOptions);
563
604
  } else if (tool === "qwen-cli") {
564
- await launchQwenCLI(worktreePath, {
605
+ const launchOptions: {
606
+ mode?: "normal" | "continue" | "resume";
607
+ skipPermissions?: boolean;
608
+ envOverrides?: Record<string, string>;
609
+ model?: string;
610
+ } = {
565
611
  mode:
566
612
  mode === "resume"
567
613
  ? "resume"
@@ -570,7 +616,11 @@ export async function handleAIToolWorkflow(
570
616
  : "normal",
571
617
  skipPermissions,
572
618
  envOverrides: sharedEnv,
573
- });
619
+ };
620
+ if (model) {
621
+ launchOptions.model = model;
622
+ }
623
+ await launchQwenCLI(worktreePath, launchOptions);
574
624
  } else {
575
625
  // Custom tool
576
626
  printInfo(`Launching custom tool: ${toolConfig.displayName}`);
package/src/qwen.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { execa } from "execa";
2
2
  import chalk from "chalk";
3
- import { platform } from "os";
4
3
  import { existsSync } from "fs";
5
4
  import { createChildStdio, getTerminalStreams } from "./utils/terminal.js";
6
5
 
@@ -23,6 +22,7 @@ export async function launchQwenCLI(
23
22
  mode?: "normal" | "continue" | "resume";
24
23
  extraArgs?: string[];
25
24
  envOverrides?: Record<string, string>;
25
+ model?: string;
26
26
  } = {},
27
27
  ): Promise<void> {
28
28
  const terminal = getTerminalStreams();
@@ -38,6 +38,11 @@ export async function launchQwenCLI(
38
38
 
39
39
  const args: string[] = ["--checkpointing"];
40
40
 
41
+ if (options.model) {
42
+ args.push("--model", options.model);
43
+ console.log(chalk.green(` šŸŽÆ Model: ${options.model}`));
44
+ }
45
+
41
46
  // Handle execution mode
42
47
  // Note: Qwen CLI doesn't have explicit continue/resume CLI options at startup.
43
48
  // Session management is done via /chat commands during interactive sessions.
@@ -141,7 +146,7 @@ export async function launchQwenCLI(
141
146
  errorMessage = `Failed to launch Qwen CLI: ${error.message || "Unknown error"}`;
142
147
  }
143
148
 
144
- if (platform() === "win32") {
149
+ if (process.platform === "win32") {
145
150
  console.error(chalk.red("\nšŸ’” Windows troubleshooting tips:"));
146
151
  if (hasLocalQwen) {
147
152
  console.error(
@@ -181,7 +186,7 @@ export async function launchQwenCLI(
181
186
  */
182
187
  async function isQwenCommandAvailable(): Promise<boolean> {
183
188
  try {
184
- const command = platform() === "win32" ? "where" : "which";
189
+ const command = process.platform === "win32" ? "where" : "which";
185
190
  await execa(command, ["qwen"], { shell: true });
186
191
  return true;
187
192
  } catch {