diff --git a/orchestrator/src/client/api/client.ts b/orchestrator/src/client/api/client.ts index 049042e..7597775 100644 --- a/orchestrator/src/client/api/client.ts +++ b/orchestrator/src/client/api/client.ts @@ -472,23 +472,6 @@ export async function listJobChatThreads(jobId: string): Promise<{ return fetchApi<{ threads: JobChatThread[] }>(`/jobs/${jobId}/chat/threads`); } -export async function listJobGhostwriterMessages( - jobId: string, - options?: { limit?: number; offset?: number }, -): Promise<{ messages: JobChatMessage[] }> { - const params = new URLSearchParams(); - if (typeof options?.limit === "number") { - params.set("limit", String(options.limit)); - } - if (typeof options?.offset === "number") { - params.set("offset", String(options.offset)); - } - const query = params.toString(); - return fetchApi<{ messages: JobChatMessage[] }>( - `/jobs/${jobId}/chat/messages${query ? `?${query}` : ""}`, - ); -} - export async function createJobChatThread( jobId: string, input?: { title?: string | null }, @@ -556,23 +539,6 @@ export async function streamJobChatMessage( ); } -export async function streamJobGhostwriterMessage( - jobId: string, - input: { content: string; signal?: AbortSignal }, - handlers: { - onEvent: (event: JobChatStreamEvent) => void; - }, -): Promise { - return streamSseEvents( - `/jobs/${jobId}/chat/messages`, - { content: input.content, stream: true }, - { - onEvent: handlers.onEvent, - signal: input.signal, - }, - ); -} - export async function cancelJobChatRun( jobId: string, threadId: string, @@ -587,19 +553,6 @@ export async function cancelJobChatRun( ); } -export async function cancelJobGhostwriterRun( - jobId: string, - runId: string, -): Promise<{ cancelled: boolean; alreadyFinished: boolean }> { - return fetchApi<{ cancelled: boolean; alreadyFinished: boolean }>( - `/jobs/${jobId}/chat/runs/${runId}/cancel`, - { - method: "POST", - body: JSON.stringify({}), - }, - ); -} - export async function regenerateJobChatMessage( jobId: string, threadId: string, @@ -633,24 +586,6 @@ export async function streamRegenerateJobChatMessage( ); } -export async function streamRegenerateJobGhostwriterMessage( - jobId: string, - assistantMessageId: string, - input: { signal?: AbortSignal }, - handlers: { - onEvent: (event: JobChatStreamEvent) => void; - }, -): Promise { - return streamSseEvents( - `/jobs/${jobId}/chat/messages/${assistantMessageId}/regenerate`, - { stream: true }, - { - onEvent: handlers.onEvent, - signal: input.signal, - }, - ); -} - export async function processJob( id: string, options?: { force?: boolean }, diff --git a/orchestrator/src/client/components/job-chat/Composer.tsx b/orchestrator/src/client/components/job-chat/Composer.tsx new file mode 100644 index 0000000..167744d --- /dev/null +++ b/orchestrator/src/client/components/job-chat/Composer.tsx @@ -0,0 +1,52 @@ +import { Send } from "lucide-react"; +import type React from "react"; +import { useState } from "react"; +import { Button } from "@/components/ui/button"; +import { Textarea } from "@/components/ui/textarea"; + +type ComposerProps = { + disabled?: boolean; + onSend: (content: string) => Promise; +}; + +export const Composer: React.FC = ({ disabled, onSend }) => { + const [value, setValue] = useState(""); + + const submit = async () => { + const content = value.trim(); + if (!content || disabled) return; + setValue(""); + await onSend(content); + }; + + return ( +
+