summaryrefslogtreecommitdiff
path: root/frontend/src/services/directiveApi.ts
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-04-28 17:35:08 +0100
committerGitHub <noreply@github.com>2026-04-28 17:35:08 +0100
commitd513f93c84ae985738e0f696fcb72fa1153046ef (patch)
treed169fa48ce93f1e204a80b60ca9295772bc2fa63 /frontend/src/services/directiveApi.ts
parent5aa3fafb4acfa89c7d04e84abf7861607733e8ce (diff)
downloadsoryu-d513f93c84ae985738e0f696fcb72fa1153046ef.tar.gz
soryu-d513f93c84ae985738e0f696fcb72fa1153046ef.zip
feat: document UI with contract blocks, expandable logs, and interaction controls (#97)
* feat: soryu-co/soryu - makima: Rename tasks to contracts in directive API and types * feat: soryu-co/soryu - makima: Add contract interaction panel with comment and interrupt * feat: soryu-co/soryu - makima: Build expandable contract log feed in StepsDiagram * feat: soryu-co/soryu - makima: Rename tasks to contracts throughout document UI and add contract block support * feat: soryu-co/soryu - makima: Add comment and interrupt controls to expanded step log feed * feat: soryu-co/soryu - makima: Audit and fix Document UI feature flag visibility and missing implementations * feat: soryu-co/soryu - makima: Add expandable step rows with live log feed in StepsDiagram * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Integrate all document UI components and final polish
Diffstat (limited to 'frontend/src/services/directiveApi.ts')
-rw-r--r--frontend/src/services/directiveApi.ts34
1 files changed, 31 insertions, 3 deletions
diff --git a/frontend/src/services/directiveApi.ts b/frontend/src/services/directiveApi.ts
index b82f594..4d1fd82 100644
--- a/frontend/src/services/directiveApi.ts
+++ b/frontend/src/services/directiveApi.ts
@@ -35,8 +35,9 @@ export interface DirectiveStep {
taskPlan: string
dependsOn: string[]
status: string
- taskId: string
contractId: string
+ /** @deprecated Use contractId instead */
+ taskId: string
orderIndex: number
sort_order?: number
completedAt: string
@@ -124,13 +125,40 @@ export async function pauseDirective(id: string): Promise<DirectiveWithSteps> {
}
export async function getUserSetting(key: string): Promise<any> {
- const response = await apiFetch(`/api/v1/settings/${key}`)
+ const response = await apiFetch(`/api/v1/user-settings/${key}`)
return response.json()
}
export async function upsertUserSetting(key: string, value: any): Promise<void> {
- await apiFetch('/api/v1/settings', {
+ await apiFetch('/api/v1/user-settings', {
method: 'PUT',
body: JSON.stringify({ key, value }),
})
}
+
+// ---- Task control APIs ----
+
+export async function sendTaskMessage(taskId: string, message: string): Promise<void> {
+ await apiFetch(`/api/v1/mesh/tasks/${taskId}/message`, {
+ method: 'POST',
+ body: JSON.stringify({ message }),
+ })
+}
+
+export async function stopTask(taskId: string): Promise<void> {
+ await apiFetch(`/api/v1/mesh/tasks/${taskId}/stop`, {
+ method: 'POST',
+ })
+}
+
+export async function continueTask(taskId: string): Promise<void> {
+ await apiFetch(`/api/v1/mesh/tasks/${taskId}/continue`, {
+ method: 'POST',
+ })
+}
+
+export async function startTask(taskId: string): Promise<void> {
+ await apiFetch(`/api/v1/mesh/tasks/${taskId}/start`, {
+ method: 'POST',
+ })
+}