feat(deskclaw): rebrand + vibe presets + chat model picker
This commit is contained in:
@@ -16,6 +16,7 @@ interface AgentsState {
|
||||
createAgent: (name: string, options?: { inheritWorkspace?: boolean }) => Promise<void>;
|
||||
updateAgent: (agentId: string, name: string) => Promise<void>;
|
||||
updateAgentModel: (agentId: string, modelRef: string | null) => Promise<void>;
|
||||
updateDefaultModel: (modelRef: string | null) => Promise<void>;
|
||||
deleteAgent: (agentId: string) => Promise<void>;
|
||||
assignChannel: (agentId: string, channelType: ChannelType) => Promise<void>;
|
||||
removeChannel: (agentId: string, channelType: ChannelType) => Promise<void>;
|
||||
@@ -104,6 +105,23 @@ export const useAgentsStore = create<AgentsState>((set) => ({
|
||||
}
|
||||
},
|
||||
|
||||
updateDefaultModel: async (modelRef: string | null) => {
|
||||
set({ error: null });
|
||||
try {
|
||||
const snapshot = await hostApiFetch<AgentsSnapshot & { success?: boolean }>(
|
||||
'/api/agents/default-model',
|
||||
{
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ modelRef }),
|
||||
}
|
||||
);
|
||||
set(applySnapshot(snapshot));
|
||||
} catch (error) {
|
||||
set({ error: String(error) });
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
deleteAgent: async (agentId: string) => {
|
||||
set({ error: null });
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user