deeper-cli 1.0.1 → 1.0.3

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
@@ -10794,7 +10794,7 @@ async function startRepl(opts) {
10794
10794
  }
10795
10795
  if (tcs.length > 0) {
10796
10796
  stag = 0;
10797
- lh.push({ role: "assistant", content: fc || null, reasoning_content: void 0, tool_calls: tcs.map((t) => ({ id: t.id, name: t.name, arguments: { ...t.args } })) });
10797
+ lh.push({ role: "assistant", content: fc || null, reasoning_content: th || void 0, tool_calls: tcs.map((t) => ({ id: t.id, name: t.name, arguments: { ...t.args } })) });
10798
10798
  for (const tc of tcs) {
10799
10799
  const tool = tools.find((t) => t.name === tc.name);
10800
10800
  if (!tool) {
@@ -10819,7 +10819,7 @@ async function startRepl(opts) {
10819
10819
  continue;
10820
10820
  }
10821
10821
  if (fc) {
10822
- lh.push({ role: "assistant", content: fc });
10822
+ lh.push({ role: "assistant", content: fc, reasoning_content: th || void 0 });
10823
10823
  stag = 0;
10824
10824
  } else {
10825
10825
  stag++;
@@ -10993,6 +10993,8 @@ ${prevSummary.slice(0, 800)}` });
10993
10993
  O(G(" /tasks") + G(" \u4EFB\u52A1\u5217\u8868") + "\n");
10994
10994
  O(G(" /rules") + G(" \u89C4\u5219\u7BA1\u7406") + "\n");
10995
10995
  O(G(" /mcp") + G(" MCP\u670D\u52A1\u5668") + "\n");
10996
+ O(G(" /plan") + G(" <\u4EFB\u52A1> \u5148\u51FA\u65B9\u6848") + "\n");
10997
+ O(G(" /spec") + G(" <\u4EFB\u52A1> \u5148\u51FA\u89C4\u683C") + "\n");
10996
10998
  O(G(" /status") + G(" \u5F53\u524D\u72B6\u6001") + "\n");
10997
10999
  O(G(" /model") + G(" \u6A21\u578B\u8BBE\u7F6E") + "\n");
10998
11000
  O(G(" /config") + G(" \u914D\u7F6E\u7BA1\u7406") + "\n");
@@ -11108,7 +11110,49 @@ ${prevSummary.slice(0, 800)}` });
11108
11110
  }
11109
11111
  if (cmd === "/help") {
11110
11112
  O(c(" /help /clear /quit /save [name] /load|resume [name] /sessions\n"));
11111
- O(c(" /tools [cat] /stats /memory /tasks /model /config /cwd /export /init /mcp /rules\n\n"));
11113
+ O(c(" /tools [cat] /stats /memory /tasks /model /config /cwd /export /init /mcp /rules\n"));
11114
+ O(c(" /plan <\u4EFB\u52A1> /spec <\u4EFB\u52A1> /status\n\n"));
11115
+ continue;
11116
+ }
11117
+ if (cmd === "/plan") {
11118
+ if (!arg) {
11119
+ O(y(" \u7528\u6CD5: /plan <\u4EFB\u52A1\u63CF\u8FF0>\n\n"));
11120
+ continue;
11121
+ }
11122
+ O(b(c(" Plan Mode")) + G(` \u2022 ${arg.slice(0, 50)}`) + "\n\n");
11123
+ history.push({ role: "system", content: `[Plan Mode]
11124
+ \u4F60\u5FC5\u987B\u9075\u5FAA\u4EE5\u4E0B\u6D41\u7A0B\uFF0C\u4E25\u683C\u6309\u6B65\u9AA4\u6267\u884C\uFF1A
11125
+ 1. \u5148\u8F93\u51FA\u4E00\u4EFD\u8BE6\u5C3D\u7684\u5B9E\u65BD\u65B9\u6848\uFF08\u4E0D\u8981\u5199\u4EE3\u7801\uFF09
11126
+ 2. \u65B9\u6848\u5FC5\u987B\u5305\u542B\uFF1A\u9700\u6C42\u5206\u6790\u3001\u6280\u672F\u9009\u578B\u3001\u67B6\u6784\u8BBE\u8BA1\u3001\u6570\u636E\u6D41\u3001\u6A21\u5757\u5212\u5206\u3001\u5B9E\u65BD\u6B65\u9AA4
11127
+ 3. \u7B49\u5F85\u7528\u6237\u786E\u8BA4\u65B9\u6848\uFF08\u8F93\u5165 ok/\u7EE7\u7EED/\u53EF\u4EE5 \u7B49\u786E\u8BA4\u8BCD\uFF09
11128
+ 4. \u7528\u6237\u786E\u8BA4\u540E\uFF0C\u6309\u65B9\u6848\u9010\u6B65\u5B9E\u65BD\uFF0C\u6BCF\u5B8C\u6210\u4E00\u6B65\u66F4\u65B0 todo
11129
+ 5. \u5B8C\u6210\u540E\u603B\u7ED3\u4EA4\u4ED8\u5185\u5BB9
11130
+
11131
+ \u5F53\u524D\u4EFB\u52A1\uFF1A${arg}` });
11132
+ history.push({ role: "user", content: arg });
11133
+ const pfdefs = toolsToDefs(tools);
11134
+ await runLoop(opts, history, tools, pfdefs, confirm);
11135
+ continue;
11136
+ }
11137
+ if (cmd === "/spec") {
11138
+ if (!arg) {
11139
+ O(y(" \u7528\u6CD5: /spec <\u4EFB\u52A1\u63CF\u8FF0>\n\n"));
11140
+ continue;
11141
+ }
11142
+ O(b(c(" Spec Mode")) + G(` \u2022 ${arg.slice(0, 50)}`) + "\n\n");
11143
+ history.push({ role: "system", content: `[Spec Mode]
11144
+ \u4F60\u5FC5\u987B\u9075\u5FAA\u4EE5\u4E0B\u6D41\u7A0B\uFF0C\u4E25\u683C\u6309\u6B65\u9AA4\u6267\u884C\uFF1A
11145
+ 1. \u5148\u8F93\u51FA\u4E00\u4EFD\u5B8C\u6574\u7684\u4EA7\u54C1\u89C4\u683C\u6587\u6863\uFF08\u4E0D\u8981\u5199\u4EE3\u7801\uFF09
11146
+ 2. \u89C4\u683C\u6587\u6863\u5FC5\u987B\u5305\u542B\uFF1A\u9700\u6C42\u6982\u8FF0\u3001\u529F\u80FD\u6E05\u5355\u3001\u4EA4\u4E92\u8BBE\u8BA1\u3001\u6570\u636E\u7ED3\u6784\u3001API\u8BBE\u8BA1\u3001\u7EC4\u4EF6\u6811\u3001\u975E\u529F\u80FD\u6027\u9700\u6C42\u3001\u6D4B\u8BD5\u7B56\u7565\u3001\u91CC\u7A0B\u7891
11147
+ 3. \u6587\u6863\u4F7F\u7528 Markdown \u683C\u5F0F\uFF0C\u6807\u9898\u7528 # \u5C42\u6B21\u6E05\u6670
11148
+ 4. \u7B49\u5F85\u7528\u6237\u786E\u8BA4\u89C4\u683C\uFF08\u8F93\u5165 ok/\u7EE7\u7EED/\u53EF\u4EE5 \u7B49\u786E\u8BA4\u8BCD\uFF09
11149
+ 5. \u7528\u6237\u786E\u8BA4\u540E\uFF0C\u6309\u89C4\u683C\u9010\u6B65\u5B9E\u65BD\uFF0C\u6BCF\u5B8C\u6210\u4E00\u6B65\u66F4\u65B0 todo
11150
+ 6. \u5B8C\u6210\u540E\u603B\u7ED3\u4EA4\u4ED8\u5185\u5BB9
11151
+
11152
+ \u5F53\u524D\u4EFB\u52A1\uFF1A${arg}` });
11153
+ history.push({ role: "user", content: arg });
11154
+ const sfdefs = toolsToDefs(tools);
11155
+ await runLoop(opts, history, tools, sfdefs, confirm);
11112
11156
  continue;
11113
11157
  }
11114
11158
  O(G(` \u672A\u77E5\u547D\u4EE4: ${cmd} (\u8F93\u5165 /help \u67E5\u770B\u5E2E\u52A9)
@@ -11261,7 +11305,7 @@ async function runLoop(opts, history, tools, toolDefs, confirm) {
11261
11305
  stagnation = 0;
11262
11306
  Oflush();
11263
11307
  const compactFc = fc && fc.length > 500 ? fc.replace(/\n/g, " ").slice(0, 300) + "\u2026" : fc;
11264
- history.push({ role: "assistant", content: compactFc || null, reasoning_content: void 0, tool_calls: tcs.map((t) => ({ id: t.id, name: t.name, arguments: { ...t.args } })) });
11308
+ history.push({ role: "assistant", content: compactFc || null, reasoning_content: th || void 0, tool_calls: tcs.map((t) => ({ id: t.id, name: t.name, arguments: { ...t.args } })) });
11265
11309
  fc = "";
11266
11310
  th = "";
11267
11311
  let doneTools = 0;
@@ -11312,7 +11356,7 @@ async function runLoop(opts, history, tools, toolDefs, confirm) {
11312
11356
  continue;
11313
11357
  }
11314
11358
  if (fc) {
11315
- history.push({ role: "assistant", content: fc });
11359
+ history.push({ role: "assistant", content: fc, reasoning_content: th || void 0 });
11316
11360
  stagnation = 0;
11317
11361
  } else {
11318
11362
  stagnation++;