deeper-cli 1.0.0 → 1.0.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
@@ -10748,8 +10748,7 @@ async function startRepl(opts) {
10748
10748
  ];
10749
10749
  const tds = toolsToDefs(tools);
10750
10750
  let ce = 0, stag = 0;
10751
- const MAX_ITER_SUB = 166;
10752
- for (let iter = 0; iter < MAX_ITER_SUB; iter++) {
10751
+ while (true) {
10753
10752
  const msgs = buildMsgs(lh);
10754
10753
  let fc = "", th = "";
10755
10754
  let tcs = [];
@@ -10795,7 +10794,7 @@ async function startRepl(opts) {
10795
10794
  }
10796
10795
  if (tcs.length > 0) {
10797
10796
  stag = 0;
10798
- 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 } })) });
10799
10798
  for (const tc of tcs) {
10800
10799
  const tool = tools.find((t) => t.name === tc.name);
10801
10800
  if (!tool) {
@@ -10830,7 +10829,6 @@ async function startRepl(opts) {
10830
10829
  const final = lh[lh.length - 1]?.content || "\u5B8C\u6210";
10831
10830
  return final.slice(0, 800);
10832
10831
  }
10833
- return `\u8FBE\u5230\u6700\u5927\u8FED\u4EE3(${MAX_ITER_SUB})`;
10834
10832
  };
10835
10833
  if (isBg) {
10836
10834
  run2().then((result) => {
@@ -11135,8 +11133,7 @@ ${prevSummary.slice(0, 800)}` });
11135
11133
  }
11136
11134
  async function runLoop(opts, history, tools, toolDefs, confirm) {
11137
11135
  let ttc = 0, ce = 0, stagnation = 0;
11138
- const MAX_ITER_MAIN = 50;
11139
- for (let iter = 0; iter < MAX_ITER_MAIN; iter++) {
11136
+ for (let iter = 0; ; iter++) {
11140
11137
  const ctxTokens = estimateTokens(history.map((m) => m.content || "").join("\n"));
11141
11138
  const toolsTokenOverhead = toolDefs.length * 80;
11142
11139
  const totalCtx = ctxTokens + toolsTokenOverhead;
@@ -11264,7 +11261,7 @@ async function runLoop(opts, history, tools, toolDefs, confirm) {
11264
11261
  stagnation = 0;
11265
11262
  Oflush();
11266
11263
  const compactFc = fc && fc.length > 500 ? fc.replace(/\n/g, " ").slice(0, 300) + "\u2026" : fc;
11267
- 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 } })) });
11264
+ 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 } })) });
11268
11265
  fc = "";
11269
11266
  th = "";
11270
11267
  let doneTools = 0;