episoda 0.2.108 → 0.2.109
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.
|
@@ -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.108",
|
|
2819
2819
|
description: "CLI tool for Episoda local development workflow orchestration",
|
|
2820
2820
|
main: "dist/index.js",
|
|
2821
2821
|
types: "dist/index.d.ts",
|
|
@@ -7980,6 +7980,35 @@ async function handleProjectSetup(params) {
|
|
|
7980
7980
|
};
|
|
7981
7981
|
}
|
|
7982
7982
|
}
|
|
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
|
+
}
|
|
7983
8012
|
|
|
7984
8013
|
// src/daemon/handlers/stale-commit-cleanup.ts
|
|
7985
8014
|
var import_child_process9 = require("child_process");
|
|
@@ -10450,6 +10479,10 @@ var Daemon = class _Daemon {
|
|
|
10450
10479
|
case "project:setup":
|
|
10451
10480
|
result = await handleProjectSetup(cmd);
|
|
10452
10481
|
break;
|
|
10482
|
+
// EP1226: Module folder cleanup
|
|
10483
|
+
case "folder:cleanup":
|
|
10484
|
+
result = await handleFolderCleanup(projectPath, cmd.moduleUid);
|
|
10485
|
+
break;
|
|
10453
10486
|
default:
|
|
10454
10487
|
result = {
|
|
10455
10488
|
success: false,
|
|
@@ -10628,6 +10661,15 @@ var Daemon = class _Daemon {
|
|
|
10628
10661
|
} else {
|
|
10629
10662
|
console.log(`[Daemon] EP1205: Worktree requested but not found for ${cmd.moduleUid}, using project root`);
|
|
10630
10663
|
}
|
|
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
|
+
}
|
|
10631
10673
|
} else if (cmd.sessionContext === "project_root") {
|
|
10632
10674
|
console.log(`[Daemon] EP1205: Agent for ${cmd.moduleUid || "project"} in project root (sessionContext=project_root)`);
|
|
10633
10675
|
} else {
|