Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9817d96
feat(ui): connect Lighthouse v2 to Cloud backend
alejandrobailo Jun 24, 2026
c8a802c
docs(ui): add Lighthouse v2 changelog
alejandrobailo Jun 24, 2026
c80dd98
fix(ui): make Lighthouse chat mode global
alejandrobailo Jun 24, 2026
14edac2
feat(ui): improve Lighthouse v2 configuration
alejandrobailo Jun 25, 2026
5087206
fix(ui): simplify Lighthouse chat composer
alejandrobailo Jun 25, 2026
15da838
fix(ui): reset Lighthouse chat from sidebar
alejandrobailo Jun 25, 2026
81a8e3b
refactor(ui): move lighthouse settings routes
alejandrobailo Jun 25, 2026
7cb192f
refactor(ui): simplify lighthouse settings panel
alejandrobailo Jun 25, 2026
bb7eb06
fix(ui): tune lighthouse chat layout
alejandrobailo Jun 25, 2026
f98efd0
fix(ui): improve lighthouse session history
alejandrobailo Jun 25, 2026
6eeadbb
docs(ui): remove lighthouse changelog entry
alejandrobailo Jun 25, 2026
2cb2a13
fix(ui): confirm before archiving Lighthouse chats
alejandrobailo Jun 25, 2026
b314712
refactor(ui): co-locate lighthouse v2 under its route domain
alejandrobailo Jun 25, 2026
23b8b6a
fix(ui): repair lighthouse v2 chat streaming via same-origin SSE proxy
alejandrobailo Jun 25, 2026
cc1dd9b
feat(ui): polish lighthouse v2 chat messages
alejandrobailo Jun 25, 2026
bf622f8
refactor(ui): extract shared markdown placeholder escaping
alejandrobailo Jun 25, 2026
a54f16f
refactor(ui): componentize Lighthouse v2 chat and config pages
alejandrobailo Jun 25, 2026
f518fcd
test(ui): remove brittle source-string Lighthouse tests
alejandrobailo Jun 25, 2026
5323b34
refactor(ui): streamline Lighthouse config and poll connection test
alejandrobailo Jun 25, 2026
e62fe59
feat(ui): render Lighthouse tool calls as collapsible chain of thought
alejandrobailo Jun 26, 2026
4818788
feat(ui): use Lighthouse icon and "Home" label in sidebar nav toggle
alejandrobailo Jun 26, 2026
11b1646
chore(ui): rebrand user-facing "Lighthouse" copy to "Lighthouse AI"
alejandrobailo Jun 26, 2026
ccc3c0a
fix(ui): align sidebar Scan button with main content top
alejandrobailo Jun 26, 2026
6f3928d
feat(ui): redesign lighthouse chat composer input
alejandrobailo Jun 26, 2026
805e8af
feat(ui): animate lighthouse empty-state headings with decrypted text
alejandrobailo Jun 26, 2026
de48ae7
feat(ui): reset open lighthouse chat from sidebar new-chat
alejandrobailo Jun 26, 2026
8673680
feat(ui): restyle sidebar nav toggle and match scan button width
alejandrobailo Jun 26, 2026
3b9ebf3
test(ui): update launch scan button width assertion to w-full
alejandrobailo Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { apiBaseUrl, getAuthHeaders } from "@/lib/helper";
import {
validateBaseUrl,
validateCredentials,
} from "@/lib/lighthouse/validation";
} from "@/lib/lighthouse-v1/validation";
import { handleApiError, handleApiResponse } from "@/lib/server-actions-helper";
import {
type LighthouseProvider,
PROVIDER_DISPLAY_NAMES,
} from "@/types/lighthouse";
} from "@/types/lighthouse-v1";
import type {
BedrockCredentials,
OpenAICompatibleCredentials,
OpenAICredentials,
} from "@/types/lighthouse/credentials";
} from "@/types/lighthouse-v1/credentials";

// API Response Types
type ProviderCredentials =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use server";

import { getLatestFindings } from "@/actions/findings/findings";
import { LighthouseBanner } from "@/components/lighthouse/banner";
import { LighthouseBanner } from "@/components/lighthouse-v1/banner";
import { LinkToFindings } from "@/components/overview";
import { ColumnLatestFindings } from "@/components/overview/new-findings-table/table";
import { CardTitle } from "@/components/shadcn";
Expand Down
1 change: 1 addition & 0 deletions ui/app/(prowler)/lighthouse/_actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./lighthouse-v2";
168 changes: 168 additions & 0 deletions ui/app/(prowler)/lighthouse/_actions/lighthouse-v2.adapter.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
import { describe, expect, it } from "vitest";

import {
buildLighthouseV2ConfigurationPayload,
mapLighthouseV2Configuration,
mapLighthouseV2Message,
mapLighthouseV2Model,
mapLighthouseV2Provider,
validateLighthouseV2ConfigurationInput,
} from "./lighthouse-v2.adapter";

describe("lighthouse-v2.adapter", () => {
describe("when mapping Cloud JSON:API resources", () => {
it("should map configuration attributes to UI fields", () => {
// Given
const resource: Parameters<typeof mapLighthouseV2Configuration>[0] = {
id: "config-1",
type: "lighthouse-ai-configurations",
attributes: {
provider_type: "bedrock",
base_url: null,
default_model: "anthropic.claude",
business_context: "Production AWS account",
connected: true,
connection_last_checked_at: "2026-06-24T10:00:00Z",
inserted_at: "2026-06-24T09:00:00Z",
updated_at: "2026-06-24T10:00:00Z",
},
};

// When
const config = mapLighthouseV2Configuration(resource);

// Then
expect(config).toEqual({
id: "config-1",
providerType: "bedrock",
baseUrl: null,
defaultModel: "anthropic.claude",
businessContext: "Production AWS account",
connected: true,
connectionLastCheckedAt: "2026-06-24T10:00:00Z",
insertedAt: "2026-06-24T09:00:00Z",
updatedAt: "2026-06-24T10:00:00Z",
});
});

it("should map supported provider and model payloads", () => {
// Given
const provider = {
id: "openai",
type: "lighthouse-supported-providers",
attributes: { name: "OpenAI" },
};
const model = {
id: "gpt-5.5",
type: "lighthouse-supported-models",
attributes: {
max_input_tokens: 100000,
max_output_tokens: 8192,
supports_function_calling: true,
supports_vision: false,
supports_reasoning: true,
},
};

// When / Then
expect(mapLighthouseV2Provider(provider)).toEqual({
id: "openai",
name: "OpenAI",
});
expect(mapLighthouseV2Model(model)).toEqual({
id: "gpt-5.5",
maxInputTokens: 100000,
maxOutputTokens: 8192,
supportsFunctionCalling: true,
supportsVision: false,
supportsReasoning: true,
});
});

it("should map message parts from backend names", () => {
// Given
const resource: Parameters<typeof mapLighthouseV2Message>[0] = {
id: "message-1",
type: "lighthouse-messages",
attributes: {
role: "assistant",
model: "gpt-5.5",
token_usage: { input: 10 },
inserted_at: "2026-06-24T10:01:00Z",
parts: [
{
id: "part-1",
type: "lighthouse-parts",
attributes: {
part_type: "text",
content: { text: "Done" },
tool_call_outcome: null,
inserted_at: "2026-06-24T10:01:00Z",
updated_at: "2026-06-24T10:01:00Z",
},
},
],
},
};

// When
const message = mapLighthouseV2Message(resource);

// Then
expect(message.parts[0]).toMatchObject({
id: "part-1",
type: "text",
content: { text: "Done" },
});
});
});

describe("when building Cloud payloads", () => {
it("should use Cloud Bedrock credential keys", () => {
// Given
const input = {
providerType: "bedrock" as const,
defaultModel: "anthropic.claude",
businessContext: "Production AWS account",
credentials: {
aws_access_key_id: "AKIA0000000000000000",
aws_secret_access_key: "a".repeat(40),
aws_region_name: "us-east-1",
},
};

// When
const payload = buildLighthouseV2ConfigurationPayload(input);

// Then
expect(payload.data).toMatchObject({
type: "lighthouse-ai-configurations",
attributes: {
provider_type: "bedrock",
credentials: {
aws_access_key_id: "AKIA0000000000000000",
aws_secret_access_key: "a".repeat(40),
aws_region_name: "us-east-1",
},
},
});
});

it("should require base_url for OpenAI-compatible configurations", () => {
// Given
const input = {
providerType: "openai-compatible" as const,
credentials: { api_key: "provider-key" },
};

// When
const result = validateLighthouseV2ConfigurationInput(input);

// Then
expect(result).toEqual({
success: false,
error: "Base URL is required for OpenAI-compatible providers.",
});
});
});
});
Loading
Loading