mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-21 07:40:11 +08:00
Merge branch 'feat/agents-new' of https://github.com/CherryHQ/cherry-studio into feat/agents-new
This commit is contained in:
commit
efa54f3435
@ -22,7 +22,7 @@
|
||||
},
|
||||
"get": {
|
||||
"error": {
|
||||
"failed": "[to be translated]:Failed to get the agent."
|
||||
"failed": "Αποτυχία λήψης του πράκτορα."
|
||||
}
|
||||
},
|
||||
"list": {
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
},
|
||||
"list": {
|
||||
"error": {
|
||||
"failed": "[to be translated]:Failed to list agents."
|
||||
"failed": "Échec de la liste des agents."
|
||||
}
|
||||
},
|
||||
"session": {
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
},
|
||||
"list": {
|
||||
"error": {
|
||||
"failed": "[to be translated]:Failed to list agents."
|
||||
"failed": "Falha ao listar agentes."
|
||||
}
|
||||
},
|
||||
"session": {
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user