episoda 0.2.30 → 0.2.31

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.
@@ -2696,7 +2696,7 @@ var require_package = __commonJS({
2696
2696
  "package.json"(exports2, module2) {
2697
2697
  module2.exports = {
2698
2698
  name: "episoda",
2699
- version: "0.2.29",
2699
+ version: "0.2.30",
2700
2700
  description: "CLI tool for Episoda local development workflow orchestration",
2701
2701
  main: "dist/index.js",
2702
2702
  types: "dist/index.d.ts",
@@ -5529,6 +5529,13 @@ var WorktreeManager = class _WorktreeManager {
5529
5529
  worktreeInfo: existing
5530
5530
  };
5531
5531
  }
5532
+ const fetchResult = await this.gitExecutor.execute({
5533
+ action: "fetch",
5534
+ remote: "origin"
5535
+ }, { cwd: this.bareRepoPath });
5536
+ if (!fetchResult.success) {
5537
+ console.warn("[worktree-manager] Failed to fetch from origin:", fetchResult.output);
5538
+ }
5532
5539
  const result = await this.gitExecutor.execute({
5533
5540
  action: "worktree_add",
5534
5541
  path: worktreePath,
@@ -7586,8 +7593,26 @@ var Daemon = class _Daemon {
7586
7593
  await stopDevServer(moduleUid);
7587
7594
  console.log(`[Daemon] EP956: Dev server stopped for ${moduleUid}`);
7588
7595
  const worktree = await getWorktreeInfoForModule(moduleUid);
7589
- if (worktree?.exists) {
7590
- console.log(`[Daemon] EP956: Worktree for ${moduleUid} at ${worktree.path} is ready for cleanup`);
7596
+ if (worktree?.exists && worktree.path) {
7597
+ console.log(`[Daemon] EP994: Removing worktree for ${moduleUid} at ${worktree.path}`);
7598
+ const projectRoot = await findProjectRoot(worktree.path);
7599
+ if (projectRoot) {
7600
+ const manager = new WorktreeManager(projectRoot);
7601
+ if (await manager.initialize()) {
7602
+ const result = await manager.removeWorktree(moduleUid, true);
7603
+ if (result.success) {
7604
+ console.log(`[Daemon] EP994: Successfully removed worktree for ${moduleUid}`);
7605
+ } else {
7606
+ console.warn(`[Daemon] EP994: Could not remove worktree for ${moduleUid}: ${result.error}`);
7607
+ }
7608
+ } else {
7609
+ console.warn(`[Daemon] EP994: Could not initialize WorktreeManager for ${moduleUid}`);
7610
+ }
7611
+ } else {
7612
+ console.warn(`[Daemon] EP994: Could not find project root for ${moduleUid} worktree`);
7613
+ }
7614
+ } else {
7615
+ console.log(`[Daemon] EP994: No worktree to remove for ${moduleUid}`);
7591
7616
  }
7592
7617
  console.log(`[Daemon] EP956: Async cleanup complete for ${moduleUid}`);
7593
7618
  } catch (error) {
@@ -7724,7 +7749,7 @@ var Daemon = class _Daemon {
7724
7749
  }
7725
7750
  const apiUrl = config.api_url || "https://episoda.dev";
7726
7751
  const response = await fetchWithAuth(
7727
- `${apiUrl}/api/modules?state=ready,doing,review&fields=id,uid,dev_mode,tunnel_url,checkout_machine_id`
7752
+ `${apiUrl}/api/modules?state=doing,review&fields=id,uid,dev_mode,tunnel_url,checkout_machine_id`
7728
7753
  );
7729
7754
  if (!response.ok) {
7730
7755
  console.warn(`[Daemon] EP819: Failed to fetch modules: ${response.status}`);