@openeryc/pi-coding-agent 0.75.18 → 0.75.20

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.
@@ -2069,6 +2069,11 @@ export class InteractiveMode {
2069
2069
  await this.handleCompactCommand(customInstructions);
2070
2070
  return;
2071
2071
  }
2072
+ if (text === "/cleanup") {
2073
+ this.editor.setText("");
2074
+ await this.handleCleanupCommand();
2075
+ return;
2076
+ }
2072
2077
  if (text === "/reload") {
2073
2078
  this.editor.setText("");
2074
2079
  await this.handleReloadCommand();
@@ -4449,6 +4454,17 @@ export class InteractiveMode {
4449
4454
  console.log(`\n${APP_NAME} updated. Restart pi.`);
4450
4455
  process.exit(0);
4451
4456
  }
4457
+ async handleCleanupCommand() {
4458
+ const retentionDays = this.settingsManager.getProjectSettings().sessionRetentionDays ?? 30;
4459
+ this.showStatus(`Cleaning up sessions older than ${retentionDays} days...`);
4460
+ this.ui.requestRender();
4461
+ const deleted = await SessionManager.cleanupOldSessions(retentionDays);
4462
+ this.chatContainer.addChild(new Spacer(1));
4463
+ this.chatContainer.addChild(new Text(theme.fg("dim", deleted > 0
4464
+ ? `Cleaned up ${deleted} session(s) older than ${retentionDays} days.`
4465
+ : `No sessions older than ${retentionDays} days to clean up.`), 1, 0));
4466
+ this.ui.requestRender();
4467
+ }
4452
4468
  handleMemoryCommand() {
4453
4469
  const memory = this.session.resourceLoader.getMemory();
4454
4470
  const memoryPath = path.join(this.sessionManager.getCwd(), ".pi", "memory", "MEMORY.md");