dskcode 0.1.34 → 0.1.35

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/index.js CHANGED
@@ -2101,7 +2101,7 @@ function TodoListPanel({ items }) {
2101
2101
  // package.json
2102
2102
  var package_default = {
2103
2103
  name: "dskcode",
2104
- version: "0.1.34",
2104
+ version: "0.1.35",
2105
2105
  repository: {
2106
2106
  type: "git",
2107
2107
  url: "git+https://github.com/Awu12277/deepseek-agent-cli/tree/main"
@@ -3025,9 +3025,9 @@ var TodoList = class {
3025
3025
  (it) => it.status === "done" || it.status === "failed" || it.status === "skipped"
3026
3026
  );
3027
3027
  }
3028
- /** 全部条目(只读快照) */
3028
+ /** 全部条目(只读快照 — 每次返回新数组,避免上游拿到内部引用后被原地修改) */
3029
3029
  get items() {
3030
- return this.#items;
3030
+ return this.#items.map((it) => ({ ...it }));
3031
3031
  }
3032
3032
  /**
3033
3033
  * 把 todo 列表拼成 markdown,用于注入 system prompt。
@@ -6160,7 +6160,14 @@ function ChatSession({
6160
6160
  const hasUnfinished = todoSnapshot.some(
6161
6161
  (it) => it.status === "pending" || it.status === "running" || it.status === "failed"
6162
6162
  );
6163
- setTodoPanelVisible(hasUnfinished);
6163
+ if (hasUnfinished) {
6164
+ setTodoPanelVisible(true);
6165
+ } else {
6166
+ todoHideTimerRef.current = setTimeout(() => {
6167
+ setTodoPanelVisible(false);
6168
+ todoHideTimerRef.current = null;
6169
+ }, 2e3);
6170
+ }
6164
6171
  }, [todoSnapshot]);
6165
6172
  const getFilteredSkills = useCallback2(
6166
6173
  (value) => {
@@ -6813,6 +6820,11 @@ function ChatSession({
6813
6820
  rewindHintTimerRef.current = null;
6814
6821
  }
6815
6822
  setTodoSnapshot([]);
6823
+ if (todoHideTimerRef.current) {
6824
+ clearTimeout(todoHideTimerRef.current);
6825
+ todoHideTimerRef.current = null;
6826
+ }
6827
+ setTodoPanelVisible(false);
6816
6828
  const session = sessionRef.current;
6817
6829
  const abortController = new AbortController();
6818
6830
  abortRef.current = abortController;
@@ -6870,14 +6882,7 @@ function ChatSession({
6870
6882
  currentToolCallsRef.current = [];
6871
6883
  const r = event.result;
6872
6884
  if (event.name.startsWith("todo_") && event.todoSnapshot) {
6873
- const allTerminated = event.todoSnapshot.length > 0 && event.todoSnapshot.every(
6874
- (it) => it.status === "done" || it.status === "failed" || it.status === "skipped"
6875
- );
6876
- if (allTerminated) {
6877
- setTodoSnapshot([]);
6878
- } else {
6879
- setTodoSnapshot(event.todoSnapshot);
6880
- }
6885
+ setTodoSnapshot([...event.todoSnapshot]);
6881
6886
  } else {
6882
6887
  const line = r.success ? r.summary ?? `\u2705 ${event.name}: ${r.data.slice(0, 500)}${r.data.length > 500 ? "..." : ""}` : `\u274C ${event.name}: ${r.error ?? "\u6267\u884C\u5931\u8D25"}`;
6883
6888
  setDisplayMessages((prev) => [