@zhongqian97-code/ecode 0.5.66 → 0.5.68

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.
@@ -718,11 +718,11 @@ function loadMessagesFromJsonl(logFilePath) {
718
718
  } else if (entry.role === "assistant") {
719
719
  const msg = {
720
720
  role: "assistant",
721
- content: entry.content ?? null
721
+ content: entry.content ?? null,
722
+ reasoning_content: entry.reasoning_content ?? ""
722
723
  };
723
- if (entry.tool_calls) {
724
- msg.tool_calls = entry.tool_calls;
725
- }
724
+ if (entry.tool_calls) msg.tool_calls = entry.tool_calls;
725
+ if (entry.reasoning_details) msg.reasoning_details = entry.reasoning_details;
726
726
  messages.push(msg);
727
727
  } else if (entry.role === "tool") {
728
728
  messages.push({
@@ -3,7 +3,7 @@ const _ew=process.emitWarning.bind(process);process.emitWarning=function(w,...a)
3
3
  import {
4
4
  findSession,
5
5
  listSessions
6
- } from "./chunk-LODP7T4D.js";
6
+ } from "./chunk-IC2CWYVU.js";
7
7
 
8
8
  // src/sessions/command.ts
9
9
  import * as path from "path";
@@ -4,7 +4,7 @@ import {
4
4
  createSessionMetadata,
5
5
  updateSessionMetadata,
6
6
  writeSessionMetadata
7
- } from "./chunk-LODP7T4D.js";
7
+ } from "./chunk-IC2CWYVU.js";
8
8
 
9
9
  // src/skills/loader.ts
10
10
  import { readFile, readdir, stat } from "fs/promises";
@@ -1202,29 +1202,23 @@ async function runSubagentRuntime(options) {
1202
1202
  while (turnCount < maxTurns) {
1203
1203
  turnCount++;
1204
1204
  let assistantText = "";
1205
+ let assistantReasoning;
1205
1206
  const toolCalls = [];
1206
1207
  for await (const chunk of provider.stream(messages, tools)) {
1207
1208
  if (chunk.text) {
1208
1209
  assistantText += chunk.text;
1209
1210
  onOutput == null ? void 0 : onOutput(chunk.text);
1210
1211
  }
1211
- if (chunk.done && chunk.toolCalls) {
1212
- toolCalls.push(...chunk.toolCalls);
1212
+ if (chunk.done) {
1213
+ if (chunk.toolCalls) toolCalls.push(...chunk.toolCalls);
1214
+ if (chunk.reasoning) assistantReasoning = chunk.reasoning;
1213
1215
  }
1214
1216
  }
1215
1217
  if (toolCalls.length === 0) {
1216
- messages.push({ role: "assistant", content: assistantText });
1218
+ messages.push(buildAssistantMessage(assistantText, [], assistantReasoning));
1217
1219
  return { success: true, finalText: assistantText, turnCount };
1218
1220
  }
1219
- messages.push({
1220
- role: "assistant",
1221
- content: assistantText || null,
1222
- tool_calls: toolCalls.map((tc) => ({
1223
- id: tc.id,
1224
- type: "function",
1225
- function: { name: tc.name, arguments: tc.arguments }
1226
- }))
1227
- });
1221
+ messages.push(buildAssistantMessage(assistantText, toolCalls, assistantReasoning));
1228
1222
  for (const tc of toolCalls) {
1229
1223
  const result = await executeToolCall(tc);
1230
1224
  messages.push({ role: "tool", tool_call_id: tc.id, content: result });
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  cmdSessionsInspect,
6
6
  cmdSessionsList,
7
7
  cmdSessionsReplay
8
- } from "./chunk-ZNCND354.js";
8
+ } from "./chunk-JDAOARQA.js";
9
9
  import {
10
10
  APPLY_PATCH_TOOL,
11
11
  BASH_TOOL,
@@ -34,7 +34,7 @@ import {
34
34
  todo,
35
35
  webFetch,
36
36
  writeFile
37
- } from "./chunk-WHVNMO5M.js";
37
+ } from "./chunk-VSJXCYVY.js";
38
38
  import {
39
39
  createProvider,
40
40
  createSessionMetadata,
@@ -43,7 +43,7 @@ import {
43
43
  resolveActiveProfile,
44
44
  updateSessionMetadata,
45
45
  writeSessionMetadata
46
- } from "./chunk-LODP7T4D.js";
46
+ } from "./chunk-IC2CWYVU.js";
47
47
 
48
48
  // src/index.ts
49
49
  import { createRequire } from "module";
@@ -461,6 +461,8 @@ var SessionRuntime = class {
461
461
  ts: (/* @__PURE__ */ new Date()).toISOString(),
462
462
  role: "assistant",
463
463
  content: assistantText || null,
464
+ reasoning_content: assistantReasoning ?? "",
465
+ ...lastReasoningDetails ? { reasoning_details: lastReasoningDetails } : {},
464
466
  tool_calls: toolCalls.map((tc) => ({ id: tc.id, type: "function", function: { name: tc.name, arguments: tc.arguments } }))
465
467
  });
466
468
  for (const tc of toolCalls) {
@@ -478,7 +480,7 @@ var SessionRuntime = class {
478
480
  } else {
479
481
  if (assistantText) {
480
482
  this.messages.push(buildAssistantMessage(assistantText, [], assistantReasoning));
481
- (_c = this.logger) == null ? void 0 : _c.append({ ts: (/* @__PURE__ */ new Date()).toISOString(), role: "assistant", content: assistantText || null });
483
+ (_c = this.logger) == null ? void 0 : _c.append({ ts: (/* @__PURE__ */ new Date()).toISOString(), role: "assistant", content: assistantText || null, reasoning_content: assistantReasoning ?? "" });
482
484
  }
483
485
  break;
484
486
  }
@@ -810,7 +812,7 @@ if (rawArgs[0] === "web") {
810
812
  webAutoApprove = true;
811
813
  }
812
814
  }
813
- const { buildServer, generateAccessToken } = await import("./web-24EDYYNA.js");
815
+ const { buildServer, generateAccessToken } = await import("./web-ZYG3OQO7.js");
814
816
  const token = finalConfig.webToken ?? generateAccessToken();
815
817
  const manager = new SessionManager(finalConfig);
816
818
  const __webDirname = dirname(fileURLToPath(import.meta.url));
@@ -907,7 +909,7 @@ Node.js 16/18 \u8BF7\u4F7F\u7528 --web \u6216 --pipe \u6A21\u5F0F\u3002
907
909
  );
908
910
  process.exit(1);
909
911
  }
910
- const { App, React, render, createStdinFilter } = await import("./ui-AARHVTSL.js");
912
+ const { App, React, render, createStdinFilter } = await import("./ui-HQUS2ZJG.js");
911
913
  const stdinFilter = process.stdin.isTTY ? createStdinFilter(process.stdin) : process.stdin;
912
914
  render(
913
915
  React.createElement(App, { config: finalConfig, version: VERSION, autoMode, registry, trustedSkillDirs, initialMessages, stdinFilter }),
@@ -25,7 +25,7 @@ import {
25
25
  todo,
26
26
  webFetch,
27
27
  writeFile
28
- } from "./chunk-WHVNMO5M.js";
28
+ } from "./chunk-VSJXCYVY.js";
29
29
  import {
30
30
  handleSkillInput,
31
31
  loadJobs,
@@ -40,7 +40,7 @@ import {
40
40
  resolveActiveProfile,
41
41
  updateSessionMetadata,
42
42
  writeSessionMetadata
43
- } from "./chunk-LODP7T4D.js";
43
+ } from "./chunk-IC2CWYVU.js";
44
44
 
45
45
  // src/ui/index.ts
46
46
  import { default as default2 } from "react";
@@ -663,9 +663,10 @@ var Input = forwardRef(function Input2({ isActive, onSubmit, onChange, placehold
663
663
  return;
664
664
  }
665
665
  if (input.length > 0) {
666
- const newValue = v.slice(0, pos) + input + v.slice(pos);
666
+ const text = input.replace(/\r\n?/g, "\n");
667
+ const newValue = v.slice(0, pos) + text + v.slice(pos);
667
668
  setValueSync(newValue);
668
- setCursorPosSync(pos + input.length);
669
+ setCursorPosSync(pos + text.length);
669
670
  (_h = onChangeRef.current) == null ? void 0 : _h.call(onChangeRef, newValue);
670
671
  }
671
672
  },
@@ -2646,6 +2647,10 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
2646
2647
  tool_call_id: "tool_call_id" in msg ? msg.tool_call_id : void 0,
2647
2648
  // tool_calls 只在 assistant 角色消息中存在(当 LLM 决定调用工具时)
2648
2649
  tool_calls: "tool_calls" in msg ? msg.tool_calls : void 0,
2650
+ // reasoning_content/reasoning_details 必须随 assistant 消息持久化,
2651
+ // 否则恢复会话时缺失 → DeepSeek thinking 模式 400。
2652
+ reasoning_content: "reasoning_content" in msg ? msg.reasoning_content : void 0,
2653
+ reasoning_details: "reasoning_details" in msg ? msg.reasoning_details : void 0,
2649
2654
  selection: sel
2650
2655
  });
2651
2656
  }
@@ -3,7 +3,7 @@ const _ew=process.emitWarning.bind(process);process.emitWarning=function(w,...a)
3
3
  import {
4
4
  cmdSessionsFork,
5
5
  cmdSessionsReplay
6
- } from "./chunk-ZNCND354.js";
6
+ } from "./chunk-JDAOARQA.js";
7
7
  import {
8
8
  handleSkillInput,
9
9
  loadJobs,
@@ -17,7 +17,7 @@ import {
17
17
  loadMessagesFromJsonl,
18
18
  resolveActiveProfile,
19
19
  saveConfig
20
- } from "./chunk-LODP7T4D.js";
20
+ } from "./chunk-IC2CWYVU.js";
21
21
 
22
22
  // src/web/server.ts
23
23
  import Fastify from "fastify";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhongqian97-code/ecode",
3
- "version": "0.5.66",
3
+ "version": "0.5.68",
4
4
  "description": "A minimal Claude Code clone with REPL interface and bash tool calling",
5
5
  "type": "module",
6
6
  "author": "zhongqian97-code",