feat: add assistant mode, SSE streaming, and OpenCode server integration (#214)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-05-02 21:51:37 -04:00
1 parent 3cc24288a6
commit c3d6549f01
133 files changed
+7284 -6293

No files matched your search

@@ -0,0 +1,33 @@
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import { getOpenCodeServerAuth, updateOpenCodeServerAuth } from '@/api/settings'
import type { OpenCodeServerAuthStatus as OpenCodeServerAuthStatusType } from '@/api/settings'
export function useOpenCodeServerAuth() {
const queryClient = useQueryClient()
const query = useQuery({
queryKey: ['settings', 'opencode-server-auth'],
queryFn: getOpenCodeServerAuth,
})
const setPassword = useMutation({
mutationFn: (password: string) => updateOpenCodeServerAuth(password),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['settings', 'opencode-server-auth'] })
},
})
const clearPassword = useMutation({
mutationFn: () => updateOpenCodeServerAuth(null),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['settings', 'opencode-server-auth'] })
},
})
return {
status: query.data as OpenCodeServerAuthStatusType | undefined,
isLoading: query.isLoading,
setPassword,
clearPassword,
}
}