ai-chat-cleaner 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +2 -1
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -312,7 +312,7 @@ function isUUID(value) {
312
312
  //#endregion
313
313
  //#region package.json
314
314
  var name = "ai-chat-cleaner";
315
- var version = "0.1.5";
315
+ var version = "0.1.6";
316
316
 
317
317
  //#endregion
318
318
  //#region src/constants.ts
@@ -692,6 +692,7 @@ async function updateGlobalState(threadIds, globalState) {
692
692
  await writeJSON(GLOBAL_STATE_PATH, globalState);
693
693
  }
694
694
  async function updateHistory(path, ids) {
695
+ if (!existsSync(path)) return;
695
696
  const remove = new Set(ids);
696
697
  const rows = (await readFile(path, "utf8")).split("\n").filter(Boolean).map((line) => parseJSON(line)).filter((row) => !remove.has(row?.session_id));
697
698
  await writeFile(HISTORY_FILE_PATH, rows.length > 0 ? `${rows.map((row) => JSON.stringify(row)).join("\n")}\n` : "", "utf-8");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-chat-cleaner",
3
3
  "type": "module",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "description": "Clean and remove AI chat with an interactive terminal UI.",
6
6
  "author": "jinghaihan",
7
7
  "license": "MIT",