diff --git a/biome.json b/biome.json index 61030ca..34776b4 100644 --- a/biome.json +++ b/biome.json @@ -1,7 +1,7 @@ { "$schema": "https://biomejs.dev/schemas/2.4.14/schema.json", "files": { - "includes": ["**", "!**/dist", "!**/node_modules"] + "includes": ["**", "!**/dist", "!**/node_modules", "!packages/workflow/workflow"] }, "assist": { "actions": { "source": { "organizeImports": "on" } } }, "formatter": { diff --git a/packages/cli-workflow/src/commands/serve/routes-live.ts b/packages/cli-workflow/src/commands/serve/routes-live.ts index 8301ea3..c28dd1c 100644 --- a/packages/cli-workflow/src/commands/serve/routes-live.ts +++ b/packages/cli-workflow/src/commands/serve/routes-live.ts @@ -60,8 +60,9 @@ export function createLiveRoutes(storageRoot: string): Hono { if (dataPath === null) { return c.json({ error: `thread not found: ${threadId}` }, 404); } + const resolvedDataPath = dataPath; - const infoPath = join(dirname(dataPath), `${threadId}.info.jsonl`); + const infoPath = join(dirname(resolvedDataPath), `${threadId}.info.jsonl`); return streamSSE(c, async (stream) => { const dataState: PumpState = { contentOffset: 0, carry: "" }; @@ -71,7 +72,7 @@ export function createLiveRoutes(storageRoot: string): Hono { async function pumpData(): Promise { let text: string; try { - text = await readFile(dataPath, "utf8"); + text = await readFile(resolvedDataPath, "utf8"); } catch { return false; } @@ -131,7 +132,7 @@ export function createLiveRoutes(storageRoot: string): Hono { const controller = new AbortController(); let completed = false; - const dataWatcher = watch(dataPath, async () => { + const dataWatcher = watch(resolvedDataPath, async () => { if (completed) return; const finished = await pumpData(); if (finished) { diff --git a/packages/dashboard/src/api.ts b/packages/dashboard/src/api.ts index 6bf0410..4afe307 100644 --- a/packages/dashboard/src/api.ts +++ b/packages/dashboard/src/api.ts @@ -7,7 +7,7 @@ async function postJson(path: string, body: unknown): Promise { body: JSON.stringify(body), }); if (!res.ok) { - const err = await res.json().catch(() => ({ error: res.statusText })) as { error: string }; + const err = (await res.json().catch(() => ({ error: res.statusText }))) as { error: string }; throw new Error(err.error || `API ${res.status}`); } return res.json() as Promise; @@ -59,7 +59,11 @@ export function getThread(id: string): Promise<{ records: ThreadRecord[] }> { return fetchJson(`/threads/${id}`); } -export function runThread(workflow: string, prompt: string, maxRounds: number = 10): Promise<{ threadId: string }> { +export function runThread( + workflow: string, + prompt: string, + maxRounds: number = 10, +): Promise<{ threadId: string }> { return postJson("/threads", { workflow, prompt, maxRounds }); } diff --git a/packages/dashboard/src/app.tsx b/packages/dashboard/src/app.tsx index 6cf9b9d..0d65b8c 100644 --- a/packages/dashboard/src/app.tsx +++ b/packages/dashboard/src/app.tsx @@ -1,10 +1,10 @@ import { useState } from "react"; -import { Sidebar } from "./components/sidebar.tsx"; -import { ThreadList } from "./components/thread-list.tsx"; -import { ThreadDetail } from "./components/thread-detail.tsx"; -import { WorkflowList } from "./components/workflow-list.tsx"; -import { StatusBar } from "./components/status-bar.tsx"; import { RunDialog } from "./components/run-dialog.tsx"; +import { Sidebar } from "./components/sidebar.tsx"; +import { StatusBar } from "./components/status-bar.tsx"; +import { ThreadDetail } from "./components/thread-detail.tsx"; +import { ThreadList } from "./components/thread-list.tsx"; +import { WorkflowList } from "./components/workflow-list.tsx"; type View = "threads" | "workflows"; @@ -19,9 +19,7 @@ export function App() {
setShowRun(true)} />
- {view === "threads" && !selectedThread && ( - - )} + {view === "threads" && !selectedThread && } {view === "threads" && selectedThread && ( setSelectedThread(null)} /> )} diff --git a/packages/dashboard/src/components/run-dialog.tsx b/packages/dashboard/src/components/run-dialog.tsx index d4362c3..84a79d5 100644 --- a/packages/dashboard/src/components/run-dialog.tsx +++ b/packages/dashboard/src/components/run-dialog.tsx @@ -41,10 +41,15 @@ export function RunDialog({ onClose, onCreated }: Props) {

Run Thread

-
-