Interface: ISkillRegistry
Defined in: internal/skill-registry/types.ts:47
The skills of a call: the merged list of the profile's and the call's skills, validated.
Implemented by SkillRegistry; the type of IAIGatewayDeps.skillRegistry, so a host may pass its own in overrides.
Asked by AIProfileStore.upsertProfile (the profile alone) and by the call preparation (the profile and the call).
Methods
makeLoadSkillTool()
makeLoadSkillTool(
args):IToolDef<ILoadSkillInput,ILoadSkillResult>
Defined in: internal/skill-registry/types.ts:115
makeLoadSkillTool -- the built-in dyna_aigw_load_skill tool of one call
About
The model asks for a skill by name and gets its instructions; nothing else can be asked for.
The tool's name input is an enum of the given skills' names, so the model cannot load a skill the call does not have.
policy is ALLOW, it never ends the run and is visible on every step; maxOutputChars is sized to the longest
serialised {name, body}, so a long body is never cut by the registry's default. execute returns {name, body}.
Who needs it
The call preparation of a run() and of a resume(), with the list resolve returned, when that list is not empty.
An ask() never builds it: without tools the bodies are inlined.
Pitfalls
An empty list is a 400: the tool must not be offered when there is nothing to load.
Parameters
args
skills
ISkill[]
The resolved skills of the call (resolve); at least one.
Returns
IToolDef<ILoadSkillInput, ILoadSkillResult>
renderSlot()
renderSlot(
args):string
Defined in: internal/skill-registry/types.ts:88
renderSlot -- the text of the {skills} slot of CHAT_MAIN
About
Listed when the model can load them, written out when it cannot.
inline: false (a run(), the dyna_aigw_load_skill tool is offered): a header that tells the model to call dyna_aigw_load_skill and
one - name: description line per skill, so the bodies cost nothing until a task needs one. inline: true (an ask(),
no tools): the header "Skills — instructions for this call:" and every skill as a ## name section with its body.
No skills: an empty string, the slot renders to nothing.
Who needs it
ContextAssembler.build, with the resolved list of the call and whether dyna_aigw_load_skill is among the call's tools.
Parameters
args
inline
boolean
true writes the bodies into the prompt; false lists name and description for dyna_aigw_load_skill.
skills
ISkill[]
The resolved skills of the call (resolve), in order.
Returns
string
resolve()
resolve(
args):ISkill[]
Defined in: internal/skill-registry/types.ts:65
resolve -- the skills of one call as one list
About
The profile's skills first, then the call's; unique names or nothing.
A name that is empty after a trim, or that appears twice among the given skills (within one list or across the two), is a
400 whose data names the duplicates and counts the emptyNames. More skills than maxSkills (default 50) is a 400
with data.maxSkills and data.count; a body longer than maxBodyChars (default 50 000) is a 400 with
data.maxBodyChars, data.skill and data.length. Nothing else is changed: the skills come back as given, in order.
Who needs it
AIProfileStore.upsertProfile with the profile alone, so a profile with a duplicate is never stored; the call preparation
of ask(), run() and resume() with the profile and the call's skills, before anything of the call is stored.
Parameters
args
profile
The profile of the call; its skills come first.
skills?
ISkill[]
The call's skills (IGatewayAskInput.skills), appended after the profile's.
Returns
ISkill[]