hasAllPackages

View as MarkdownOpen in Claude

Convenience wrapper around validatePackages() that returns a boolean. Mirrors the Python SDK’s validate_packages() -> bool return shape. Because it performs dynamic import() calls, the method is async.

Returns

Promise<boolean>true if every package in REQUIRED_PACKAGES imports successfully, false otherwise.

Example

1import { SkillBase } from '@signalwire/sdk';
2
3export class ScraperSkill extends SkillBase {
4 static SKILL_NAME = 'scraper';
5 static SKILL_DESCRIPTION = 'Scrapes web pages.';
6 static REQUIRED_PACKAGES = ['cheerio'];
7
8 async setup(): Promise<boolean> {
9 if (!(await this.hasAllPackages())) {
10 this.logger.error('Missing required packages');
11 return false;
12 }
13 return true;
14 }
15}