summaryrefslogtreecommitdiff
path: root/frontend/src/services/directiveApi.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/services/directiveApi.ts')
-rw-r--r--frontend/src/services/directiveApi.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/frontend/src/services/directiveApi.ts b/frontend/src/services/directiveApi.ts
index 4d1fd82..fcb6636 100644
--- a/frontend/src/services/directiveApi.ts
+++ b/frontend/src/services/directiveApi.ts
@@ -162,3 +162,24 @@ export async function startTask(taskId: string): Promise<void> {
method: 'POST',
})
}
+
+// ---- Contract interaction APIs ----
+
+export async function sendContractMessage(taskId: string, message: string): Promise<void> {
+ await apiFetch(`/api/v1/mesh/tasks/${taskId}/message`, {
+ method: 'POST',
+ body: JSON.stringify({ message }),
+ })
+}
+
+export async function interruptContract(taskId: string): Promise<void> {
+ await apiFetch(`/api/v1/mesh/tasks/${taskId}/message`, {
+ method: 'POST',
+ body: JSON.stringify({ message: '/interrupt' }),
+ })
+}
+
+export async function getContractOutput(taskId: string): Promise<{ output: string }> {
+ const response = await apiFetch(`/api/v1/mesh/tasks/${taskId}/output`)
+ return response.json()
+}