| 168 | } |
| 169 | |
| 170 | function detect(pkg: any, items: Array<{ name: string; pkg: string | null; evidence?: string }>) { |
| 171 | const found: { name: string; version?: string; note?: string }[] = []; |
| 172 | for (const it of items) { |
| 173 | if (!it.pkg) continue; |
| 174 | const ver = hasDep(pkg, it.pkg); |
| 175 | if (ver) found.push({ name: it.name, version: String(ver), note: it.evidence || undefined }); |
| 176 | } |
| 177 | return found; |
| 178 | } |
| 179 | |
| 180 | export class DetectFrontendStackTool extends Tool<z.infer<typeof DetectFrontendStackArgs>> { |
| 181 | name = 'detect_frontend_stack'; |