episoda 0.2.109 → 0.2.111
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/daemon/daemon-process.js +29 -57
- package/dist/daemon/daemon-process.js.map +1 -1
- package/dist/index.js +4 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2815,7 +2815,7 @@ var require_package = __commonJS({
|
|
|
2815
2815
|
"package.json"(exports2, module2) {
|
|
2816
2816
|
module2.exports = {
|
|
2817
2817
|
name: "episoda",
|
|
2818
|
-
version: "0.2.
|
|
2818
|
+
version: "0.2.110",
|
|
2819
2819
|
description: "CLI tool for Episoda local development workflow orchestration",
|
|
2820
2820
|
main: "dist/index.js",
|
|
2821
2821
|
types: "dist/index.d.ts",
|
|
@@ -4202,7 +4202,7 @@ var WorktreeManager = class _WorktreeManager {
|
|
|
4202
4202
|
* Create a worktree for a module
|
|
4203
4203
|
* The entire operation is locked to prevent race conditions
|
|
4204
4204
|
*/
|
|
4205
|
-
async createWorktree(moduleUid, branchName, createBranch = false
|
|
4205
|
+
async createWorktree(moduleUid, branchName, createBranch = false) {
|
|
4206
4206
|
if (!validateModuleUid(moduleUid)) {
|
|
4207
4207
|
return {
|
|
4208
4208
|
success: false,
|
|
@@ -4241,13 +4241,9 @@ var WorktreeManager = class _WorktreeManager {
|
|
|
4241
4241
|
const result = await this.gitExecutor.execute({
|
|
4242
4242
|
action: "worktree_add",
|
|
4243
4243
|
path: worktreePath,
|
|
4244
|
-
branch:
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
// Don't create branch for detached
|
|
4248
|
-
detach: detachedHead,
|
|
4249
|
-
// EP1223: Detach flag
|
|
4250
|
-
startPoint: detachedHead ? "origin/main" : createBranch ? "origin/main" : void 0
|
|
4244
|
+
branch: branchName,
|
|
4245
|
+
create: createBranch,
|
|
4246
|
+
startPoint: createBranch ? "origin/main" : void 0
|
|
4251
4247
|
}, { cwd: this.bareRepoPath });
|
|
4252
4248
|
if (!result.success) {
|
|
4253
4249
|
return {
|
|
@@ -7524,13 +7520,12 @@ async function handleWorktreeCreate(request2) {
|
|
|
7524
7520
|
createBranch,
|
|
7525
7521
|
repoUrl,
|
|
7526
7522
|
envVars,
|
|
7527
|
-
setupScript
|
|
7528
|
-
detachedHead
|
|
7529
|
-
// EP1223: Default to false for backward compatibility
|
|
7523
|
+
setupScript
|
|
7524
|
+
// EP1229: detachedHead removed - planning worktrees no longer exist
|
|
7530
7525
|
} = request2;
|
|
7531
7526
|
console.log(`[Worktree] K1273: Creating worktree for ${moduleUid}`);
|
|
7532
7527
|
console.log(`[Worktree] Project: ${projectSlug}`);
|
|
7533
|
-
console.log(`[Worktree] Branch: ${branchName} (create: ${createBranch}
|
|
7528
|
+
console.log(`[Worktree] Branch: ${branchName} (create: ${createBranch})`);
|
|
7534
7529
|
if (!validateModuleUid(moduleUid)) {
|
|
7535
7530
|
return {
|
|
7536
7531
|
success: false,
|
|
@@ -7584,7 +7579,7 @@ async function handleWorktreeCreate(request2) {
|
|
|
7584
7579
|
error: `Failed to initialize WorktreeManager at ${projectPath}`
|
|
7585
7580
|
};
|
|
7586
7581
|
}
|
|
7587
|
-
const result = await manager.createWorktree(moduleUid, branchName, createBranch
|
|
7582
|
+
const result = await manager.createWorktree(moduleUid, branchName, createBranch);
|
|
7588
7583
|
if (!result.success) {
|
|
7589
7584
|
return {
|
|
7590
7585
|
success: false,
|
|
@@ -7980,35 +7975,6 @@ async function handleProjectSetup(params) {
|
|
|
7980
7975
|
};
|
|
7981
7976
|
}
|
|
7982
7977
|
}
|
|
7983
|
-
async function handleFolderCleanup(projectPath, moduleUid) {
|
|
7984
|
-
if (!moduleUid || !UUID_REGEX.test(moduleUid)) {
|
|
7985
|
-
console.error(`[FolderCleanup] EP1226: Invalid moduleUid format: ${moduleUid}`);
|
|
7986
|
-
return { success: false, error: "Invalid moduleUid format" };
|
|
7987
|
-
}
|
|
7988
|
-
const folderPath = path17.join(projectPath, moduleUid);
|
|
7989
|
-
console.log(`[FolderCleanup] EP1226: Cleaning up module folder: ${folderPath}`);
|
|
7990
|
-
try {
|
|
7991
|
-
try {
|
|
7992
|
-
await fs16.promises.access(folderPath);
|
|
7993
|
-
} catch {
|
|
7994
|
-
console.log(`[FolderCleanup] EP1226: Module folder does not exist, nothing to clean: ${folderPath}`);
|
|
7995
|
-
return { success: true, folderPath };
|
|
7996
|
-
}
|
|
7997
|
-
await fs16.promises.rm(folderPath, { recursive: true, force: true });
|
|
7998
|
-
console.log(`[FolderCleanup] EP1226: Module folder removed: ${folderPath}`);
|
|
7999
|
-
return {
|
|
8000
|
-
success: true,
|
|
8001
|
-
folderPath
|
|
8002
|
-
};
|
|
8003
|
-
} catch (error) {
|
|
8004
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
8005
|
-
console.error(`[FolderCleanup] EP1226: Cleanup failed:`, errorMessage);
|
|
8006
|
-
return {
|
|
8007
|
-
success: false,
|
|
8008
|
-
error: errorMessage
|
|
8009
|
-
};
|
|
8010
|
-
}
|
|
8011
|
-
}
|
|
8012
7978
|
|
|
8013
7979
|
// src/daemon/handlers/stale-commit-cleanup.ts
|
|
8014
7980
|
var import_child_process9 = require("child_process");
|
|
@@ -10479,10 +10445,7 @@ var Daemon = class _Daemon {
|
|
|
10479
10445
|
case "project:setup":
|
|
10480
10446
|
result = await handleProjectSetup(cmd);
|
|
10481
10447
|
break;
|
|
10482
|
-
//
|
|
10483
|
-
case "folder:cleanup":
|
|
10484
|
-
result = await handleFolderCleanup(projectPath, cmd.moduleUid);
|
|
10485
|
-
break;
|
|
10448
|
+
// EP1229: folder:cleanup removed (module folders no longer used)
|
|
10486
10449
|
default:
|
|
10487
10450
|
result = {
|
|
10488
10451
|
success: false,
|
|
@@ -10661,17 +10624,26 @@ var Daemon = class _Daemon {
|
|
|
10661
10624
|
} else {
|
|
10662
10625
|
console.log(`[Daemon] EP1205: Worktree requested but not found for ${cmd.moduleUid}, using project root`);
|
|
10663
10626
|
}
|
|
10664
|
-
} else if (cmd.sessionContext === "module_folder" && cmd.moduleUid) {
|
|
10665
|
-
const moduleFolderPath = path24.join(projectPath, cmd.moduleUid);
|
|
10666
|
-
try {
|
|
10667
|
-
await fs23.promises.mkdir(moduleFolderPath, { recursive: true });
|
|
10668
|
-
agentWorkingDir = moduleFolderPath;
|
|
10669
|
-
console.log(`[Daemon] EP1226: Agent for ${cmd.moduleUid} in module folder: ${agentWorkingDir}`);
|
|
10670
|
-
} catch (err) {
|
|
10671
|
-
console.error(`[Daemon] EP1226: Failed to create module folder ${moduleFolderPath}, using project root:`, err);
|
|
10672
|
-
}
|
|
10673
10627
|
} else if (cmd.sessionContext === "project_root") {
|
|
10674
|
-
|
|
10628
|
+
if (cmd.workspaceSlug && cmd.projectSlug) {
|
|
10629
|
+
const resolvedProjectPath = path24.join(
|
|
10630
|
+
process.env.HOME || projectPath,
|
|
10631
|
+
"episoda",
|
|
10632
|
+
cmd.workspaceSlug,
|
|
10633
|
+
cmd.projectSlug
|
|
10634
|
+
);
|
|
10635
|
+
if (resolvedProjectPath !== projectPath) {
|
|
10636
|
+
try {
|
|
10637
|
+
await fs23.promises.access(resolvedProjectPath);
|
|
10638
|
+
agentWorkingDir = resolvedProjectPath;
|
|
10639
|
+
console.log(`[Daemon] EP1227: Agent for ${cmd.moduleUid || "project"} in resolved project path: ${agentWorkingDir}`);
|
|
10640
|
+
} catch {
|
|
10641
|
+
console.log(`[Daemon] EP1227: Resolved project path not found, using projectPath: ${projectPath}`);
|
|
10642
|
+
}
|
|
10643
|
+
}
|
|
10644
|
+
} else {
|
|
10645
|
+
console.log(`[Daemon] EP1205: Agent for ${cmd.moduleUid || "project"} in project root (sessionContext=project_root)`);
|
|
10646
|
+
}
|
|
10675
10647
|
} else {
|
|
10676
10648
|
if (cmd.moduleUid) {
|
|
10677
10649
|
const worktreeInfo = await getWorktreeInfoForModule(cmd.moduleUid);
|