clawt 2.3.6 → 2.3.8

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/dist/index.js CHANGED
@@ -959,8 +959,8 @@ async function handleRun(options) {
959
959
 
960
960
  // src/commands/resume.ts
961
961
  function registerResumeCommand(program2) {
962
- program2.command("resume").description("\u5728\u5DF2\u6709 worktree \u4E2D\u6062\u590D Claude Code \u4EA4\u4E92\u5F0F\u4F1A\u8BDD").requiredOption("-b, --branch <branchName>", "\u8981\u6062\u590D\u7684\u5206\u652F\u540D").action(async (options) => {
963
- await handleResume(options);
962
+ program2.command("resume").description("\u5728\u5DF2\u6709 worktree \u4E2D\u6062\u590D Claude Code \u4EA4\u4E92\u5F0F\u4F1A\u8BDD").requiredOption("-b, --branch <branchName>", "\u8981\u6062\u590D\u7684\u5206\u652F\u540D").action((options) => {
963
+ handleResume(options);
964
964
  });
965
965
  }
966
966
  function findWorktreeByBranch(branchName) {
@@ -971,7 +971,7 @@ function findWorktreeByBranch(branchName) {
971
971
  }
972
972
  return matched;
973
973
  }
974
- async function handleResume(options) {
974
+ function handleResume(options) {
975
975
  validateMainWorktree();
976
976
  validateClaudeCodeInstalled();
977
977
  logger.info(`resume \u547D\u4EE4\u6267\u884C\uFF0C\u5206\u652F: ${options.branch}`);
@@ -1,7 +1,5 @@
1
1
  // scripts/postinstall.ts
2
2
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
3
- import { join as join2 } from "path";
4
- import { homedir as homedir2 } from "os";
5
3
 
6
4
  // src/constants/paths.ts
7
5
  import { homedir } from "os";
@@ -43,10 +41,6 @@ var DEFAULT_CONFIG = deriveDefaultConfig(CONFIG_DEFINITIONS);
43
41
  var CONFIG_DESCRIPTIONS = deriveConfigDescriptions(CONFIG_DEFINITIONS);
44
42
 
45
43
  // scripts/postinstall.ts
46
- var CLAWT_HOME2 = join2(homedir2(), ".clawt");
47
- var CONFIG_PATH2 = join2(CLAWT_HOME2, "config.json");
48
- var LOGS_DIR2 = join2(CLAWT_HOME2, "logs");
49
- var WORKTREES_DIR2 = join2(CLAWT_HOME2, "worktrees");
50
44
  function ensureDirectory(dirPath) {
51
45
  if (!existsSync(dirPath)) {
52
46
  mkdirSync(dirPath, { recursive: true });
@@ -86,10 +80,10 @@ function syncConfig(configPath, defaultConfig) {
86
80
  }
87
81
  }
88
82
  function init() {
89
- ensureDirectory(CLAWT_HOME2);
90
- ensureDirectory(LOGS_DIR2);
91
- ensureDirectory(WORKTREES_DIR2);
92
- syncConfig(CONFIG_PATH2, DEFAULT_CONFIG);
83
+ ensureDirectory(CLAWT_HOME);
84
+ ensureDirectory(LOGS_DIR);
85
+ ensureDirectory(WORKTREES_DIR);
86
+ syncConfig(CONFIG_PATH, DEFAULT_CONFIG);
93
87
  console.log("\u2713 clawt \u521D\u59CB\u5316\u5B8C\u6210");
94
88
  }
95
89
  init();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawt",
3
- "version": "2.3.6",
3
+ "version": "2.3.8",
4
4
  "description": "本地并行执行多个Claude Code Agent任务,融合 Git Worktree 与 Claude Code CLI 的命令行工具",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -3,18 +3,7 @@
3
3
  */
4
4
 
5
5
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
6
- import { join } from 'node:path';
7
- import { homedir } from 'node:os';
8
- import { DEFAULT_CONFIG } from '../src/constants/index.js';
9
-
10
- /** clawt 主目录 */
11
- const CLAWT_HOME = join(homedir(), '.clawt');
12
- /** 配置文件路径 */
13
- const CONFIG_PATH = join(CLAWT_HOME, 'config.json');
14
- /** 日志目录 */
15
- const LOGS_DIR = join(CLAWT_HOME, 'logs');
16
- /** worktree 目录 */
17
- const WORKTREES_DIR = join(CLAWT_HOME, 'worktrees');
6
+ import { DEFAULT_CONFIG, CLAWT_HOME, CONFIG_PATH, LOGS_DIR, WORKTREES_DIR } from '../src/constants/index.js';
18
7
 
19
8
  /**
20
9
  * 确保目录存在,不存在则递归创建
@@ -19,8 +19,8 @@ export function registerResumeCommand(program: Command): void {
19
19
  .command('resume')
20
20
  .description('在已有 worktree 中恢复 Claude Code 交互式会话')
21
21
  .requiredOption('-b, --branch <branchName>', '要恢复的分支名')
22
- .action(async (options: ResumeOptions) => {
23
- await handleResume(options);
22
+ .action((options: ResumeOptions) => {
23
+ handleResume(options);
24
24
  });
25
25
  }
26
26
 
@@ -46,7 +46,7 @@ function findWorktreeByBranch(branchName: string): WorktreeInfo {
46
46
  * 查找已有 worktree 并恢复 Claude Code 会话
47
47
  * @param {ResumeOptions} options - 命令选项
48
48
  */
49
- async function handleResume(options: ResumeOptions): Promise<void> {
49
+ function handleResume(options: ResumeOptions): void {
50
50
  validateMainWorktree();
51
51
  validateClaudeCodeInstalled();
52
52