diff --git a/apps/web/src/components/layout/AppShell.tsx b/apps/web/src/components/layout/AppShell.tsx index 8d86de3..a3e4162 100644 --- a/apps/web/src/components/layout/AppShell.tsx +++ b/apps/web/src/components/layout/AppShell.tsx @@ -450,7 +450,7 @@ function SidebarContent({ {!sidebarCollapsed && (

- CapaKraken + Nexus

Resource & Capacity Planning @@ -984,7 +984,7 @@ export function AppShell({ - CapaKraken + Nexus

{children} diff --git a/packages/api/src/__tests__/assistant-chat-response.test.ts b/packages/api/src/__tests__/assistant-chat-response.test.ts index e28ec77..b187210 100644 --- a/packages/api/src/__tests__/assistant-chat-response.test.ts +++ b/packages/api/src/__tests__/assistant-chat-response.test.ts @@ -7,12 +7,14 @@ vi.mock("../lib/audit.js", () => ({ vi.mock("../router/assistant-approvals.js", () => ({ clearPendingAssistantApproval: vi.fn().mockResolvedValue(undefined), consumePendingAssistantApproval: vi.fn(), - toApprovalPayload: vi.fn((approval: { id: string; toolName: string; summary: string }, status: string) => ({ - id: approval.id, - toolName: approval.toolName, - summary: approval.summary, - status, - })), + toApprovalPayload: vi.fn( + (approval: { id: string; toolName: string; summary: string }, status: string) => ({ + id: approval.id, + toolName: approval.toolName, + summary: approval.summary, + status, + }), + ), })); vi.mock("../router/assistant-confirmation.js", () => ({ @@ -39,16 +41,10 @@ import { clearPendingAssistantApproval, consumePendingAssistantApproval, } from "../router/assistant-approvals.js"; -import { - canExecuteMutationTool, - isCancellationReply, -} from "../router/assistant-confirmation.js"; +import { canExecuteMutationTool, isCancellationReply } from "../router/assistant-confirmation.js"; import { buildAssistantInsight } from "../router/assistant-insights.js"; import { handlePendingAssistantApproval } from "../router/assistant-chat-response.js"; -import { - readToolError, - readToolSuccessMessage, -} from "../router/assistant-tool-results.js"; +import { readToolError, readToolSuccessMessage } from "../router/assistant-tool-results.js"; import { executeTool } from "../router/assistant-tools.js"; function createPendingApproval() { @@ -57,14 +53,16 @@ function createPendingApproval() { userId: "user_1", conversationId: "conv_1", toolName: "create_project", - toolArguments: "{\"name\":\"Apollo\"}", + toolArguments: '{"name":"Apollo"}', summary: "create project (name=Apollo)", createdAt: Date.now(), expiresAt: Date.now() + 60_000, }; } -function createHandleInput(overrides: Partial[0]> = {}) { +function createHandleInput( + overrides: Partial[0]> = {}, +) { return { db: {} as never, dbUserId: "user_1", @@ -81,7 +79,10 @@ function createHandleInput(overrides: Partial { it("cancels pending approvals when the user aborts", async () => { vi.mocked(isCancellationReply).mockReturnValue(true); - const result = await handlePendingAssistantApproval(createHandleInput({ - lastUserMessage: { role: "user", content: "nein, abbrechen" }, - })); + const result = await handlePendingAssistantApproval( + createHandleInput({ + lastUserMessage: { role: "user", content: "nein, abbrechen" }, + }), + ); expect(result).toMatchObject({ response: { @@ -127,7 +130,7 @@ describe("assistant pending approval handling", () => { summary: "create project (name=Apollo, status=DRAFT)", } as never); vi.mocked(executeTool).mockResolvedValue({ - content: "{\"message\":\"Projekt Apollo angelegt\"}", + content: '{"message":"Projekt Apollo angelegt"}', data: { message: "Projekt Apollo angelegt" }, action: { type: "refresh" }, } as never); @@ -148,29 +151,35 @@ describe("assistant pending approval handling", () => { status: "approved", }, actions: [{ type: "refresh" }], - insights: [{ - kind: "holiday_region", - title: "Berlin", - }], + insights: [ + { + kind: "holiday_region", + title: "Berlin", + }, + ], }, }); expect(executeTool).toHaveBeenCalledWith( "create_project", - "{\"name\":\"Apollo\"}", + '{"name":"Apollo"}', expect.objectContaining({ userId: "user_1" }), ); - expect(createAuditEntry).toHaveBeenCalledWith(expect.objectContaining({ - entityName: "create_project", - summary: "AI executed previously approved tool: create_project", - })); + expect(createAuditEntry).toHaveBeenCalledWith( + expect.objectContaining({ + entityName: "create_project", + summary: "AI executed previously approved tool: create_project", + }), + ); }); it("does nothing when the user reply is not a valid confirmation", async () => { vi.mocked(canExecuteMutationTool).mockReturnValue(false); - const result = await handlePendingAssistantApproval(createHandleInput({ - lastUserMessage: { role: "user", content: "vielleicht" }, - })); + const result = await handlePendingAssistantApproval( + createHandleInput({ + lastUserMessage: { role: "user", content: "vielleicht" }, + }), + ); expect(result).toBeNull(); expect(consumePendingAssistantApproval).not.toHaveBeenCalled(); diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index 929b41e..3818c66 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -1,4 +1,4 @@ -// CapaKraken — Prisma Schema +// Nexus — Prisma Schema // All monetary values stored as integer cents to avoid float precision issues. generator client { diff --git a/restart.sh b/restart.sh index bdfa411..918e6dd 100755 --- a/restart.sh +++ b/restart.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# restart.sh — Rebuild the CapaKraken app container from scratch. +# restart.sh — Rebuild the Nexus app container from scratch. # # When to use: # - After changing pnpm-lock.yaml (new/removed dependencies) diff --git a/scripts/restart.sh b/scripts/restart.sh index 6145129..510712c 100755 --- a/scripts/restart.sh +++ b/scripts/restart.sh @@ -2,7 +2,7 @@ set -euo pipefail cd "$(dirname "$0")/.." -echo "Restarting CapaKraken..." +echo "Restarting Nexus..." echo "" # Stop diff --git a/scripts/start.sh b/scripts/start.sh index 03d66af..83ca478 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -5,7 +5,7 @@ cd "$(dirname "$0")/.." APP_PORT="${APP_PORT:-3100}" APP_CONTAINER="${APP_CONTAINER:-$(docker compose --profile full ps -q app 2>/dev/null | head -1)}" -echo "Starting CapaKraken..." +echo "Starting Nexus..." # 1. Start Docker services echo " Starting PostgreSQL + Redis..." @@ -34,7 +34,7 @@ echo " Waiting for server (up to 90s)..." for i in {1..90}; do if curl -sf "http://localhost:${APP_PORT}/api/health" > /dev/null 2>&1; then echo "" - echo "CapaKraken is running!" + echo "Nexus is running!" curl -s "http://localhost:${APP_PORT}/api/ready" | python3 -m json.tool 2>/dev/null || curl -s "http://localhost:${APP_PORT}/api/ready" echo "" echo " URL: http://localhost:${APP_PORT}" diff --git a/scripts/stop.sh b/scripts/stop.sh index 1994090..33de780 100755 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -2,7 +2,7 @@ set -euo pipefail cd "$(dirname "$0")/.." -echo "Stopping CapaKraken..." +echo "Stopping Nexus..." # 1. Stop any legacy local dev server if [ -f /tmp/nexus-dev.pid ]; then @@ -28,4 +28,4 @@ echo " Stopping app, PostgreSQL and Redis..." docker compose --profile full stop app postgres redis 2>/dev/null || true echo "" -echo "CapaKraken stopped." +echo "Nexus stopped."