@yeaft/webchat-agent 0.1.67 → 0.1.69
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/crew/session.js +7 -2
- package/package.json +1 -1
package/crew/session.js
CHANGED
|
@@ -335,14 +335,19 @@ export async function handleCheckCrewExists(msg) {
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
/**
|
|
338
|
-
* 删除工作目录下的 .crew
|
|
338
|
+
* 删除工作目录下的 .crew 目录(保留 context/ 历史记录)
|
|
339
339
|
*/
|
|
340
340
|
export async function handleDeleteCrewDir(msg) {
|
|
341
341
|
const { projectDir } = msg;
|
|
342
342
|
if (!isValidProjectDir(projectDir)) return;
|
|
343
343
|
const crewDir = join(projectDir, '.crew');
|
|
344
344
|
try {
|
|
345
|
-
await fs.
|
|
345
|
+
const entries = await fs.readdir(crewDir);
|
|
346
|
+
await Promise.all(
|
|
347
|
+
entries
|
|
348
|
+
.filter(name => name !== 'context')
|
|
349
|
+
.map(name => fs.rm(join(crewDir, name), { recursive: true, force: true }))
|
|
350
|
+
);
|
|
346
351
|
} catch {}
|
|
347
352
|
}
|
|
348
353
|
|