Files
prowler/ui/lib/lighthouse/tools/scans.ts
Chandrapal Badshah 74f7a86c2b feat(lighthouse): Add chat interface (#7878)
Co-authored-by: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com>
2025-06-12 15:19:41 +02:00

31 lines
744 B
TypeScript

import { tool } from "@langchain/core/tools";
import { getScan, getScans } from "@/actions/scans";
import { getScanSchema, getScansSchema } from "@/types/lighthouse";
export const getScansTool = tool(
async ({ page, query, sort, filters }) => {
const scans = await getScans({ page, query, sort, filters });
return scans;
},
{
name: "getScans",
description:
"Retrieves a list of all scans with options for filtering by various criteria.",
schema: getScansSchema,
},
);
export const getScanTool = tool(
async ({ id }) => {
return await getScan(id);
},
{
name: "getScan",
description:
"Fetches detailed information about a specific scan by its ID.",
schema: getScanSchema,
},
);