Class SkillRuntime
SkillLoadTool and the SkillPromptBuilder. HarnessSkillMiddleware owns one instance and installs
each filtered SkillCatalog into that call's RuntimeContext.
The load_skill_through_path tool is prepared during agent construction and verified
idempotently on later installs. Normal tool calls resolve the catalog from their
RuntimeContext, so concurrent sessions cannot overwrite or observe one another's filtered skill
view. A separate compatibility catalog is retained only for deprecated, context-free callers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.currentCatalog(io.agentscope.core.agent.RuntimeContext context) Returns the catalog bound tocontext, or an empty catalog when none is bound.voidinstall(SkillCatalog catalog, io.agentscope.core.agent.RuntimeContext context, io.agentscope.core.tool.Toolkit toolkit) Bind a catalog to the current call and ensure the load tool is registered on the toolkit (idempotent).voidinstall(SkillCatalog catalog, io.agentscope.core.tool.Toolkit toolkit) Deprecated.io.agentscope.core.tool.AgentToolloadTool()Underlying stateless tool instance.voidprepareToolkit(io.agentscope.core.tool.Toolkit toolkit) Ensures the skill loading tool is present as an ungrouped tool.renderPrompt(SkillCatalog catalog, io.agentscope.core.skill.SkillFilter filter) Renders the<available_skills>block + (when applicable) the code-execution prompt.
-
Constructor Details
-
SkillRuntime
public SkillRuntime() -
SkillRuntime
-
-
Method Details
-
currentCatalog
Deprecated.UsecurrentCatalog(RuntimeContext)so catalog lookup is request-scoped.Returns the catalog installed through the deprecated context-free API. -
currentCatalog
Returns the catalog bound tocontext, or an empty catalog when none is bound. -
loadTool
public io.agentscope.core.tool.AgentTool loadTool()Underlying stateless tool instance. Useinstall(SkillCatalog, RuntimeContext, Toolkit)for normal flow. -
prepareToolkit
public void prepareToolkit(io.agentscope.core.tool.Toolkit toolkit) Ensures the skill loading tool is present as an ungrouped tool.Harness calls this while the agent toolkit is still being assembled. The toolkit copy made by
ReActAgent.Buildertherefore contains the tool before its first model call. Keeping the loader ungrouped is intentional: ungrouped tools remain visible regardless of a session's persisted active-group list, including sessions created before the loader existed. -
install
public void install(SkillCatalog catalog, io.agentscope.core.agent.RuntimeContext context, io.agentscope.core.tool.Toolkit toolkit) Bind a catalog to the current call and ensure the load tool is registered on the toolkit (idempotent).The catalog is deliberately stored on
context, not on this shared runtime. This is the authorization boundary used bySkillLoadTool; a skill omitted from the call's filtered catalog cannot be loaded even while another session exposes it.- Parameters:
catalog- the call snapshot; passSkillCatalog.empty()to clear visibilitycontext- the current call context; may benull, in which case no catalog is exposedtoolkit- the toolkit to install onto; may benull(then only catalog is updated)
-
install
@Deprecated(since="2.2.0") public void install(SkillCatalog catalog, io.agentscope.core.tool.Toolkit toolkit) Deprecated.Installs a catalog for legacy context-free callers.This overload is retained for source and binary compatibility. Its catalog is used only when
SkillLoadToolis invoked without aRuntimeContext; context-bearing calls never fall back to it and therefore remain isolated. -
renderPrompt
Renders the<available_skills>block + (when applicable) the code-execution prompt.
-
currentCatalog(RuntimeContext)so catalog lookup is request-scoped.