astrocode-workflow 0.4.3 → 0.4.4
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/src/tools/reset.js +0 -22
- package/package.json +1 -1
- package/src/tools/reset.ts +0 -23
package/dist/src/tools/reset.js
CHANGED
|
@@ -30,33 +30,11 @@ export function createAstroResetTool(opts) {
|
|
|
30
30
|
lines.push("🗑️ Astrocode Database Reset");
|
|
31
31
|
lines.push(`- Repo: ${repoRoot}`);
|
|
32
32
|
lines.push(`- Target: ${fullDbPath}`);
|
|
33
|
-
// Check for lock file
|
|
34
|
-
const lockPath = `${repoRoot}/.astro/astro.lock`;
|
|
35
|
-
if (fs.existsSync(lockPath)) {
|
|
36
|
-
try {
|
|
37
|
-
const lockContent = fs.readFileSync(lockPath, "utf8").trim();
|
|
38
|
-
const pid = parseInt(lockContent.split(" ")[0]);
|
|
39
|
-
lines.push(`- Lock file found for PID ${pid}`);
|
|
40
|
-
// Try to kill the process
|
|
41
|
-
try {
|
|
42
|
-
process.kill(pid, 'SIGTERM');
|
|
43
|
-
lines.push(`- Sent SIGTERM to PID ${pid}, waiting 2s...`);
|
|
44
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
lines.push(`- Could not kill PID ${pid}: ${String(e)}`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
lines.push(`- Error reading lock file: ${String(e)}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
33
|
// Delete DB files
|
|
55
34
|
const filesToDelete = [
|
|
56
35
|
fullDbPath,
|
|
57
36
|
`${fullDbPath}-wal`,
|
|
58
37
|
`${fullDbPath}-shm`,
|
|
59
|
-
lockPath,
|
|
60
38
|
];
|
|
61
39
|
let deletedCount = 0;
|
|
62
40
|
for (const filePath of filesToDelete) {
|
package/package.json
CHANGED
package/src/tools/reset.ts
CHANGED
|
@@ -37,34 +37,11 @@ export function createAstroResetTool(opts: { ctx: any; config: AstrocodeConfig;
|
|
|
37
37
|
lines.push(`- Repo: ${repoRoot}`);
|
|
38
38
|
lines.push(`- Target: ${fullDbPath}`);
|
|
39
39
|
|
|
40
|
-
// Check for lock file
|
|
41
|
-
const lockPath = `${repoRoot}/.astro/astro.lock`;
|
|
42
|
-
if (fs.existsSync(lockPath)) {
|
|
43
|
-
try {
|
|
44
|
-
const lockContent = fs.readFileSync(lockPath, "utf8").trim();
|
|
45
|
-
const pid = parseInt(lockContent.split(" ")[0]);
|
|
46
|
-
|
|
47
|
-
lines.push(`- Lock file found for PID ${pid}`);
|
|
48
|
-
|
|
49
|
-
// Try to kill the process
|
|
50
|
-
try {
|
|
51
|
-
(process as any).kill(pid, 'SIGTERM');
|
|
52
|
-
lines.push(`- Sent SIGTERM to PID ${pid}, waiting 2s...`);
|
|
53
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
54
|
-
} catch (e) {
|
|
55
|
-
lines.push(`- Could not kill PID ${pid}: ${String(e)}`);
|
|
56
|
-
}
|
|
57
|
-
} catch (e) {
|
|
58
|
-
lines.push(`- Error reading lock file: ${String(e)}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
40
|
// Delete DB files
|
|
63
41
|
const filesToDelete = [
|
|
64
42
|
fullDbPath,
|
|
65
43
|
`${fullDbPath}-wal`,
|
|
66
44
|
`${fullDbPath}-shm`,
|
|
67
|
-
lockPath,
|
|
68
45
|
];
|
|
69
46
|
|
|
70
47
|
let deletedCount = 0;
|