mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-11 01:34:45 +08:00
feat: add Todos
This commit is contained in:
@@ -41,6 +41,11 @@ export const enUS: Translations = {
|
||||
thinkingDisabled: "Thinking is disabled",
|
||||
clickToDisableThinking: "Click to disable thinking",
|
||||
clickToEnableThinking: "Click to enable thinking",
|
||||
planMode: "Plan mode",
|
||||
planModeEnabled: "Plan mode is enabled",
|
||||
planModeDisabled: "Plan mode is disabled",
|
||||
clickToDisablePlanMode: "Click to disable plan mode",
|
||||
clickToEnablePlanMode: "Click to enable plan mode",
|
||||
searchModels: "Search models...",
|
||||
},
|
||||
|
||||
@@ -87,6 +92,7 @@ export const enUS: Translations = {
|
||||
listFolder: "List folder",
|
||||
readFile: "Read file",
|
||||
writeFile: "Write file",
|
||||
writeTodos: "Update to-do list",
|
||||
},
|
||||
|
||||
// Settings
|
||||
|
||||
@@ -38,6 +38,11 @@ export interface Translations {
|
||||
thinkingDisabled: string;
|
||||
clickToDisableThinking: string;
|
||||
clickToEnableThinking: string;
|
||||
planMode: string;
|
||||
planModeEnabled: string;
|
||||
planModeDisabled: string;
|
||||
clickToDisablePlanMode: string;
|
||||
clickToEnablePlanMode: string;
|
||||
searchModels: string;
|
||||
};
|
||||
|
||||
@@ -84,6 +89,7 @@ export interface Translations {
|
||||
listFolder: string;
|
||||
readFile: string;
|
||||
writeFile: string;
|
||||
writeTodos: string;
|
||||
};
|
||||
|
||||
// Settings
|
||||
|
||||
@@ -41,6 +41,11 @@ export const zhCN: Translations = {
|
||||
thinkingDisabled: "思考功能已禁用",
|
||||
clickToDisableThinking: "点击禁用思考功能",
|
||||
clickToEnableThinking: "点击启用思考功能",
|
||||
planMode: "To-do 模式",
|
||||
planModeEnabled: "To-do 模式已启用",
|
||||
planModeDisabled: "To-do 模式已禁用",
|
||||
clickToDisablePlanMode: "点击禁用 To-do 模式",
|
||||
clickToEnablePlanMode: "点击启用 To-do 模式",
|
||||
searchModels: "搜索模型...",
|
||||
},
|
||||
|
||||
@@ -87,6 +92,7 @@ export const zhCN: Translations = {
|
||||
listFolder: "列出文件夹",
|
||||
readFile: "读取文件",
|
||||
writeFile: "写入文件",
|
||||
writeTodos: "更新 To-do 列表",
|
||||
},
|
||||
|
||||
// Settings
|
||||
|
||||
@@ -85,29 +85,6 @@ export function groupMessages<T>(
|
||||
}
|
||||
}
|
||||
|
||||
// if (!isLoading) {
|
||||
// const lastGroup: MessageGroup | undefined = groups[groups.length - 1];
|
||||
// if (
|
||||
// lastGroup?.type === "assistant:processing" &&
|
||||
// lastGroup.messages.length > 0
|
||||
// ) {
|
||||
// const lastMessage = lastGroup.messages[lastGroup.messages.length - 1]!;
|
||||
// const reasoningContent = extractReasoningContentFromMessage(lastMessage);
|
||||
// const content = extractContentFromMessage(lastMessage);
|
||||
// if (reasoningContent && !content) {
|
||||
// lastGroup.messages.pop();
|
||||
// if (lastGroup.messages.length === 0) {
|
||||
// groups.pop();
|
||||
// }
|
||||
// groups.push({
|
||||
// id: lastMessage.id,
|
||||
// type: "assistant",
|
||||
// messages: [lastMessage],
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
const resultsOfGroups: T[] = [];
|
||||
for (const group of groups) {
|
||||
const resultOfGroup = mapper(group);
|
||||
|
||||
@@ -4,6 +4,7 @@ export const DEFAULT_LOCAL_SETTINGS: LocalSettings = {
|
||||
context: {
|
||||
model_name: "deepseek-v3.2",
|
||||
thinking_enabled: true,
|
||||
is_plan_mode: true,
|
||||
},
|
||||
layout: {
|
||||
sidebar_collapsed: false,
|
||||
@@ -27,10 +28,18 @@ export function getLocalSettings(): LocalSettings {
|
||||
try {
|
||||
if (json) {
|
||||
const settings = JSON.parse(json);
|
||||
return {
|
||||
const mergedSettings = {
|
||||
...DEFAULT_LOCAL_SETTINGS,
|
||||
...settings,
|
||||
context: {
|
||||
...DEFAULT_LOCAL_SETTINGS.context,
|
||||
...settings.context,
|
||||
},
|
||||
layout: {
|
||||
...DEFAULT_LOCAL_SETTINGS.layout,
|
||||
...settings.layout,
|
||||
},
|
||||
};
|
||||
return mergedSettings;
|
||||
}
|
||||
} catch {}
|
||||
return DEFAULT_LOCAL_SETTINGS;
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import { type BaseMessage } from "@langchain/core/messages";
|
||||
import type { Thread } from "@langchain/langgraph-sdk";
|
||||
|
||||
import type { Todo } from "../todos";
|
||||
|
||||
export interface AgentThreadState extends Record<string, unknown> {
|
||||
title: string;
|
||||
messages: BaseMessage[];
|
||||
artifacts: string[];
|
||||
todos?: Todo[];
|
||||
}
|
||||
|
||||
export interface AgentThread extends Thread<AgentThreadState> {}
|
||||
@@ -13,4 +16,5 @@ export interface AgentThreadContext extends Record<string, unknown> {
|
||||
thread_id: string;
|
||||
model_name: string;
|
||||
thinking_enabled: boolean;
|
||||
is_plan_mode: boolean;
|
||||
}
|
||||
|
||||
1
frontend/src/core/todos/index.ts
Normal file
1
frontend/src/core/todos/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./types";
|
||||
4
frontend/src/core/todos/types.ts
Normal file
4
frontend/src/core/todos/types.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface Todo {
|
||||
content?: string;
|
||||
status?: "pending" | "in_progress" | "completed";
|
||||
}
|
||||
Reference in New Issue
Block a user