mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Add cron-based scheduling with prompt templates integration (#164)
This commit is contained in:
1 parent
cbd0ee2958
commit
1e863c5fc5
63 files changed
+7797
-64
No files matched your search
@@ -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,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user