Documentation
¶
Index ¶
- Constants
- type Option
- type Provider
- func (p *Provider) Index(ctx context.Context, def spec.SkillDef) (spec.ProviderSkillIndexRecord, error)
- func (p *Provider) LoadBody(ctx context.Context, key spec.ProviderSkillKey) (string, error)
- func (p *Provider) ReadResource(ctx context.Context, key spec.ProviderSkillKey, resourceLocation string, ...) ([]llmtoolsgoSpec.ToolOutputUnion, error)
- func (p *Provider) RunScript(ctx context.Context, key spec.ProviderSkillKey, scriptLocation string, ...) (spec.RunScriptOut, error)
- func (p *Provider) Type() string
Constants ¶
const (
Type = "fs"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
func WithAllowedScriptExtensions ¶
WithAllowedScriptExtensions restricts which script extensions may be executed. This configures exectool.RunScriptPolicy.AllowedExtensions. Defaults:
- Windows: [".ps1", ".py"]
- non-Windows: [".sh", ".py"]
func WithExecutionPolicy ¶
func WithExecutionPolicy(policy exectool.ExecutionPolicy) Option
WithExecutionPolicy configures the exectool execution policy (timeouts/output caps/etc).
func WithRunScriptPolicy ¶
func WithRunScriptPolicy(policy exectool.RunScriptPolicy) Option
WithRunScriptPolicy configures exectool's RunScriptPolicy. NOTE: This is a *tool policy*. The provider does not implement hardening itself; it delegates to llmtools-go/exectool. This option just configures that tool.
func WithRunScripts ¶
WithRunScripts enables RunScript. Default is disabled.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) ReadResource ¶
func (p *Provider) ReadResource( ctx context.Context, key spec.ProviderSkillKey, resourceLocation string, encoding spec.ReadResourceEncoding, ) ([]llmtoolsgoSpec.ToolOutputUnion, error)
func (*Provider) RunScript ¶
func (p *Provider) RunScript( ctx context.Context, key spec.ProviderSkillKey, scriptLocation string, args []string, env map[string]string, workdir string, ) (spec.RunScriptOut, error)
RunScript
Security / hardening responsibilities: This provider is intentionally thin and delegates most hardening to llmtools-go tools.
Provider responsibility (skill-specific):
- Ensure all filesystem access (read/execute) is scoped to the *skill root directory*. We do this by configuring the underlying tool sandbox as: allowedRoots = [skillRoot] workBaseDir = skillRoot
Tool responsibility (generic hardening; enforced by llmtools-go/exectool runscript):
- Path resolution/normalization and sandbox enforcement against allowedRoots
- Refuse symlink traversal (workdir + script path + parent components)
- Validate env/args (format + defense-in-depth limits)
- Safe argv-to-shell quoting and interpreter selection by extension
- Timeouts/output caps and process-tree termination
- Dangerous command blocking + optional heuristics
Note: By design, scripts may live anywhere under the skill root (ideally under "scripts/").