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

import { SkillBase } from '@signalwire/sdk';
export class ScraperSkill extends SkillBase {
static SKILL_NAME = 'scraper';
static SKILL_DESCRIPTION = 'Scrapes web pages.';
static REQUIRED_PACKAGES = ['cheerio'];
async setup(): Promise<boolean> {
if (!(await this.hasAllPackages())) {
this.logger.error('Missing required packages');
return false;
}
return true;
}
}