diff --git a/backend/src/index.ts b/backend/src/index.ts index 2faf2b1..788a2a8 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -140,7 +140,7 @@ const app = new Elysia() .get("/health", () => ({ status: "ok", service: "hammer-queue" })) .onError(({ error, set }) => { - const msg = error?.message || String(error); + const msg = (error as any)?.message || String(error); if (msg === "Unauthorized") { set.status = 401; return { error: "Unauthorized" }; diff --git a/backend/src/lib/gateway-relay.ts b/backend/src/lib/gateway-relay.ts index f33765e..b161524 100644 --- a/backend/src/lib/gateway-relay.ts +++ b/backend/src/lib/gateway-relay.ts @@ -10,8 +10,8 @@ * (BetterAuth) (relay) (token auth) */ -const GATEWAY_URL = process.env.GATEWAY_WS_URL || process.env.VITE_WS_URL || "wss://hammer.donovankelly.xyz"; -const GATEWAY_TOKEN = process.env.GATEWAY_WS_TOKEN || process.env.VITE_WS_TOKEN || ""; +const GATEWAY_URL = process.env.GATEWAY_WS_URL || "wss://ws.hammer.donovankelly.xyz"; +const GATEWAY_TOKEN = process.env.GATEWAY_WS_TOKEN || ""; type GatewayState = "disconnected" | "connecting" | "connected"; type MessageHandler = (msg: any) => void; diff --git a/backend/src/routes/admin.ts b/backend/src/routes/admin.ts index 7c67bd9..a7f6498 100644 --- a/backend/src/routes/admin.ts +++ b/backend/src/routes/admin.ts @@ -19,7 +19,7 @@ async function requireAdmin(request: Request, headers: Record { - const msg = error?.message || String(error); + const msg = (error as any)?.message || String(error); if (msg === "Unauthorized") { set.status = 401; return { error: "Unauthorized" }; diff --git a/backend/src/routes/projects.ts b/backend/src/routes/projects.ts index 52dd4ef..4a8f7f2 100644 --- a/backend/src/routes/projects.ts +++ b/backend/src/routes/projects.ts @@ -21,7 +21,7 @@ async function requireSessionOrBearer( export const projectRoutes = new Elysia({ prefix: "/api/projects" }) .onError(({ error, set }) => { - const msg = error?.message || String(error); + const msg = (error as any)?.message || String(error); if (msg === "Unauthorized") { set.status = 401; return { error: "Unauthorized" }; diff --git a/backend/src/routes/tasks.ts b/backend/src/routes/tasks.ts index 3e2d28e..9fd9a8d 100644 --- a/backend/src/routes/tasks.ts +++ b/backend/src/routes/tasks.ts @@ -104,7 +104,7 @@ async function resolveTask(idOrNumber: string) { export const taskRoutes = new Elysia({ prefix: "/api/tasks" }) .onError(({ error, set }) => { - const msg = error?.message || String(error); + const msg = (error as any)?.message || String(error); if (msg === "Unauthorized") { set.status = 401; return { error: "Unauthorized" }; diff --git a/docker-compose.dokploy.yml b/docker-compose.dokploy.yml index a44fef4..3dee91a 100644 --- a/docker-compose.dokploy.yml +++ b/docker-compose.dokploy.yml @@ -25,7 +25,7 @@ services: COOKIE_DOMAIN: .donovankelly.xyz CLAWDBOT_HOOK_URL: ${CLAWDBOT_HOOK_URL:-https://hammer.donovankelly.xyz/hooks/agent} CLAWDBOT_HOOK_TOKEN: ${CLAWDBOT_HOOK_TOKEN} - GATEWAY_WS_URL: ${VITE_WS_URL:-wss://hammer.donovankelly.xyz} + GATEWAY_WS_URL: ${GATEWAY_WS_URL:-wss://ws.hammer.donovankelly.xyz} GATEWAY_WS_TOKEN: ${GATEWAY_WS_TOKEN} PORT: "3100" depends_on: diff --git a/frontend/src/pages/ChatPage.tsx b/frontend/src/pages/ChatPage.tsx index 0720317..628c671 100644 --- a/frontend/src/pages/ChatPage.tsx +++ b/frontend/src/pages/ChatPage.tsx @@ -21,6 +21,7 @@ function ThreadList({ activeThread, onSelect, onCreate, + onRename, onDelete, onClose, }: { @@ -28,9 +29,25 @@ function ThreadList({ activeThread: string | null; onSelect: (key: string) => void; onCreate: () => void; + onRename?: (key: string, name: string) => void; onDelete?: (key: string) => void; onClose?: () => void; }) { + const [editingKey, setEditingKey] = useState(null); + const [editName, setEditName] = useState(""); + + const startRename = (key: string, currentName: string) => { + setEditingKey(key); + setEditName(currentName); + }; + + const commitRename = () => { + if (editingKey && editName.trim() && onRename) { + onRename(editingKey, editName.trim()); + } + setEditingKey(null); + }; + return (
@@ -71,15 +88,36 @@ function ThreadList({ }`} onClick={() => onSelect(thread.sessionKey)} > -
- {thread.name} -
+ {editingKey === thread.sessionKey ? ( + setEditName(e.target.value)} + onBlur={commitRename} + onKeyDown={(e) => { + if (e.key === "Enter") commitRename(); + if (e.key === "Escape") setEditingKey(null); + }} + onClick={(e) => e.stopPropagation()} + /> + ) : ( +
{ + e.stopPropagation(); + startRename(thread.sessionKey, thread.name); + }} + > + {thread.name} +
+ )} {thread.lastMessage && (
{thread.lastMessage}
)} - {onDelete && ( + {onDelete && editingKey !== thread.sessionKey && (