addSkill
Add a skill to the manager. The call sequence is:
- Deduplicate by instance key (multi-instance skills with the same key are skipped with a warning; single-instance duplicates throw).
- Validate required environment variables — throws if any are missing.
- Validate that the skill’s
getParameterSchema()returns a non-empty object. - Validate required NPM packages — throws if any cannot be imported.
- Call
setup()— throws if it returnsfalse. - Mark the skill initialized and register it.
addSkill fails closed: any validation miss or a setup() returning
false throws and the skill is not registered. The wrapper methods
loadSkill / loadSkillByName catch and convert the throw into a
[false, message] tuple that matches the Python SDK’s load_skill contract.
Parameters
skill
The skill instance to add.
Returns
Promise<void>
Throws
Error— duplicate single-instance skill already loaded.Error— missing required environment variables.Error—getParameterSchema()returns an empty object.Error— missing required NPM packages.Error—setup()returnedfalse.