Merge pull request 'rename(cleanup): drop last capakraken strings from UI, scripts, schema, tests' (#64) from rename/nexus-final-cleanup into main
CI / Architecture Guardrails (push) Successful in 4m52s
CI / Typecheck (push) Successful in 5m53s
CI / Assistant Split Regression (push) Successful in 9m3s
CI / Lint (push) Successful in 9m39s
CI / Unit Tests (push) Successful in 12m5s
CI / Build (push) Successful in 9m53s
CI / Fresh-Linux Docker Deploy (push) Failing after 8m54s
CI / E2E Tests (push) Successful in 12m55s
CI / Release Images (push) Has been skipped
CI / Architecture Guardrails (push) Successful in 4m52s
CI / Typecheck (push) Successful in 5m53s
CI / Assistant Split Regression (push) Successful in 9m3s
CI / Lint (push) Successful in 9m39s
CI / Unit Tests (push) Successful in 12m5s
CI / Build (push) Successful in 9m53s
CI / Fresh-Linux Docker Deploy (push) Failing after 8m54s
CI / E2E Tests (push) Successful in 12m55s
CI / Release Images (push) Has been skipped
rename(cleanup): drop last capakraken strings from UI, scripts, schema, tests
This commit was merged in pull request #64.
This commit is contained in:
@@ -450,7 +450,7 @@ function SidebarContent({
|
|||||||
{!sidebarCollapsed && (
|
{!sidebarCollapsed && (
|
||||||
<div className="overflow-hidden">
|
<div className="overflow-hidden">
|
||||||
<h1 className="font-display text-xl font-semibold text-gray-900 dark:text-gray-50">
|
<h1 className="font-display text-xl font-semibold text-gray-900 dark:text-gray-50">
|
||||||
Capa<span className="text-brand-600">Kraken</span>
|
Nex<span className="text-brand-600">us</span>
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-xs uppercase tracking-[0.18em] text-gray-500 dark:text-gray-400">
|
<p className="text-xs uppercase tracking-[0.18em] text-gray-500 dark:text-gray-400">
|
||||||
Resource & Capacity Planning
|
Resource & Capacity Planning
|
||||||
@@ -984,7 +984,7 @@ export function AppShell({
|
|||||||
<HamburgerIcon />
|
<HamburgerIcon />
|
||||||
</button>
|
</button>
|
||||||
<span className="ml-3 font-display text-sm font-semibold text-gray-900 dark:text-gray-50">
|
<span className="ml-3 font-display text-sm font-semibold text-gray-900 dark:text-gray-50">
|
||||||
Capa<span className="text-brand-600">Kraken</span>
|
Nex<span className="text-brand-600">us</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<PageTransition>{children}</PageTransition>
|
<PageTransition>{children}</PageTransition>
|
||||||
|
|||||||
@@ -7,12 +7,14 @@ vi.mock("../lib/audit.js", () => ({
|
|||||||
vi.mock("../router/assistant-approvals.js", () => ({
|
vi.mock("../router/assistant-approvals.js", () => ({
|
||||||
clearPendingAssistantApproval: vi.fn().mockResolvedValue(undefined),
|
clearPendingAssistantApproval: vi.fn().mockResolvedValue(undefined),
|
||||||
consumePendingAssistantApproval: vi.fn(),
|
consumePendingAssistantApproval: vi.fn(),
|
||||||
toApprovalPayload: vi.fn((approval: { id: string; toolName: string; summary: string }, status: string) => ({
|
toApprovalPayload: vi.fn(
|
||||||
|
(approval: { id: string; toolName: string; summary: string }, status: string) => ({
|
||||||
id: approval.id,
|
id: approval.id,
|
||||||
toolName: approval.toolName,
|
toolName: approval.toolName,
|
||||||
summary: approval.summary,
|
summary: approval.summary,
|
||||||
status,
|
status,
|
||||||
})),
|
}),
|
||||||
|
),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("../router/assistant-confirmation.js", () => ({
|
vi.mock("../router/assistant-confirmation.js", () => ({
|
||||||
@@ -39,16 +41,10 @@ import {
|
|||||||
clearPendingAssistantApproval,
|
clearPendingAssistantApproval,
|
||||||
consumePendingAssistantApproval,
|
consumePendingAssistantApproval,
|
||||||
} from "../router/assistant-approvals.js";
|
} from "../router/assistant-approvals.js";
|
||||||
import {
|
import { canExecuteMutationTool, isCancellationReply } from "../router/assistant-confirmation.js";
|
||||||
canExecuteMutationTool,
|
|
||||||
isCancellationReply,
|
|
||||||
} from "../router/assistant-confirmation.js";
|
|
||||||
import { buildAssistantInsight } from "../router/assistant-insights.js";
|
import { buildAssistantInsight } from "../router/assistant-insights.js";
|
||||||
import { handlePendingAssistantApproval } from "../router/assistant-chat-response.js";
|
import { handlePendingAssistantApproval } from "../router/assistant-chat-response.js";
|
||||||
import {
|
import { readToolError, readToolSuccessMessage } from "../router/assistant-tool-results.js";
|
||||||
readToolError,
|
|
||||||
readToolSuccessMessage,
|
|
||||||
} from "../router/assistant-tool-results.js";
|
|
||||||
import { executeTool } from "../router/assistant-tools.js";
|
import { executeTool } from "../router/assistant-tools.js";
|
||||||
|
|
||||||
function createPendingApproval() {
|
function createPendingApproval() {
|
||||||
@@ -57,14 +53,16 @@ function createPendingApproval() {
|
|||||||
userId: "user_1",
|
userId: "user_1",
|
||||||
conversationId: "conv_1",
|
conversationId: "conv_1",
|
||||||
toolName: "create_project",
|
toolName: "create_project",
|
||||||
toolArguments: "{\"name\":\"Apollo\"}",
|
toolArguments: '{"name":"Apollo"}',
|
||||||
summary: "create project (name=Apollo)",
|
summary: "create project (name=Apollo)",
|
||||||
createdAt: Date.now(),
|
createdAt: Date.now(),
|
||||||
expiresAt: Date.now() + 60_000,
|
expiresAt: Date.now() + 60_000,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function createHandleInput(overrides: Partial<Parameters<typeof handlePendingAssistantApproval>[0]> = {}) {
|
function createHandleInput(
|
||||||
|
overrides: Partial<Parameters<typeof handlePendingAssistantApproval>[0]> = {},
|
||||||
|
) {
|
||||||
return {
|
return {
|
||||||
db: {} as never,
|
db: {} as never,
|
||||||
dbUserId: "user_1",
|
dbUserId: "user_1",
|
||||||
@@ -81,7 +79,10 @@ function createHandleInput(overrides: Partial<Parameters<typeof handlePendingAss
|
|||||||
pendingApproval: createPendingApproval(),
|
pendingApproval: createPendingApproval(),
|
||||||
lastUserMessage: { role: "user" as const, content: "ja" },
|
lastUserMessage: { role: "user" as const, content: "ja" },
|
||||||
messages: [
|
messages: [
|
||||||
{ role: "assistant" as const, content: "__CAPAKRAKEN_CONFIRM__ create project (name=Apollo). Bitte bestätigen." },
|
{
|
||||||
|
role: "assistant" as const,
|
||||||
|
content: "__NEXUS_CONFIRM__ create project (name=Apollo). Bitte bestätigen.",
|
||||||
|
},
|
||||||
{ role: "user" as const, content: "ja" },
|
{ role: "user" as const, content: "ja" },
|
||||||
],
|
],
|
||||||
collectedActions: [],
|
collectedActions: [],
|
||||||
@@ -103,9 +104,11 @@ describe("assistant pending approval handling", () => {
|
|||||||
it("cancels pending approvals when the user aborts", async () => {
|
it("cancels pending approvals when the user aborts", async () => {
|
||||||
vi.mocked(isCancellationReply).mockReturnValue(true);
|
vi.mocked(isCancellationReply).mockReturnValue(true);
|
||||||
|
|
||||||
const result = await handlePendingAssistantApproval(createHandleInput({
|
const result = await handlePendingAssistantApproval(
|
||||||
|
createHandleInput({
|
||||||
lastUserMessage: { role: "user", content: "nein, abbrechen" },
|
lastUserMessage: { role: "user", content: "nein, abbrechen" },
|
||||||
}));
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
expect(result).toMatchObject({
|
expect(result).toMatchObject({
|
||||||
response: {
|
response: {
|
||||||
@@ -127,7 +130,7 @@ describe("assistant pending approval handling", () => {
|
|||||||
summary: "create project (name=Apollo, status=DRAFT)",
|
summary: "create project (name=Apollo, status=DRAFT)",
|
||||||
} as never);
|
} as never);
|
||||||
vi.mocked(executeTool).mockResolvedValue({
|
vi.mocked(executeTool).mockResolvedValue({
|
||||||
content: "{\"message\":\"Projekt Apollo angelegt\"}",
|
content: '{"message":"Projekt Apollo angelegt"}',
|
||||||
data: { message: "Projekt Apollo angelegt" },
|
data: { message: "Projekt Apollo angelegt" },
|
||||||
action: { type: "refresh" },
|
action: { type: "refresh" },
|
||||||
} as never);
|
} as never);
|
||||||
@@ -148,29 +151,35 @@ describe("assistant pending approval handling", () => {
|
|||||||
status: "approved",
|
status: "approved",
|
||||||
},
|
},
|
||||||
actions: [{ type: "refresh" }],
|
actions: [{ type: "refresh" }],
|
||||||
insights: [{
|
insights: [
|
||||||
|
{
|
||||||
kind: "holiday_region",
|
kind: "holiday_region",
|
||||||
title: "Berlin",
|
title: "Berlin",
|
||||||
}],
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
expect(executeTool).toHaveBeenCalledWith(
|
expect(executeTool).toHaveBeenCalledWith(
|
||||||
"create_project",
|
"create_project",
|
||||||
"{\"name\":\"Apollo\"}",
|
'{"name":"Apollo"}',
|
||||||
expect.objectContaining({ userId: "user_1" }),
|
expect.objectContaining({ userId: "user_1" }),
|
||||||
);
|
);
|
||||||
expect(createAuditEntry).toHaveBeenCalledWith(expect.objectContaining({
|
expect(createAuditEntry).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
entityName: "create_project",
|
entityName: "create_project",
|
||||||
summary: "AI executed previously approved tool: create_project",
|
summary: "AI executed previously approved tool: create_project",
|
||||||
}));
|
}),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does nothing when the user reply is not a valid confirmation", async () => {
|
it("does nothing when the user reply is not a valid confirmation", async () => {
|
||||||
vi.mocked(canExecuteMutationTool).mockReturnValue(false);
|
vi.mocked(canExecuteMutationTool).mockReturnValue(false);
|
||||||
|
|
||||||
const result = await handlePendingAssistantApproval(createHandleInput({
|
const result = await handlePendingAssistantApproval(
|
||||||
|
createHandleInput({
|
||||||
lastUserMessage: { role: "user", content: "vielleicht" },
|
lastUserMessage: { role: "user", content: "vielleicht" },
|
||||||
}));
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
expect(result).toBeNull();
|
expect(result).toBeNull();
|
||||||
expect(consumePendingAssistantApproval).not.toHaveBeenCalled();
|
expect(consumePendingAssistantApproval).not.toHaveBeenCalled();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// CapaKraken — Prisma Schema
|
// Nexus — Prisma Schema
|
||||||
// All monetary values stored as integer cents to avoid float precision issues.
|
// All monetary values stored as integer cents to avoid float precision issues.
|
||||||
|
|
||||||
generator client {
|
generator client {
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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:
|
# When to use:
|
||||||
# - After changing pnpm-lock.yaml (new/removed dependencies)
|
# - After changing pnpm-lock.yaml (new/removed dependencies)
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
echo "Restarting CapaKraken..."
|
echo "Restarting Nexus..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Stop
|
# Stop
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@ cd "$(dirname "$0")/.."
|
|||||||
APP_PORT="${APP_PORT:-3100}"
|
APP_PORT="${APP_PORT:-3100}"
|
||||||
APP_CONTAINER="${APP_CONTAINER:-$(docker compose --profile full ps -q app 2>/dev/null | head -1)}"
|
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
|
# 1. Start Docker services
|
||||||
echo " Starting PostgreSQL + Redis..."
|
echo " Starting PostgreSQL + Redis..."
|
||||||
@@ -34,7 +34,7 @@ echo " Waiting for server (up to 90s)..."
|
|||||||
for i in {1..90}; do
|
for i in {1..90}; do
|
||||||
if curl -sf "http://localhost:${APP_PORT}/api/health" > /dev/null 2>&1; then
|
if curl -sf "http://localhost:${APP_PORT}/api/health" > /dev/null 2>&1; then
|
||||||
echo ""
|
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"
|
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 ""
|
||||||
echo " URL: http://localhost:${APP_PORT}"
|
echo " URL: http://localhost:${APP_PORT}"
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
echo "Stopping CapaKraken..."
|
echo "Stopping Nexus..."
|
||||||
|
|
||||||
# 1. Stop any legacy local dev server
|
# 1. Stop any legacy local dev server
|
||||||
if [ -f /tmp/nexus-dev.pid ]; then
|
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
|
docker compose --profile full stop app postgres redis 2>/dev/null || true
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "CapaKraken stopped."
|
echo "Nexus stopped."
|
||||||
|
|||||||
Reference in New Issue
Block a user