Skip to main content

Interface: SkillRuntime

Defined in: packages/core/src/skill.ts:211

Properties

tools

tools: Record<string, ZodToolDefinition>

Defined in: packages/core/src/skill.ts:213

Hoisted tools: each skill's tools (tagged) + the load_skill/unload_skill loaders.

Methods

buildContext()

buildContext(input): Promise<string>

Defined in: packages/core/src/skill.ts:215

Per-turn system-prompt fragment: index (always) + active bodies (gated).

Parameters

input

string

Returns

Promise<string>


getActivations()

getActivations(input): SkillActivation[]

Defined in: packages/core/src/skill.ts:224

The skills whose instructions would be injected for this input, with the reason. Keyword match takes precedence as the reason (it's the immediate trigger); otherwise the skill is active because of a prior load_skill call. Pure — safe to call for observability without side effects. For what was actually injected on the latest turn (excluding a skill whose instructions threw), use getAppliedActivations.

Parameters

input

string

Returns

SkillActivation[]


getAppliedActivations()

getAppliedActivations(): SkillActivation[]

Defined in: packages/core/src/skill.ts:232

The activations the most recent buildContext actually injected into the prompt — the truthful basis for skill_activated events. Differs from getActivations only when a skill's instructions threw: it is active but its body was omitted, so it is not reported here. Returns [] before the first buildContext call.

Returns

SkillActivation[]


reset()

reset(): void

Defined in: packages/core/src/skill.ts:246

Forget every skill activated via load_skill. Keyword triggers are stateless and unaffected. The bot calls this from clearHistory() so a fresh conversation does not inherit skills loaded in a previous one.

Returns

void


setActivationListener()

setActivationListener(listener): void

Defined in: packages/core/src/skill.ts:240

Register a listener fired the instant a skill is newly activated by a load_skill call mid-turn — so the bot can emit a same-turn skill_activated event for the model's deliberate choice (the pre-turn sweep can't see it, since load_skill runs during the tool loop). Replaces any previous listener; pass undefined to clear.

Parameters

listener

((activation) => void) | undefined

Returns

void