Documentation
¶
Index ¶
- func RelativeWithinRoot(root, target string) (string, bool)
- func Resolve(workspaceRoot, targetPath string) (Path, *PathIssue)
- func RevisionSourcePath(agentDefinitionPath, sidecarName string) (string, error)
- func SafePathWithoutRoot(path string) string
- func SidecarPath(agentPath, sidecarName string) (string, error)
- func ValidAgentName(value string) bool
- type IssueKind
- type Path
- type PathIssue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RelativeWithinRoot ¶
RelativeWithinRoot returns a slash-normalized relative path and containment result.
func RevisionSourcePath ¶
RevisionSourcePath derives the authored sidecar source owned by an AGENT.md definition.
func SafePathWithoutRoot ¶
SafePathWithoutRoot bounds absolute-path disclosure to the managed suffix.
func SidecarPath ¶
SidecarPath derives a sidecar file path from an agent directory or AGENT.md path.
func ValidAgentName ¶
ValidAgentName reports whether value is one safe path component.
Types ¶
type IssueKind ¶
type IssueKind string
IssueKind classifies a managed-path failure without prescribing domain copy.
const ( IssueInvalidNUL IssueKind = "invalid_nul" IssueResolveRoot IssueKind = "resolve_root" IssueResolveTarget IssueKind = "resolve_target" IssueOutsideRoot IssueKind = "outside_root" IssueInspect IssueKind = "inspect" IssueSymlink IssueKind = "symlink" IssueSymlinkTargetOutside IssueKind = "symlink_target_outside" )
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a workspace-rooted path whose relative name cannot escape its root.
func (Path) Absolute ¶
Absolute returns the display/read path. Mutations use the rooted methods below.
func (Path) SourcePath ¶
SourcePath returns the portable workspace-relative path.
func (Path) ValidateNoSymlinks ¶
ValidateNoSymlinks rejects every existing symlink component while holding an os.Root.
type PathIssue ¶
PathIssue reports one safe, domain-neutral managed-path failure.
func SafeSourcePath ¶
SafeSourcePath derives a display-safe path and checks workspace containment.