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

+33
View File
@@ -0,0 +1,33 @@
import { fetchWrapper, fetchWrapperVoid } from './fetchWrapper'
import { API_BASE_URL } from '@/config'
import type {
PromptTemplate,
CreatePromptTemplateRequest,
UpdatePromptTemplateRequest,
} from '@opencode-manager/shared/types'
export async function listPromptTemplates(): Promise<{ templates: PromptTemplate[] }> {
return fetchWrapper(`${API_BASE_URL}/api/prompt-templates`)
}
export async function createPromptTemplate(data: CreatePromptTemplateRequest): Promise<{ template: PromptTemplate }> {
return fetchWrapper(`${API_BASE_URL}/api/prompt-templates`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
})
}
export async function updatePromptTemplate(id: number, data: UpdatePromptTemplateRequest): Promise<{ template: PromptTemplate }> {
return fetchWrapper(`${API_BASE_URL}/api/prompt-templates/${id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
})
}
export async function deletePromptTemplate(id: number): Promise<void> {
return fetchWrapperVoid(`${API_BASE_URL}/api/prompt-templates/${id}`, {
method: 'DELETE',
})
}