Class ShellPathPolicy
java.lang.Object
io.agentscope.harness.agent.skill.runtime.ShellPathPolicy
Resolves the absolute
filesRoot path emitted in <available_skills> and
load_skill_through_path responses, given a skill's MarketplaceStager.StageResult and the
current shell mode.
Three modes the policy knows about:
ShellPathPolicy.Mode.NO_SHELL— noShellExecuteToolregistered. Returnsnullfor every skill so the prompt omits<files-root>and the code-execution instruction block entirely.ShellPathPolicy.Mode.SANDBOX— sandbox-backed filesystem. Paths use the sandbox-internal prefix (/workspace/).ShellPathPolicy.Mode.LOCAL_WITH_SHELL—LocalFilesystemWithShell. Paths use the absolute host workspace root.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ShellPathPolicylocalWithShell(Path workspaceRoot) Local-with-shell mode — paths absolute on the host.mode()static ShellPathPolicynoShell()No shell is available; everyfilesRootresolves tonull.resolve(String skillName, MarketplaceStager.StageResult stage) Returns the absolutefilesRootfor the given skill, ornullwhen shell is unavailable / the skill has no shell-reachable representation.static ShellPathPolicysandbox()Sandbox mode — paths under the default/workspace/prefix.static ShellPathPolicySandbox mode with a custom workspace prefix.
-
Field Details
-
SANDBOX_WORKSPACE_PREFIX
- See Also:
-
-
Method Details
-
noShell
No shell is available; everyfilesRootresolves tonull. -
sandbox
Sandbox mode — paths under the default/workspace/prefix. -
sandbox
Sandbox mode with a custom workspace prefix. Use this when the sandbox backend mounts the workspace at a non-default location (e.g./home/agentscope/workspacefor AgentRun).- Parameters:
workspacePrefix- absolute path of the workspace root inside the sandbox
-
localWithShell
Local-with-shell mode — paths absolute on the host. -
mode
-
resolve
Returns the absolutefilesRootfor the given skill, ornullwhen shell is unavailable / the skill has no shell-reachable representation.- Parameters:
skillName- the skill'snamestage- staging outcome fromMarketplaceStager.stage(java.util.List<io.agentscope.harness.agent.skill.runtime.MarketplaceStager.RepoBound>, java.util.Map<io.agentscope.core.skill.repository.AgentSkillRepository, java.lang.String>)
-