mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Add MCP server management with auto-restart functionality
This commit is contained in:
1 parent
1723fa1d38
commit
fea3c214af
13 files changed
+916
-55
No files matched your search
@@ -104,6 +104,23 @@ export const useDeleteSession = (opcodeUrl: string | null | undefined, directory
|
||||
});
|
||||
};
|
||||
|
||||
export const useUpdateSession = (opcodeUrl: string | null | undefined, directory?: string) => {
|
||||
const queryClient = useQueryClient();
|
||||
const client = useOpenCodeClient(opcodeUrl, directory);
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ sessionID, title }: { sessionID: string; title: string }) => {
|
||||
if (!client) throw new Error("No client available");
|
||||
return client.updateSession(sessionID, { title });
|
||||
},
|
||||
onSuccess: (_, variables) => {
|
||||
const { sessionID } = variables;
|
||||
queryClient.invalidateQueries({ queryKey: ["opencode", "session", opcodeUrl, sessionID, directory] });
|
||||
queryClient.invalidateQueries({ queryKey: ["opencode", "sessions", opcodeUrl, directory] });
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const createOptimisticUserMessage = (
|
||||
sessionID: string,
|
||||
parts: ContentPart[],
|
||||
|
||||
Reference in new issue
Block a user