@sqlrooms/ai / CompositeSkillStorage
Class: CompositeSkillStorage
A SkillStorage that priority-merges an ordered array of children (highest priority first). Children must own disjoint rootIds — the composite does not validate this; violating it makes dispatch ambiguous.
Implements
Constructors
Constructor
new CompositeSkillStorage(
children):CompositeSkillStorage
Parameters
| Parameter | Type |
|---|---|
children | readonly SkillStorage[] |
Returns
CompositeSkillStorage
Methods
listRoots()
listRoots():
Promise<SkillRoot[]>
Enumerate all roots known to this storage, in priority order (highest priority first).
Returns
Promise<SkillRoot[]>
Implementation of
listSkills()
listSkills(
rootId?):Promise<SkillListing[]>
List skills. If rootId is provided, returns only skills from that root. When called without a rootId, returns skills from every root; duplicates (same id in multiple roots) are included so callers can render conflict indicators.
Parameters
| Parameter | Type |
|---|---|
rootId? | string |
Returns
Promise<SkillListing[]>
Implementation of
readSkill()
readSkill(
ref):Promise<SkillRecord>
Read the full record for a single skill.
Parameters
| Parameter | Type |
|---|---|
ref | SkillRef |
Returns
Promise<SkillRecord>
Throws
a SkillNotFoundError if the ref does not resolve.
Throws
a SkillManifestError if the skill's skill.yaml fails to parse or validate.
Implementation of
writeSkill()
writeSkill(
rootId,id,content):Promise<SkillRef>
Create or overwrite a skill in the given root. Returns the resulting ref.
Parameters
| Parameter | Type |
|---|---|
rootId | string |
id | string |
content | SkillWriteContent |
Returns
Promise<SkillRef>
Throws
a SkillRootReadOnlyError if the target root is not writable.
Implementation of
deleteSkill()
deleteSkill(
ref):Promise<void>
Remove a skill from its root.
Parameters
| Parameter | Type |
|---|---|
ref | SkillRef |
Returns
Promise<void>
Throws
a SkillRootReadOnlyError if the ref's root is not writable.
Throws
a SkillNotFoundError if the ref does not resolve.
Implementation of
resolveSkillId()
resolveSkillId(
id):Promise<SkillRef|null>
Given a bare skill id, return the highest-priority SkillRef that holds it, or null if no root has the id.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<SkillRef | null>
Implementation of
subscribe()
subscribe(
listener): () =>void
Always implemented so consumers can call it unconditionally. Fans out to children that expose subscribe?; if none do, this is a noop returning a noop unsubscribe.
Parameters
| Parameter | Type |
|---|---|
listener | () => void |
Returns
() => void
