Add cron-based scheduling with prompt templates integration (#164)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-03-21 23:33:03 -04:00
1 parent cbd0ee2958
commit 1e863c5fc5
63 files changed
+7797 -64

No files matched your search

+13
View File
@@ -1,5 +1,7 @@
import type { paths } from './opencode-types'
import { fetchWrapper } from './fetchWrapper'
import { useQuery } from '@tanstack/react-query'
import { OPENCODE_API_ENDPOINT } from '@/config'
type SessionListResponse = paths['/session']['get']['responses']['200']['content']['application/json']
type SessionResponse = paths['/session/{sessionID}']['get']['responses']['200']['content']['application/json']
@@ -248,3 +250,14 @@ export class OpenCodeClient {
export const createOpenCodeClient = (baseURL: string, directory?: string) => {
return new OpenCodeClient(baseURL, directory)
}
export const useAgents = () => {
return useQuery({
queryKey: ['opencode-agents'],
queryFn: async () => {
const client = createOpenCodeClient(OPENCODE_API_ENDPOINT)
return await client.listAgents()
},
staleTime: 5 * 60 * 1000,
})
}