fsskillprovider

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type = "fs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Provider) error

func WithAllowedScriptExtensions

func WithAllowedScriptExtensions(exts []string) Option

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

func WithRunScripts(enabled bool) Option

WithRunScripts enables RunScript. Default is disabled.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Provider, error)

func (*Provider) Index

func (*Provider) LoadBody

func (p *Provider) LoadBody(ctx context.Context, key spec.ProviderSkillKey) (string, error)

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/").

func (*Provider) Type

func (p *Provider) Type() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL