Merge branch 'feat/agents-new' of https://github.com/CherryHQ/cherry-studio into feat/agents-new

This commit is contained in:
suyao 2025-09-22 14:42:41 +08:00
commit efa54f3435
No known key found for this signature in database
8 changed files with 20 additions and 17 deletions

View File

@ -22,7 +22,7 @@
},
"get": {
"error": {
"failed": "[to be translated]:Failed to get the agent."
"failed": "Αποτυχία λήψης του πράκτορα."
}
},
"list": {

View File

@ -27,7 +27,7 @@
},
"list": {
"error": {
"failed": "[to be translated]:Failed to list agents."
"failed": "Échec de la liste des agents."
}
},
"session": {

View File

@ -27,7 +27,7 @@
},
"list": {
"error": {
"failed": "[to be translated]:Failed to list agents."
"failed": "Falha ao listar agentes."
}
},
"session": {

View File

@ -60,7 +60,7 @@ const KnowledgeDirectories: FC<KnowledgeContentProps> = ({ selectedBase, progres
}
const path = await window.api.file.selectFolder()
logger.info('Selected directory:', path)
logger.info('Selected directory:', { path })
path && addDirectory(path)
}

View File

@ -19,16 +19,26 @@ const assistantsSlice = createSlice({
initialState,
reducers: {
setAssistantPresets: (state, action: PayloadAction<AssistantPreset[]>) => {
state.agents = action.payload
const presets = action.payload
state.agents = []
presets.forEach((p) => {
state.agents.push(p)
})
},
addAssistantPreset: (state, action: PayloadAction<AssistantPreset>) => {
// @ts-ignore ts-2589 false positive
state.agents.push(action.payload)
},
removeAssistantPreset: (state, action: PayloadAction<{ id: string }>) => {
state.agents = state.agents.filter((c) => c.id !== action.payload.id)
},
updateAssistantPreset: (state, action: PayloadAction<AssistantPreset>) => {
state.agents = state.agents.map((c) => (c.id === action.payload.id ? action.payload : c))
const preset = action.payload
state.agents.forEach((a) => {
if (a.id === preset.id) {
a = preset
}
})
},
updateAssistantPresetSettings: (
state,

View File

@ -2465,15 +2465,6 @@ const migrateConfig = {
}
},
'155': (state: RootState) => {
try {
state.agents.agentsNew = []
return state
} catch (error) {
logger.error('migrate 155 error', error as Error)
return state
}
},
'156': (state: RootState) => {
try {
state.knowledge.bases.forEach((base) => {
if ((base as any).framework) {
@ -2486,7 +2477,7 @@ const migrateConfig = {
return state
}
},
'157': (state: RootState) => {
'156': (state: RootState) => {
try {
state.llm.providers.forEach((provider) => {
if (provider.id === SystemProviderIds.anthropic) {
@ -2497,7 +2488,7 @@ const migrateConfig = {
})
return state
} catch (error) {
logger.error('migrate 157 error', error as Error)
logger.error('migrate 156 error', error as Error)
return state
}
}

View File

@ -102,6 +102,7 @@ export const messagesSlice = createSlice({
},
messagesReceived(state, action: PayloadAction<MessagesReceivedPayload>) {
const { topicId, messages } = action.payload
// @ts-ignore ts-2589 false positive
messagesAdapter.upsertMany(state, messages)
state.messageIdsByTopic[topicId] = messages.map((m) => m.id)
state.currentTopicId = topicId

View File

@ -150,6 +150,7 @@ const runtimeSlice = createSlice({
state.chat.selectedMessageIds = action.payload
},
setActiveTopic: (state, action: PayloadAction<Topic>) => {
// @ts-ignore ts2589 false positive
state.chat.activeTopic = action.payload
},
setActiveAgentId: (state, action: PayloadAction<string>) => {