@yu_robotics/remote-cli 1.0.2 → 1.0.3

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.
@@ -0,0 +1,451 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.WorktreeManager = void 0;
37
+ const child_process_1 = require("child_process");
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ /**
41
+ * Git Worktree Manager
42
+ * Manages git worktrees for isolating Claude Code sessions
43
+ */
44
+ class WorktreeManager {
45
+ constructor() {
46
+ // No parameters needed - will use current branch dynamically
47
+ }
48
+ /**
49
+ * Create a new worktree for a session
50
+ * @param mainRepoPath Path to the main repository
51
+ * @param sessionId Session UUID
52
+ * @returns Path to the created worktree
53
+ */
54
+ async createWorktree(mainRepoPath, sessionId) {
55
+ // Generate session abbreviation (last 8 chars)
56
+ const sessionAbbr = sessionId.slice(-8);
57
+ const branchName = `remote-cli/session-${sessionAbbr}`;
58
+ const worktreesDir = `${mainRepoPath}.worktrees`;
59
+ const worktreePath = path.join(worktreesDir, `session-${sessionAbbr}`);
60
+ // Ensure worktrees directory exists
61
+ if (!fs.existsSync(worktreesDir)) {
62
+ fs.mkdirSync(worktreesDir, { recursive: true });
63
+ }
64
+ // Check if worktree already exists
65
+ if (fs.existsSync(worktreePath)) {
66
+ // Verify it's actually a worktree
67
+ if (this.isWorktree(worktreePath)) {
68
+ return worktreePath;
69
+ }
70
+ // If it's a regular directory, remove it
71
+ fs.rmSync(worktreePath, { recursive: true, force: true });
72
+ }
73
+ // Prune stale worktree references before creating new one
74
+ await this.pruneWorktreeReferences(mainRepoPath);
75
+ // Get current branch to use as base
76
+ const currentBranch = await this.getCurrentBranch(mainRepoPath);
77
+ const baseBranch = currentBranch || 'HEAD';
78
+ try {
79
+ // Create worktree from current branch
80
+ await this.execGit(['worktree', 'add', '-b', branchName, worktreePath, baseBranch], { cwd: mainRepoPath });
81
+ }
82
+ catch (error) {
83
+ // If branch already exists, try without -b flag
84
+ if (error instanceof Error && error.message.includes('already exists')) {
85
+ await this.execGit(['worktree', 'add', worktreePath, branchName], { cwd: mainRepoPath });
86
+ }
87
+ else {
88
+ throw error;
89
+ }
90
+ }
91
+ // Save session file in worktree
92
+ const sessionFile = path.join(worktreePath, '.claude-session');
93
+ const sessionData = {
94
+ id: sessionId,
95
+ savedAt: new Date().toISOString(),
96
+ };
97
+ fs.writeFileSync(sessionFile, JSON.stringify(sessionData, null, 2));
98
+ return worktreePath;
99
+ }
100
+ /**
101
+ * Create a new worktree with timestamp-based naming
102
+ * @param mainRepoPath Path to the main repository
103
+ * @param timestamp Timestamp string (e.g., "2026-02-17T14-30-00")
104
+ * @returns Path to the created worktree
105
+ */
106
+ async createWorktreeWithTimestamp(mainRepoPath, timestamp) {
107
+ const branchName = `remote-cli/${timestamp}`;
108
+ const worktreesDir = `${mainRepoPath}.worktrees`;
109
+ const worktreePath = path.join(worktreesDir, timestamp);
110
+ // Ensure worktrees directory exists
111
+ if (!fs.existsSync(worktreesDir)) {
112
+ fs.mkdirSync(worktreesDir, { recursive: true });
113
+ }
114
+ // Check if worktree already exists
115
+ if (fs.existsSync(worktreePath)) {
116
+ // Verify it's actually a worktree
117
+ if (this.isWorktree(worktreePath)) {
118
+ return worktreePath;
119
+ }
120
+ // If it's a regular directory, remove it
121
+ fs.rmSync(worktreePath, { recursive: true, force: true });
122
+ }
123
+ // Prune stale worktree references before creating new one
124
+ await this.pruneWorktreeReferences(mainRepoPath);
125
+ // Get current branch to use as base
126
+ const currentBranch = await this.getCurrentBranch(mainRepoPath);
127
+ const baseBranch = currentBranch || 'HEAD';
128
+ try {
129
+ // Create worktree from current branch
130
+ await this.execGit(['worktree', 'add', '-b', branchName, worktreePath, baseBranch], { cwd: mainRepoPath });
131
+ }
132
+ catch (error) {
133
+ // If branch already exists, try without -b flag
134
+ if (error instanceof Error && error.message.includes('already exists')) {
135
+ await this.execGit(['worktree', 'add', worktreePath, branchName], { cwd: mainRepoPath });
136
+ }
137
+ else {
138
+ throw error;
139
+ }
140
+ }
141
+ return worktreePath;
142
+ }
143
+ /**
144
+ * Get worktree path for a session
145
+ * @param mainRepoPath Path to the main repository
146
+ * @param sessionId Session UUID
147
+ * @returns Worktree path if exists, null otherwise
148
+ */
149
+ getWorktreePath(mainRepoPath, sessionId) {
150
+ const sessionAbbr = sessionId.slice(-8);
151
+ const worktreesDir = `${mainRepoPath}.worktrees`;
152
+ const worktreePath = path.join(worktreesDir, `session-${sessionAbbr}`);
153
+ if (fs.existsSync(worktreePath) && this.isWorktree(worktreePath)) {
154
+ return worktreePath;
155
+ }
156
+ return null;
157
+ }
158
+ /**
159
+ * Get existing worktree for session or create new one
160
+ * @param mainRepoPath Path to the main repository
161
+ * @param sessionId Session UUID
162
+ * @returns Path to the worktree
163
+ */
164
+ async getOrCreateWorktree(mainRepoPath, sessionId) {
165
+ const existingPath = this.getWorktreePath(mainRepoPath, sessionId);
166
+ if (existingPath) {
167
+ return existingPath;
168
+ }
169
+ return await this.createWorktree(mainRepoPath, sessionId);
170
+ }
171
+ /**
172
+ * List all worktrees for a repository
173
+ * @param mainRepoPath Path to the main repository
174
+ * @returns Array of worktree information
175
+ */
176
+ async listWorktrees(mainRepoPath) {
177
+ try {
178
+ const output = await this.execGit(['worktree', 'list', '--porcelain'], { cwd: mainRepoPath });
179
+ return this.parseWorktreeList(output);
180
+ }
181
+ catch (error) {
182
+ // If git worktree list fails, return empty array
183
+ return [];
184
+ }
185
+ }
186
+ /**
187
+ * Remove a worktree
188
+ * @param worktreePath Path to the worktree to remove
189
+ * @param mainRepoPath Path to the main repository (for branch deletion)
190
+ */
191
+ async removeWorktree(worktreePath, mainRepoPath) {
192
+ if (!this.isWorktree(worktreePath)) {
193
+ throw new Error(`Not a worktree: ${worktreePath}`);
194
+ }
195
+ // Get branch name before removing worktree
196
+ const branchName = await this.getWorktreeBranch(worktreePath);
197
+ // Remove worktree
198
+ try {
199
+ // Find main repo path if not provided
200
+ if (!mainRepoPath) {
201
+ mainRepoPath = await this.getMainRepoPath(worktreePath);
202
+ }
203
+ await this.execGit(['worktree', 'remove', '--force', worktreePath], { cwd: mainRepoPath });
204
+ }
205
+ catch (error) {
206
+ // If git worktree remove fails, manually delete directory
207
+ if (fs.existsSync(worktreePath)) {
208
+ fs.rmSync(worktreePath, { recursive: true, force: true });
209
+ }
210
+ }
211
+ // Delete branch if it's a remote-cli session branch
212
+ if (branchName && branchName.startsWith('remote-cli/session-') && mainRepoPath) {
213
+ try {
214
+ await this.execGit(['branch', '-D', branchName], { cwd: mainRepoPath });
215
+ }
216
+ catch {
217
+ // Ignore errors if branch doesn't exist or can't be deleted
218
+ }
219
+ }
220
+ // Prune stale references
221
+ if (mainRepoPath) {
222
+ await this.pruneWorktreeReferences(mainRepoPath);
223
+ }
224
+ }
225
+ /**
226
+ * Check if a directory is a git worktree
227
+ * @param dirPath Directory path to check
228
+ * @returns true if directory is a worktree
229
+ */
230
+ isWorktree(dirPath) {
231
+ const gitFile = path.join(dirPath, '.git');
232
+ if (!fs.existsSync(gitFile)) {
233
+ return false;
234
+ }
235
+ const stats = fs.statSync(gitFile);
236
+ if (stats.isFile()) {
237
+ // Worktrees have .git as a file containing "gitdir: ..."
238
+ const content = fs.readFileSync(gitFile, 'utf-8');
239
+ return content.trim().startsWith('gitdir:');
240
+ }
241
+ return false;
242
+ }
243
+ /**
244
+ * Check if a directory is a git repository
245
+ * @param dirPath Directory path to check
246
+ * @returns true if directory contains .git
247
+ */
248
+ isGitRepository(dirPath) {
249
+ const gitPath = path.join(dirPath, '.git');
250
+ return fs.existsSync(gitPath);
251
+ }
252
+ /**
253
+ * Prune stale worktrees older than specified age
254
+ * @param mainRepoPath Path to the main repository
255
+ * @param maxAgeDays Maximum age in days (default: 7)
256
+ * @returns Number of worktrees removed
257
+ */
258
+ async pruneStaleWorktrees(mainRepoPath, maxAgeDays = 7) {
259
+ const worktrees = await this.listWorktrees(mainRepoPath);
260
+ const now = Date.now();
261
+ const maxAgeMs = maxAgeDays * 24 * 60 * 60 * 1000;
262
+ let removedCount = 0;
263
+ for (const worktree of worktrees) {
264
+ // Skip main worktree
265
+ if (worktree.isMain) {
266
+ continue;
267
+ }
268
+ // Check if session file exists and its modification time
269
+ const sessionFile = path.join(worktree.path, '.claude-session');
270
+ if (fs.existsSync(sessionFile)) {
271
+ const stats = fs.statSync(sessionFile);
272
+ const age = now - stats.mtime.getTime();
273
+ if (age > maxAgeMs) {
274
+ try {
275
+ await this.removeWorktree(worktree.path, mainRepoPath);
276
+ removedCount++;
277
+ }
278
+ catch (error) {
279
+ console.error(`Failed to remove stale worktree ${worktree.path}:`, error);
280
+ }
281
+ }
282
+ }
283
+ }
284
+ return removedCount;
285
+ }
286
+ /**
287
+ * Get main repository path from a worktree path
288
+ * @param worktreePath Path to the worktree
289
+ * @returns Main repository path
290
+ */
291
+ async getMainRepoPath(worktreePath) {
292
+ // Parse .git file to find main repo
293
+ const gitFile = path.join(worktreePath, '.git');
294
+ if (!fs.existsSync(gitFile)) {
295
+ throw new Error(`Not a git worktree: ${worktreePath}`);
296
+ }
297
+ const content = fs.readFileSync(gitFile, 'utf-8');
298
+ const match = content.match(/gitdir:\s*(.+)/);
299
+ if (!match) {
300
+ throw new Error(`Invalid .git file format: ${worktreePath}`);
301
+ }
302
+ // The gitdir points to .git/worktrees/<name>
303
+ // We need to get the parent .git directory
304
+ const gitdir = match[1].trim();
305
+ const absoluteGitdir = path.isAbsolute(gitdir) ? gitdir : path.resolve(worktreePath, gitdir);
306
+ // Remove /worktrees/<name> to get main .git path
307
+ const mainGitPath = absoluteGitdir.replace(/\/worktrees\/[^/]+$/, '');
308
+ // Main repo is the parent of .git
309
+ return path.dirname(mainGitPath);
310
+ }
311
+ /**
312
+ * Get current branch name of a repository
313
+ * @param repoPath Path to the repository
314
+ * @returns Branch name or null if detached HEAD
315
+ */
316
+ async getCurrentBranch(repoPath) {
317
+ try {
318
+ const result = await this.execGit(['branch', '--show-current'], { cwd: repoPath });
319
+ const branch = result.trim();
320
+ return branch || null;
321
+ }
322
+ catch {
323
+ return null;
324
+ }
325
+ }
326
+ /**
327
+ * Prune stale worktree references
328
+ * @param mainRepoPath Path to the main repository
329
+ */
330
+ async pruneWorktreeReferences(mainRepoPath) {
331
+ try {
332
+ await this.execGit(['worktree', 'prune'], { cwd: mainRepoPath });
333
+ }
334
+ catch {
335
+ // Ignore errors
336
+ }
337
+ }
338
+ /**
339
+ * Get branch name of a worktree
340
+ * @param worktreePath Path to the worktree
341
+ * @returns Branch name or null if not found
342
+ */
343
+ async getWorktreeBranch(worktreePath) {
344
+ try {
345
+ const output = await this.execGit(['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: worktreePath });
346
+ return output.trim();
347
+ }
348
+ catch {
349
+ return null;
350
+ }
351
+ }
352
+ /**
353
+ * Parse git worktree list --porcelain output
354
+ * @param output Output from git worktree list --porcelain
355
+ * @returns Array of worktree information
356
+ */
357
+ parseWorktreeList(output) {
358
+ const worktrees = [];
359
+ const lines = output.trim().split('\n');
360
+ let current = {};
361
+ for (const line of lines) {
362
+ if (line.startsWith('worktree ')) {
363
+ // Save previous worktree if exists
364
+ if (current.path) {
365
+ worktrees.push(this.finalizeWorktreeInfo(current));
366
+ }
367
+ current = { path: line.substring(9), isMain: false };
368
+ }
369
+ else if (line.startsWith('HEAD ')) {
370
+ current.commit = line.substring(5);
371
+ }
372
+ else if (line.startsWith('branch ')) {
373
+ current.branch = line.substring(7).replace('refs/heads/', '');
374
+ }
375
+ else if (line === 'bare') {
376
+ // Bare repository (not a working tree)
377
+ current.isMain = true;
378
+ }
379
+ else if (line === '') {
380
+ // Empty line separates worktrees
381
+ if (current.path) {
382
+ worktrees.push(this.finalizeWorktreeInfo(current));
383
+ }
384
+ current = {};
385
+ }
386
+ }
387
+ // Add last worktree if exists
388
+ if (current.path) {
389
+ worktrees.push(this.finalizeWorktreeInfo(current));
390
+ }
391
+ return worktrees;
392
+ }
393
+ /**
394
+ * Finalize worktree info by extracting session ID
395
+ * @param info Partial worktree info
396
+ * @returns Complete worktree info
397
+ */
398
+ finalizeWorktreeInfo(info) {
399
+ // Extract session ID from path
400
+ const match = info.path.match(/session-([a-f0-9]{8})$/);
401
+ const sessionId = match ? match[1] : null;
402
+ // Detect main worktree (first in list, no session ID in path)
403
+ const isMain = info.isMain || !sessionId;
404
+ return {
405
+ path: info.path,
406
+ branch: info.branch || 'unknown',
407
+ commit: info.commit || 'unknown',
408
+ sessionId,
409
+ isMain,
410
+ };
411
+ }
412
+ /**
413
+ * Execute git command
414
+ * @param args Git command arguments
415
+ * @param options Spawn options
416
+ * @returns Command stdout
417
+ */
418
+ async execGit(args, options) {
419
+ return new Promise((resolve, reject) => {
420
+ const child = (0, child_process_1.spawn)('git', args, {
421
+ ...options,
422
+ stdio: ['ignore', 'pipe', 'pipe'],
423
+ });
424
+ let stdout = '';
425
+ let stderr = '';
426
+ if (child.stdout) {
427
+ child.stdout.on('data', (data) => {
428
+ stdout += data.toString();
429
+ });
430
+ }
431
+ if (child.stderr) {
432
+ child.stderr.on('data', (data) => {
433
+ stderr += data.toString();
434
+ });
435
+ }
436
+ child.on('exit', (code) => {
437
+ if (code === 0) {
438
+ resolve(stdout);
439
+ }
440
+ else {
441
+ reject(new Error(`Git command failed (exit ${code}): ${stderr}`));
442
+ }
443
+ });
444
+ child.on('error', (error) => {
445
+ reject(error);
446
+ });
447
+ });
448
+ }
449
+ }
450
+ exports.WorktreeManager = WorktreeManager;
451
+ //# sourceMappingURL=WorktreeManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorktreeManager.js","sourceRoot":"","sources":["../../src/worktree/WorktreeManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAsC;AACtC,uCAAyB;AACzB,2CAA6B;AAa7B;;;GAGG;AACH,MAAa,eAAe;IAC1B;QACE,6DAA6D;IAC/D,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAAC,YAAoB,EAAE,SAAiB;QAC1D,+CAA+C;QAC/C,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,UAAU,GAAG,sBAAsB,WAAW,EAAE,CAAC;QACvD,MAAM,YAAY,GAAG,GAAG,YAAY,YAAY,CAAC;QACjD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,WAAW,EAAE,CAAC,CAAC;QAEvE,oCAAoC;QACpC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,EAAE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BACpE,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC1B,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAndD,0CAmdC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yu_robotics/remote-cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Remote control Claude Code CLI via mobile",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",