| 264 | |
| 265 | // Validate script package (URL validation) |
| 266 | async function validateScriptPackage(pkg: Package): Promise<boolean> { |
| 267 | if (!pkg.metadata?.scriptUrl) { |
| 268 | return false; |
| 269 | } |
| 270 | |
| 271 | const { linux, windows } = pkg.metadata.scriptUrl; |
| 272 | const urls = [linux, windows].filter(Boolean); |
| 273 | |
| 274 | if (urls.length === 0) { |
| 275 | return false; |
| 276 | } |
| 277 | |
| 278 | // Check at least one URL is accessible |
| 279 | for (const url of urls) { |
| 280 | try { |
| 281 | const response = await fetch(url as string, { method: 'HEAD' }); |
| 282 | if (response.ok) { |
| 283 | return true; |
| 284 | } |
| 285 | } catch { |
| 286 | // Try next URL |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | return false; |
| 291 | } |
| 292 | |
| 293 | // Validate a single package |
| 294 | async function validatePackage( |