Documentation
¶
Overview ¶
Package script defines approved Skill entrypoints and task-scoped process execution. It is independent of the Agent scheduler and sandbox implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ValidateArgs ¶
ValidateArgs applies baseline bounds before an optional business validator.
Types ¶
type Approval ¶
type Approval struct {
Metadata skill.Metadata
Scripts map[string]EntryPoint
Files map[string]string
Image string
Env map[string]string
}
Approval pins explicitly registered files at the time of review/initialization.
type Code ¶
type Code string
Code is a stable, model-safe execution outcome.
const ( CodeOK Code = "ok" CodeDisabled Code = "disabled" CodeUnsupportedHost Code = "unsupported_host" CodePermission Code = "permission_denied" CodeScriptMissing Code = "script_not_found" CodeDrift Code = "approval_drift" CodeInvalidArgs Code = "invalid_arguments" CodeImageMissing Code = "image_missing" CodeImagePull Code = "image_pull_failed" CodeContainer Code = "container_error" CodeScriptFailed Code = "script_failed" CodeTimeout Code = "timeout" CodeCanceled Code = "canceled" CodeResourceLimit Code = "resource_limit" CodeLogLimit Code = "log_limit" CodeOutputLimit Code = "output_limit" CodeWorkspaceLimit Code = "workspace_limit" CodeCleanup Code = "cleanup_failed" )
type EntryPoint ¶
EntryPoint explicitly permits one script. Version must change when a custom business argument validator changes, so suspended approvals detect policy drift.
type Error ¶
type Error struct {
Code Code
// contains filtered or unexported fields
}
Error hides backend paths, credentials and daemon diagnostics from tool output. Unwrap retains machine-readable cancellation and permission causes.
type Executor ¶
type Executor interface {
Fingerprint() string
CreateWorkspace(context.Context, string) (Workspace, error)
ValidateWorkspace(context.Context, Workspace) error
Execute(context.Context, Request) (Result, error)
ReleaseWorkspace(context.Context, Workspace) error
OpenFile(context.Context, Workspace, string) (io.ReadCloser, error)
Close(context.Context) error
}
Executor is the sandbox boundary. Implementations own task isolation, file access and process cleanup; an Agent never assumes a particular runtime.
type Registration ¶
type Registration struct {
SkillID string
Fingerprint string
Scripts []EntryPoint
Files []string
Image string
Env map[string]string
}
Registration is application-owned trust, never metadata read from SKILL.md. Files lists extra imports/assets required by Scripts; all files are pinned.
type Request ¶
type Request struct {
SkillID string
SkillFingerprint string
ScriptPath string
Args []string
Workspace Workspace
Timeout time.Duration
}
Request is supplied by trusted host code. Models receive only SkillID, ScriptPath and Args through the bound tool, never Workspace or Timeout.
type Result ¶
type Result struct {
Success bool `json:"success"`
Code Code `json:"code"`
ExitCode int `json:"exit_code"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
DurationMS int64 `json:"duration_ms"`
WorkspaceID string `json:"workspace_id,omitempty"`
Files []File `json:"files"`
Started bool `json:"-"`
}
Result includes partial logs and known effects on every execution outcome.