deeper-cli 1.3.0 → 1.3.2

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/cli/index.js CHANGED
@@ -4049,7 +4049,13 @@ var init_DeepSeekClient = __esm({
4049
4049
  }));
4050
4050
  body.tool_choice = "auto";
4051
4051
  }
4052
- return JSON.stringify(body);
4052
+ return JSON.stringify({
4053
+ ...body,
4054
+ messages: body.messages.map((m) => {
4055
+ if (m.role === "tool" && !m.name) m.name = "tool";
4056
+ return m;
4057
+ })
4058
+ });
4053
4059
  }
4054
4060
  async makeRequest(config, body) {
4055
4061
  const url = `${config.baseUrl}/v1/chat/completions`;
@@ -11875,6 +11881,7 @@ ${prevSummary.slice(0, 800)}` });
11875
11881
  O(G(" /config") + G(" \u914D\u7F6E\u7BA1\u7406") + "\n");
11876
11882
  O(G(" /cwd") + G(" \u5F53\u524D\u76EE\u5F55") + "\n");
11877
11883
  O(G(" /export") + G(" \u5BFC\u51FA\u5BF9\u8BDD") + "\n");
11884
+ O(G(" /delete [n]") + G(" \u5220\u9664\u4F1A\u8BDD") + "\n");
11878
11885
  O(G(" /init") + G(" \u521D\u59CB\u5316\u9879\u76EE") + "\n");
11879
11886
  O("\n");
11880
11887
  continue;
@@ -11935,6 +11942,46 @@ ${prevSummary.slice(0, 800)}` });
11935
11942
  await exportHistory(history);
11936
11943
  continue;
11937
11944
  }
11945
+ if (cmd === "/delete" || cmd === "/rm") {
11946
+ if (!arg) {
11947
+ if (!existsSync53(SESSION_DIR)) {
11948
+ O(r(" \u65E0\u4FDD\u5B58\u7684\u4F1A\u8BDD\n\n"));
11949
+ continue;
11950
+ }
11951
+ const files = readdirSync4(SESSION_DIR).filter((f) => f.endsWith(".json") && !f.startsWith("_")).sort().reverse();
11952
+ if (!files.length) {
11953
+ O(r(" \u65E0\u4FDD\u5B58\u7684\u4F1A\u8BDD\n\n"));
11954
+ continue;
11955
+ }
11956
+ O(b(c(" Sessions")) + G(` \xB7 ${files.length} \u4E2A`) + "\n");
11957
+ O(G(` \u7528\u6CD5: /delete <\u540D\u79F0> \u5220\u9664\u6307\u5B9A\u4F1A\u8BDD
11958
+ `));
11959
+ for (let i = 0; i < Math.min(files.length, 15); i++) {
11960
+ const f = files[i];
11961
+ try {
11962
+ const data = JSON.parse(readFileSync37(join12(SESSION_DIR, f), "utf-8"));
11963
+ const label = f.replace(/^sess_|\.json$/g, "");
11964
+ O(G(` ${i + 1}. `) + c(label) + G(` \xB7 ${data.messages?.length || 0}\u6761 \xB7 ${data.savedAt?.slice(0, 16) || "?"}`) + "\n");
11965
+ } catch {
11966
+ }
11967
+ }
11968
+ O("\n");
11969
+ continue;
11970
+ }
11971
+ const targetFile = join12(SESSION_DIR, `sess_${arg}.json`);
11972
+ if (existsSync53(targetFile)) {
11973
+ const { unlinkSync: us } = await import("fs");
11974
+ us(targetFile);
11975
+ O(g(`\u5DF2\u5220\u9664: ${arg}
11976
+
11977
+ `));
11978
+ } else {
11979
+ O(r(` \u4F1A\u8BDD\u4E0D\u5B58\u5728: ${arg}
11980
+
11981
+ `));
11982
+ }
11983
+ continue;
11984
+ }
11938
11985
  if (cmd === "/init") {
11939
11986
  await initProject();
11940
11987
  continue;
@@ -11987,7 +12034,7 @@ ${prevSummary.slice(0, 800)}` });
11987
12034
  O(c(" /help /clear /quit /save [name] /load|resume [name] /sessions\n"));
11988
12035
  O(c(" /tools [cat] /stats /memory /tasks /model /config /cwd /export /init /mcp /rules\n"));
11989
12036
  O(c(" /plan <\u4EFB\u52A1> /spec <\u4EFB\u52A1> /review <\u8DEF\u5F84> /fix [\u76EE\u6807]\n"));
11990
- O(c(" /commit /analyze [\u8DEF\u5F84] /diff <\u6587\u4EF6> /undo /status\n\n"));
12037
+ O(c(" /commit /analyze [\u8DEF\u5F84] /diff <\u6587\u4EF6> /undo /delete [n] /status\n\n"));
11991
12038
  continue;
11992
12039
  }
11993
12040
  if (cmd === "/plan") {