episoda 0.2.22 → 0.2.23

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.
@@ -537,6 +537,24 @@ var require_git_executor = __commonJS({
537
537
  * Execute status command
538
538
  */
539
539
  async executeStatus(cwd, options) {
540
+ try {
541
+ const isBareResult = await execAsync2("git rev-parse --is-bare-repository", { cwd, timeout: 5e3 });
542
+ if (isBareResult.stdout.trim() === "true") {
543
+ const headResult = await execAsync2("git symbolic-ref --short HEAD", { cwd, timeout: 5e3 });
544
+ const branchName = headResult.stdout.trim();
545
+ return {
546
+ success: true,
547
+ output: `## ${branchName}`,
548
+ details: {
549
+ uncommittedFiles: [],
550
+ // No working tree in bare repo
551
+ branchName,
552
+ currentBranch: branchName
553
+ }
554
+ };
555
+ }
556
+ } catch {
557
+ }
540
558
  const result = await this.runGitCommand(["status", "--porcelain", "-b"], cwd, options);
541
559
  if (result.success && result.output) {
542
560
  const statusInfo = (0, git_parser_1.parseGitStatus)(result.output);
@@ -1868,7 +1886,6 @@ var require_git_executor = __commonJS({
1868
1886
  const fs14 = await Promise.resolve().then(() => __importStar(require("fs"))).then((m) => m.promises);
1869
1887
  const path15 = await Promise.resolve().then(() => __importStar(require("path")));
1870
1888
  let currentPath = cwd;
1871
- let worktreeMode = false;
1872
1889
  let projectPath = cwd;
1873
1890
  let bareRepoPath;
1874
1891
  for (let i = 0; i < 10; i++) {
@@ -1877,7 +1894,6 @@ var require_git_executor = __commonJS({
1877
1894
  try {
1878
1895
  await fs14.access(bareDir);
1879
1896
  await fs14.access(episodaDir);
1880
- worktreeMode = true;
1881
1897
  projectPath = currentPath;
1882
1898
  bareRepoPath = bareDir;
1883
1899
  break;
@@ -1891,9 +1907,8 @@ var require_git_executor = __commonJS({
1891
1907
  }
1892
1908
  return {
1893
1909
  success: true,
1894
- output: worktreeMode ? "Worktree mode project" : "Standard git project",
1910
+ output: bareRepoPath ? "Episoda project" : "Git repository",
1895
1911
  details: {
1896
- worktreeMode,
1897
1912
  projectPath,
1898
1913
  bareRepoPath
1899
1914
  }
@@ -2681,7 +2696,7 @@ var require_package = __commonJS({
2681
2696
  "package.json"(exports2, module2) {
2682
2697
  module2.exports = {
2683
2698
  name: "episoda",
2684
- version: "0.2.21",
2699
+ version: "0.2.22",
2685
2700
  description: "CLI tool for Episoda local development workflow orchestration",
2686
2701
  main: "dist/index.js",
2687
2702
  types: "dist/index.d.ts",
@@ -2883,9 +2898,6 @@ function addProject(projectId, projectPath, options) {
2883
2898
  if (existingByPath) {
2884
2899
  existingByPath.id = projectId;
2885
2900
  existingByPath.last_active = now;
2886
- if (options?.worktreeMode !== void 0) {
2887
- existingByPath.worktreeMode = options.worktreeMode;
2888
- }
2889
2901
  if (options?.bareRepoPath) {
2890
2902
  existingByPath.bareRepoPath = options.bareRepoPath;
2891
2903
  }
@@ -2905,8 +2917,7 @@ function addProject(projectId, projectPath, options) {
2905
2917
  name: projectName,
2906
2918
  added_at: now,
2907
2919
  last_active: now,
2908
- // EP944: Worktree mode fields
2909
- worktreeMode: options?.worktreeMode,
2920
+ // EP971: Bare repo path for worktree architecture
2910
2921
  bareRepoPath: options?.bareRepoPath
2911
2922
  };
2912
2923
  data.projects.push(newProject);
@@ -5447,7 +5458,8 @@ var WorktreeManager = class _WorktreeManager {
5447
5458
  }
5448
5459
  /**
5449
5460
  * Initialize worktree manager from existing project root
5450
- * @returns true if valid worktree project, false otherwise
5461
+ * EP971: All projects use worktree architecture
5462
+ * @returns true if valid project, false otherwise
5451
5463
  */
5452
5464
  async initialize() {
5453
5465
  if (!fs11.existsSync(this.bareRepoPath)) {
@@ -5458,7 +5470,7 @@ var WorktreeManager = class _WorktreeManager {
5458
5470
  }
5459
5471
  try {
5460
5472
  const config = this.readConfig();
5461
- return config?.worktreeMode === true;
5473
+ return config !== null;
5462
5474
  } catch {
5463
5475
  return false;
5464
5476
  }
@@ -5483,7 +5495,6 @@ var WorktreeManager = class _WorktreeManager {
5483
5495
  workspaceSlug,
5484
5496
  projectSlug,
5485
5497
  bareRepoPath: manager.bareRepoPath,
5486
- worktreeMode: true,
5487
5498
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5488
5499
  worktrees: []
5489
5500
  };
@@ -6569,9 +6580,12 @@ var Daemon = class _Daemon {
6569
6580
  client.updateActivity();
6570
6581
  try {
6571
6582
  const gitCmd = message.command;
6572
- const cwd = gitCmd.worktreePath || projectPath;
6583
+ const bareRepoPath = path14.join(projectPath, ".bare");
6584
+ const cwd = gitCmd.worktreePath || bareRepoPath;
6573
6585
  if (gitCmd.worktreePath) {
6574
- console.log(`[Daemon] EP944: Routing command to worktree: ${gitCmd.worktreePath}`);
6586
+ console.log(`[Daemon] Routing command to worktree: ${gitCmd.worktreePath}`);
6587
+ } else {
6588
+ console.log(`[Daemon] Running git command in bare repo: ${bareRepoPath}`);
6575
6589
  }
6576
6590
  const result = await gitExecutor.execute(gitCmd, {
6577
6591
  cwd