Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions Packs/pai-browser-skill/src/skills/Browser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"noEmit": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function resolveTemplatePath(path: string): string {
return resolve(templatesDir, path);
}

function loadTemplate(templatePath: string): HandlebarsTemplateDelegate {
function loadTemplate(templatePath: string): Handlebars.TemplateDelegate {
const fullPath = resolveTemplatePath(templatePath);

if (!existsSync(fullPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ function extractVariables(source: string): string[] {
// Match {{variable}} and {{object.property}}
const simpleVars = source.matchAll(/\{\{([a-zA-Z_][a-zA-Z0-9_.]*)\}\}/g);
for (const match of simpleVars) {
variables.add(match[1]);
if (match[1]) variables.add(match[1]);
}

// Match {{#each items}} and {{#if condition}}
const blockVars = source.matchAll(/\{\{#(?:each|if|unless|with)\s+([a-zA-Z_][a-zA-Z0-9_.]*)/g);
for (const match of blockVars) {
variables.add(match[1]);
if (match[1]) variables.add(match[1]);
}

return Array.from(variables).sort();
Expand All @@ -73,7 +73,7 @@ function extractHelpers(source: string): string[] {
for (const match of helperCalls) {
const name = match[1];
// Filter out built-in block helpers
if (!['if', 'unless', 'each', 'with', 'else'].includes(name)) {
if (name && !['if', 'unless', 'each', 'with', 'else'].includes(name)) {
helpers.add(name);
}
}
Expand All @@ -87,7 +87,7 @@ function extractPartials(source: string): string[] {
// Match {{> partialName}}
const partialCalls = source.matchAll(/\{\{>\s*([a-zA-Z_][a-zA-Z0-9_-]*)/g);
for (const match of partialCalls) {
partials.add(match[1]);
if (match[1]) partials.add(match[1]);
}

return Array.from(partials).sort();
Expand All @@ -99,19 +99,20 @@ function checkUnbalancedBlocks(source: string): string[] {
const lines = source.split('\n');

for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const line = lines[i]!;
Copy link

@neilsoult neilsoult Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love hacks like this in typescript. I think it's far better to use safe access operators and use default values rather than tell typescript to basically ignore typesafety on this const.

Suggested change
const line = lines[i]!;
const line = lines[i] ?? '';

const lineNum = i + 1;

// Opening blocks
const opens = line.matchAll(/\{\{#([a-z]+)/g);
for (const match of opens) {
blockStack.push({ name: match[1], line: lineNum });
if (match[1]) blockStack.push({ name: match[1], line: lineNum });
}

// Closing blocks
const closes = line.matchAll(/\{\{\/([a-z]+)\}\}/g);
for (const match of closes) {
const closer = match[1];
if (!closer) continue;
if (blockStack.length === 0) {
errors.push(`Line ${lineNum}: Unexpected closing block {{/${closer}}}`);
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client"

import { useState } from "react"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Badge } from "@/components/ui/badge"
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/Ui/card"
import { Badge } from "@/Components/Ui/badge"
import { Upload, FileText, Table, CheckCircle, XCircle, Loader2 } from "lucide-react"

interface UploadedFile {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server"
import { getTelosContext } from "@/lib/telos-data"
import { getTelosContext } from "@/Lib/telos-data"

export async function POST(request: Request) {
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server"
import { getAllTelosData } from "@/lib/telos-data"
import { getAllTelosData } from "@/Lib/telos-data"

export const dynamic = 'force-dynamic'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server"
import { getTelosFileCount, getTelosFileList } from "@/lib/telos-data"
import { getTelosFileCount, getTelosFileList } from "@/Lib/telos-data"

export const dynamic = 'force-dynamic'

Expand Down
4 changes: 2 additions & 2 deletions Packs/pai-telos-skill/src/DashboardTemplate/App/ask/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client"

import { useState } from "react"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Badge } from "@/components/ui/badge"
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/Ui/card"
import { Badge } from "@/Components/Ui/badge"
import { MessageSquare, Send, Bot, User } from "lucide-react"

interface Message {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { useState, useEffect } from "react"
import { useParams, notFound } from "next/navigation"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/Ui/card"
import { Button } from "@/Components/Ui/button"
import { FileText, Table as TableIcon, Edit2, Save, X } from "lucide-react"
import ReactMarkdown from "react-markdown"

Expand Down Expand Up @@ -179,7 +179,7 @@ function CSVTable({ content }: { content: string }) {
const lines = content.trim().split('\n')
if (lines.length === 0) return <p className="text-gray-500">Empty file</p>

const headers = lines[0].split(',').map(h => h.trim())
const headers = lines[0]!.split(',').map(h => h.trim())
const rows = lines.slice(1).map(line => line.split(',').map(cell => cell.trim()))

return (
Expand Down
4 changes: 2 additions & 2 deletions Packs/pai-telos-skill/src/DashboardTemplate/App/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from "next"
import "./globals.css"
import { Sidebar } from "../components/sidebar"
import { Sidebar } from "../Components/sidebar"

export const metadata: Metadata = {
title: "TELOS Dashboard Template",
Expand All @@ -10,7 +10,7 @@ export const metadata: Metadata = {
export default function RootLayout({
children,
}: Readonly<{
children: React.Node
children: React.ReactNode
}>) {
return (
<html lang="en">
Expand Down
2 changes: 1 addition & 1 deletion Packs/pai-telos-skill/src/DashboardTemplate/App/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/Ui/card"
import { TrendingDown } from "lucide-react"

export default function OverviewPage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Progress } from "@/components/ui/progress"
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/Ui/card"
import { Progress } from "@/Components/Ui/progress"
import { TrendingUp } from "lucide-react"

export default function ProgressPage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Badge } from "@/components/ui/badge"
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/Ui/card"
import { Badge } from "@/Components/Ui/badge"
import { Users } from "lucide-react"

export default function TeamsPage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Badge } from "@/components/ui/badge"
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/Ui/card"
import { Badge } from "@/Components/Ui/badge"
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/Components/Ui/table"
import { Shield, AlertTriangle } from "lucide-react"

export default function VulnerabilitiesPage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
import { cn } from "@/Lib/utils"

const badgeVariants = cva(
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
import { cn } from "@/Lib/utils"

const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react"
import { cn } from "@/lib/utils"
import { cn } from "@/Lib/utils"

const Card = React.forwardRef<
HTMLDivElement,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import * as React from "react"
import { cn } from "@/lib/utils"
import { cn } from "@/Lib/utils"

interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
value?: number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react"
import { cn } from "@/lib/utils"
import { cn } from "@/Lib/utils"

const Table = React.forwardRef<
HTMLTableElement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import Link from "next/link"
import { usePathname } from "next/navigation"
import { Home, MessageSquare, Upload, FileText, Table } from "lucide-react"
import { cn } from "@/lib/utils"
import { Badge } from "@/components/ui/badge"
import { cn } from "@/Lib/utils"
import { Badge } from "@/Components/Ui/badge"
import { useEffect, useState } from "react"

interface FileNav {
Expand Down
2 changes: 2 additions & 0 deletions Packs/pai-telos-skill/src/DashboardTemplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"typescript": "^5"
},
"dependencies": {
"@radix-ui/react-slot": "^1.2.4",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.546.0",
"next": "^15.5.6",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-markdown": "^10.1.0",
"tailwind-merge": "^3.3.1"
}
}
4 changes: 3 additions & 1 deletion Packs/pai-telos-skill/src/DashboardTemplate/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"compilerOptions": {
// Environment setup & latest features
"lib": [
"ESNext"
"ESNext",
"DOM",
"DOM.Iterable"
],
"target": "ESNext",
"module": "Preserve",
Expand Down
16 changes: 8 additions & 8 deletions Packs/pai-telos-skill/src/ReportTemplate/App/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CoverPage } from "@/components/cover-page"
import { Section } from "@/components/section"
import { Callout } from "@/components/callout"
import { Exhibit } from "@/components/exhibit"
import { FindingCard } from "@/components/finding-card"
import { RecommendationCard } from "@/components/recommendation-card"
import { Timeline } from "@/components/timeline"
import { reportData } from "@/lib/report-data"
import { CoverPage } from "@/Components/cover-page"
import { Section } from "@/Components/section"
import { Callout } from "@/Components/callout"
import { Exhibit } from "@/Components/exhibit"
import { FindingCard } from "@/Components/finding-card"
import { RecommendationCard } from "@/Components/recommendation-card"
import { Timeline } from "@/Components/timeline"
import { reportData } from "@/Lib/report-data"
import { AlertTriangle, Target, Lightbulb, CheckCircle2 } from "lucide-react"

export default function ReportPage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SeverityBadge } from "./severity-badge"
import type { Finding } from "@/lib/report-data"
import type { Finding } from "@/Lib/report-data"

interface FindingCardProps {
finding: Finding
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from "@/lib/utils"
import type { Recommendation } from "@/lib/report-data"
import { cn } from "@/Lib/utils"
import type { Recommendation } from "@/Lib/report-data"
import { ArrowRight, Clock, Zap } from "lucide-react"

interface RecommendationCardProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from "@/lib/utils"
import { cn } from "@/Lib/utils"

interface SectionProps {
title: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from "@/lib/utils"
import { cn } from "@/Lib/utils"

type Severity = "critical" | "high" | "medium" | "low"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TimelinePhase } from "@/lib/report-data"
import type { TimelinePhase } from "@/Lib/report-data"

interface TimelineProps {
phases: TimelinePhase[]
Expand Down